trevorsandy / lpub3d

An LDraw™ editor for LEGO® style digital building instructions.
https://trevorsandy.github.io/lpub3d/
130 stars 19 forks source link

First value in "Add LDView Assembly Rendered Arguments" conflated with prior argument #727

Closed d-j-m-0 closed 1 year ago

d-j-m-0 commented 1 year ago

Subject

When using the context menu on an assembly being rendered with LDView and selecting the menu item "Add LDView Assembly Rendered Arguments", the first argument entered is conflated with the immediately prior argument when LDView is invoked. This leads to unpredictable renderer behaviour.

For example, the LDView command line arguments ModelSize and ModelCenter can be used to zoom and crop an image. But when the first argument is conglated to the prior argument, the desired parameter is not passed to LDView.

The first screen shot illustrates the desired image cropping, which was achieved by inserting extra "noise" parameter values: p3_zoomed

with the invoking of the LDView process and its argument being:

p3_ldview_invoke

However, when invoked without the "niose" parameters on the next page, the desired rendering does not result: p4_not_zoomed

the conflation of the first user supplied LDView argument can be seen in the process invocation.: p4_ldview_invoke

Environment

Steps to reproduce

The mpd in the attached zip file contains a model displaying this behaviour. Open the model, navigate to page 3 and then page 4. Page 3 is rendered as expected, page 4 is not.

ldview_args.zip

Expected behaviour

All the user supplied additional arguments should be passed to LDView.

Actual behaviour

The first user supplied argument is being conflated to the immediately prior LPub3D generated argument.

Workaround

Set the first parameter in the dialog to serve as a "noise" argument to the remaining arguments are passed successfully.

Solution suggestion

When user arguments for LDView are supplied, prepend a space to the front of the user argument list and don't trim it.

trevorsandy commented 1 year ago

Thank you for reporting this behaviour.

This behaviour has been corrected.

Cheers,