Build modifications

Build modification (or BuildMod) is a new feature in LPub3D with which you can achieve the same as Buffer Exchange and even more. It is designed to allow the user to basically add, remove, move, rotate, and edit color of a STEP's parts. LEGO does this a lot in its instructions.

A more extensive write-up is forthcoming.

To enable it, go to the Project Globals Setup and check Enable Build Modifications.

This inserts the meta command 0 !LPUB BUILD_MOD_ENABLED GLOBAL TRUE.

Best practice is to do this immediately when starting to work on a new model, so that the meta command is at the first few lines of LPub code.

Just like Buffer Exchange, BuildMod has a specific range and structure of meta commands that has to be inserted in the right order and place in the LDraw code. This is how it should look like:


  1. 1 C X Y Z 1 0 0 0 1 0 0 0 1 some parts .dat

  2. 0 !LPUB BUILD_MOD BEGIN "Mod1"

  3. 1 C X Y Z 1 0 0 0 1 0 0 0 1 part.dat

  4. 1 optional helper (arrow)

  5. 0 !LPUB BUILD_MOD END_MOD

  6. 1 C X Y Z 1 0 0 0 1 0 0 0 1 part.dat

  7. 0 !LPUB BUILD_MOD END

  8. 0 STEP

  9. 0 !LPUB BUILD_MOD REMOVE "Mod1"

  10. Etc.

Lines 1 to 8 explained

  1. Bricks in this step in the correct place

  2. Start defining the BuildMod by naming the mod, ie. Mod1.

  3. One or more bricks that hover somewhere above or next to the model.

  4. Add optional helper parts like arrows

  5. End the defininition of this modification

  6. The same part (or parts) you defined in step 3 in the correct place in the model

  7. End setting the modification

  8. Step

  9. Remove the parts in line 3 and 4 and render the model with the parts in the right place like in line 7

  10. Rest of the model, steps, etc.

You can download a prepared model file here and try it.

Please note that in order for this file to work, you must have installed and set up the Helper files too. Please refer to using custom parts here.