trevorsandy / lpub3d

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

BUILD_MOD REMOVE must be placed after MULTI_STEP END #664

Closed jacovandermolen closed 1 year ago

jacovandermolen commented 1 year ago

Subject

BUILD_MOD REMOVE must be placed after MULTI_STEP END

Environment

Steps to reproduce

Adding a Build Mod somewhere and later removing it in the first step of a single step page after a multistep page gives this error

image

Expected behaviour

0 STEP 0 !LPUB MULTI_STEP END 0 !LPUB BUILD_MOD REMOVE "main.ldr Mod 1"

Actual behaviour

0 STEP 0 !LPUB BUILD_MOD REMOVE "main.ldr Mod 1" 0 !LPUB MULTI_STEP END

Workaround

Using the Command editor move the line 0 !LPUB BUILD_MOD REMOVE "main.ldr Mod 1" after 0 !LPUB MULTI_STEP END

Solution suggestion

Would it be possible to detect 0 !LPUB MULTI_STEP END and place the BM Remove command always after that line.

trevorsandy commented 1 year ago

Thank you for reporting this behaviour.

I'll take a look.

For your information, there are still some untreated behaviours when attempting to use the visual editor with multiple build modification commands in the same step. Notably, when both action (REMOVE/APPLY) and declaration (BEGIN) commands are present. Addressing this is on my TODO list.

Cheers,

trevorsandy commented 1 year ago

This behaviour has been corrected.

Cheers,

jacovandermolen commented 1 year ago

https://github.com/trevorsandy/lpub3d-ci/releases

technicbasics commented 1 year ago

Thanks!

jacovandermolen commented 1 year ago

Hi, I saw there is a new version. I am lacking some time now, but I will try to test things out soon.

trevorsandy commented 1 year ago

Excellent. Many thanks.

Cheers,

technicbasics commented 1 year ago

Hi Trevor

Small question by the side: Is it possible to use Buffer Exchange and Build Mod togehter? BE for construction steps that are consecutive, and BM if there are some other steps in between.

Johann

trevorsandy commented 1 year ago

Hello Johann

_Is it possible to use Buffer Exchange and Build Mod together?

It should be. Although, I have not specifically run such use case, the BuildMod solution architecture is exclusive. In fact, it should even be possible to include a BUFEXCHG block in a BuildMod block.

Do not hesitate to let me know if you encounter any unexpected behaviour running such use cases.

Cheers,

technicbasics commented 1 year ago

HI Trevor Just tested something, it looks like it works. But I currently only have the problem, when LPub crashes with the native renderer, that some submodels are deleted. Mostly those that contain Buffer Exchange commands, but also others. It seems that the problem is also with the LDView renderer.

trevorsandy commented 1 year ago

But I currently only have the problem, when LPub crashes with the native renderer, that some submodels are deleted. Mostly those that contain Buffer Exchange commands, but also others. It seems that the problem is also with the LDView renderer.

Thank you for reporting this behaviour.

Can you provide an example model file that reproduces this behaviour ?

The Buffer Exchange use cases I ran have all resulted in their expected behaviour.

The sample file in Ticket #671 extensively uses Buffer Exchange. This file runs to completion without error on the latest release. I did not experience any abnormal end.

Cheers,

technicbasics commented 1 year ago

Hi Trevor No problem How can I send you the file(s)?