[LDView?] Programatically generate snapshots - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html) +--- Thread: [LDView?] Programatically generate snapshots (/thread-14866.html) |
[LDView?] Programatically generate snapshots - Jon Carbone - 2014-12-12 Hello, I've never worked with LDView before, but after installing it and playing around with it, it looks like it fulfills a need I have for a project I'm working on. I'd like to generate rendered snapshots (either in memory or saved to disk) of a part (.DAT file) from different camera angles by making calls to a DLL (LDVLib.dll I think). The application I'm working with is C#, so if there's any existing wrapper that exposes library calls then having that would be a great start. Otherwise I'll probably end up writing my own, so long as it looks possible to do after I look at the header files. Any guidance, experiences, or even questions would be greatly appreciated. Thanks! Re: [LDView?] Programatically generate snapshots - Travis Cobbs - 2014-12-12 LDVLib.dll can definitely be accessed from C#. That's what my personal test program used. But there's no public wrapper, just the C header file, which people who know how to do C#/C interop can use to create the C# DllImport declarations necessary to make it work. However, the point is probably moot, because it doesn't support snapshots. They are definitely something that's on my list if I ever get around to working on it again, but that functionality doesn't exist right now. Re: [LDView?] Programatically generate snapshots - Willy Tschager - 2014-12-13 Jon Carbone Wrote:I'd like to generate rendered snapshots (either in memory or saved to disk) of a part (.DAT file) from different camera angles If it is just for the snapshots you're looking for batchfiling LDView might helps: http://www.holly-wood.it/ldview-en.html w. Re: [LDView?] Programatically generate snapshots - Travis Cobbs - 2014-12-14 Willy has a point. If the command line camera support works, then you can take that route. I tracked down my old C# test program for LDVLib. I'm not sure if it still works, but its VS2010 source code is here: https://dl.dropboxusercontent.com/u/77319025/LDVLibTester.zip Note that you have to manually copy LDVLib.dll into the same directory that the .exe file is in before you run the program. As I already mentioned, LDVLib itself won't let you take snapshots. You can do a screen capture of the LDVLib rendering window, but you have to be absolutely sure that nothing else is obscuring it, and you would be limited to image sizes that fit on the screen. |