LDView interface with LPub3D


interface with LPub3D
#1
I am hoping that someone, maybe Travis, can provide some insight on how this works. 

I have run into this issue, and also saw someone post on eurobricks about this same thing. 

LPub3D will render only the part of the assembly that is on the page. 

There are a couple of example images posted here:
https://www.eurobricks.com/forum/index.p...-the-page/

I tried to edit the LDview parameter ini file that is in the configuration menu of LPub3D but I didnt get any where. 

I am hoping that adding a parameter to the LDview parameters ini file within LPub3D can force the render of the whole model regardless of the page size that is being called for. Is this even possible without having to dig into the source code of LPub3D?

Thanks in advance!
Reply
RE: interface with LPub3D
#2
(2020-09-07, 7:34)Cam\s Bricks Wrote: I am hoping that someone, maybe Travis, can provide some insight on how this works. 

I have run into this issue, and also saw someone post on eurobricks about this same thing. 

LPub3D will render only the part of the assembly that is on the page. 

Unfortunately, the camera placement calculation is fully part of LPub3D. (LDView has camera calculations, but it bases them on what is included in its command line, and that is what is determining how things get drawn.) So I have no idea what is causing the problem.

You might check if changing the DPI setting LPub3D (assuming that's a thing) makes any difference. If so, I would guess that LPub3D's view calculations aren't working properly with LDView and non-default DPI settings.
Reply
RE: interface with LPub3D
#3
(2020-09-07, 18:39)Travis Cobbs Wrote: Unfortunately, the camera placement calculation is fully part of LPub3D. (LDView has camera calculations, but it bases them on what is included in its command line, and that is what is determining how things get drawn.) So I have no idea what is causing the problem.

You might check if changing the DPI setting LPub3D (assuming that's a thing) makes any difference. If so, I would guess that LPub3D's view calculations aren't working properly with LDView and non-default DPI settings.

Its not so much that it doesnt work but that the call for the image size is determined by the page size and dpi setting in LPub3D. 

I was hoping that you may have some insight or even a debug function to see what LPub3D is requesting, compare that to the availble settings in the INI file, and see if we may be able to alter that by pushing additional parameters through the command line. 

In messing with LDview from the command line in the past, I have been able to determine that you can set a very large image size and then it will autocrop it down to the size of the object. 

This is the behavior I was hoping to replicate from LPub3D. 

Everything above here was a total stream of consciousness. 

Upon reading the spec again for the command line it seems that a "SaveHeight" and "SaveWidth" argument added to the INI file but upon trying that, no dice. Those parameters are calculated somewhere because the width of my page is part of the Current Step Image (CSI) file name. I think I will have to dig around some more or find more work around process.
Reply
RE: interface with LPub3D
#4
(2020-09-08, 6:19)Cam's Bricks Wrote: Upon reading the spec again for the command line it seems that a "SaveHeight" and "SaveWidth" argument added to the INI file but upon trying that, no dice. Those parameters are calculated somewhere because the width of my page is part of the Current Step Image (CSI) file name. I think I will have to dig around some more or find more work around process.

With LDView, arguments on the command line always take precedence over arguments in the ini file. I suspect that LPub3D includes SaveWidth and SaveHeight in its command line. Also, changing SaveWidth and SaveHeight probably isn't what you want to do, since that would just change how big the render is; the same geometry would still be rendered, and if it is cropped, it would just be cropped in a different sized image.

LDView has (commented out) code that could log things like the command line to a log file. I guess I could update that code to be enabled via a setting (in the INI file or the registry). But you wouldn't be able to make use of my changes until LPub3D pulled new LDView code.
Reply
RE: interface with LPub3D
#5
(2020-09-08, 6:19)Cam's Bricks Wrote: <snip/>

Everything above here was a total stream of consciousness. 

Upon reading the spec again for the command line it seems that a "SaveHeight" and "SaveWidth" argument added to the INI file but upon trying that, no dice. Those parameters are calculated somewhere because the width of my page is part of the Current Step Image (CSI) file name. I think I will have to dig around some more or find more work around process.

At the risk of telling you something you already know ...

If you want to explore the command line that LPub3D uses to invoke LDView, perhaps consider using Process Explorer. You can see the invocation of LDView by the LPub3D process ...

[Image: lpub3d_command_01.png]

In Process Explorer, press the spacebar (quickly!) to freeze the refresh of the screen and then right click on the process, selecting Properties ...

[Image: lpub3d_command_02.png]

This will enable you to see the command line used to invoke LDView. Perhaps then try tutu-ing with different page sizes and DPI to see the effect on the generated command line.

Regards,

David
Reply
RE: interface with LPub3D
#6
Big Grin 
(2020-09-08, 20:20)Travis Cobbs Wrote: <snip>

Also, changing SaveWidth and SaveHeight probably isn't what you want to do, since that would just change how big the render is; the same geometry would still be rendered, and if it is cropped, it would just be cropped in a different sized image.

<snip>

Actually that is exactly what I am after. I want the same model size so the DPI and camera settings from LPub3D but I just want more of the model. 

The model size in combination with the zoom level I have currently is larger than the page size so I want to be able to pan that image around on the page. 

(2020-09-08, 22:53)David Manley Wrote: At the risk of telling you something you already know ...
<snip>

I actually had no idea about this. My way of learning new skills is to jump off the deep end so jumping into some light programming to fix my LEGO instructions is par for the course  Big Grin
Reply
RE: interface with LPub3D
#7
(2020-09-09, 0:07)Cam's Bricks Wrote: Actually that is exactly what I am after. I want the same model size so the DPI and camera settings from LPub3D but I just want more of the model. 

I think you misunderstood. Changing the image size (SaveWidth and SaveHeight) without changing the camera information is equivalent to resizing the PNG after the fact. Clearly that won't help.


(2020-09-09, 0:07)Cam's Bricks Wrote: The model size in combination with the zoom level I have currently is larger than the page size so I want to be able to pan that image around on the page. 

That requires changing the camera-related info for LDView, and since LPub3D has that on the command line, you can't do that. (As an aside, some LDView command line arguments only work on the command line; setting them in an INI file or in the Windows Registry would have no effect, even if those command line options were omitted on the command line.)

Based on David's post, SaveWidth and SaveHeight are both specified on the command line by LPub3D. Also specified is the camera angle (0.1 degrees), and the camera globe (including distance). That distance (along with the camera angle) determines the effective zoom level in LDView. You could in theory set ModelCenter to pan, but you'd have to figure out the value you want on your own.
Reply
RE: interface with LPub3D
#8
(2020-09-07, 7:34)Cam's Bricks Wrote: I am hoping that someone, maybe Travis, can provide some insight on how this works. 

I have run into this issue, and also saw someone post on eurobricks about this same thing. 

LPub3D will render only the part of the assembly that is on the page. 

There are a couple of example images posted here:
https://www.eurobricks.com/forum/index.p...-the-page/

I tried to edit the LDview parameter ini file that is in the configuration menu of LPub3D but I didnt get any where. 

I am hoping that adding a parameter to the LDview parameters ini file within LPub3D can force the render of the whole model regardless of the page size that is being called for. Is this even possible without having to dig into the source code of LPub3D?

Thanks in advance!

I was producing some instructions using LPub3D today when I encountered a content menu item (i.e. right mouse-click) that I didn't previously know about:

[Image: lpub3d_ldview_argument_01.png]

Which displays the following dialog window when selected:

[Image: lpub3d_ldview_argument_02.png]

I haven't gone beyond clicking the menu item and opening the dialog window but ... it does look like that there is some kind of capability within LPub3D to provide arguments to LDraw specific to an individual diagram. It this works, it may mean you can avoid having to tu-tu with the command line and provide the desired rendering out of the box.

If you get a chance to try this, would you please post back here and let us know whether or not it provides a solution to what you are trying to achieve.

Regards,

David
Reply
RE: interface with LPub3D
#9
(2020-09-13, 2:27)David Manley Wrote: I was producing some instructions using LPub3D today when I encountered a content menu item (i.e. right mouse-click) that I didn't previously know about:
Which displays the following dialog window when selected:

[Image: lpub3d_ldview_argument_02.png]

I haven't gone beyond clicking the menu item and opening the dialog window but ... it does look like that there is some kind of capability within LPub3D to provide arguments to LDraw specific to an individual diagram. It this works, it may mean you can avoid having to tu-tu with the command line and provide the desired rendering out of the box.

If you get a chance to try this, would you please post back here and let us know whether or not it provides a solution to what you are trying to achieve.

Regards,

David

Hi David,

Thanks for that info! I did know about that menu and adding the “savewidth” and “saveheight” commands don’t nothing. Those seem to be generated somewhere else in the program based on page dimensions and dpi settings. 

I haven’t had the chance to look much more but it seems that without looking at the source code to determine how to effect the change there, I won’t be able to change it. 

Ideally, if I was able to get a hold of Trevor, there would be a check box in preferences that would allow the extents of the model to be rendered regardless of page size. 

From a code standpoint it would likely look something like, calculate model scale and camera based on dpi then calculate extents of the model then generate the CSI

What is strange is that if you have a multi step page the behavior is not present. It will render the full image of the model no matter the size.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)