| Some
suggestions about Building Blocks in Virtools |
|
Don't use BBs in scripts to do things that you can do manually instead. Many BBs simply set
parameters on objects that you can otherwise do in the setup windows.
Only use the BB if those parameters are being changed dynamically over
the course of the running scene. Another example is the common mistake of using the Declare Obstacle BB for collision detection. Reading the manual, you'll see how to manually set the attributes on an object to declare it as an fixed or moving obstacle. It's most likely you will declare obstacles during the authoring stage rather than dynamically. Using the Declare Obstacle BB in a loop is a useless action. Ask yourself "Can
I do this manually in the setups or do I really need to use this BB?" Some BBs can be useful in (temporary) authoring scripts rather than for the final run time. A good example is
the Invert Winding BB (Mesh Modifications/Local Deformation).
Another example might be Set Material BB (Material-Textures/Basic). If you want an object to share a material that is elsewhere in the scene, you'll need to use this BB since the Mesh setup window does not allow manually changing Materials (although note that the Material setup does allow you to manually select assigned Textures.) This can get bigger in scale. What if you accidently wind up with a scene that has 100+ textures that are way too big in resolution? You could use the setup window and rescale them manually one by one - OR you could put them all in a group with one click, then make a script using a Group Iterator BB and a Set Texture Size BB and you are all set! (Once done, you don't need the script any more, but you could package it into a "Behavior Graph" and save it for when you make that same mistake again!) Think of using scripts to help YOU in the authoring process, rather than just how they serve the end result. This way of thinking can lead to fun solutions, such as having a script automatically build a labyrinth through random functions - then every time you run the script it will be a new maze for you to find your way out of!
|