Hi!
Lately I've been training a lot of people within the entertainment industry on how to use Vectorworks Spotlight for their CAD needs. One of the areas that I've noticed that they find a bit counter intuitive and tedious, is the way we currently aim our lights with focus points - especially if each light needs it's own focus point.
Say for instance that you have 10 lighting devices next to each other and wish for all of them to look straight ahead in 3D, you would have to create 10 focus points, place them at the desired positions and then assign these to each lamp. This can be done a bit more efficiently by using the "Move by Points"-tool in conjunction with the "Spotlight Numbering"-tool, but it's still a process that requires a lot of clicks and might be a bit advanced for new users.
Marionette, Python and Vectorscript to the rescue!
So I've been putting together a tool, using the existing Marionette-nodes together with a few custom nodes containing Vectorscript in Python form, that assists Spotlight users in assigning multiple focus points to multiple lighting devices based on the lighting device position and rotation. This tool allows the user to select the desired lighting devices they wish to focus and run the command where they can set the following parameters through a popup dialog:
Height/Z-value of focus point/s
Distance between lighting device/s and focus point/s
Shape of the focus point/s
Class for the focus point/s
Name visibility for focus point/s
I've got all of this basic functionality working in a Marionette-network and the tool generates the focus points as desired, but I'm encountering a few problems that I think are connected to how Marionette behaves depending on which state the network is in. By that, I mean if the network is unwrapped, wrapped or turned into a Marionette Command. Since I need to work with selections, I have to make the tool a Marionette Command which is giving me the following issues:
For some reason, the script gives me the generated focus points in a nested group (a group within another group). I've tried using the ungroup node and also creating my custom node that tries to force an ungroup, but with no success. If I instead run the Marionette script from the wrapper or unwrapped, I don't get this behavior with nested groups and I can also force an ungroup. It also behaves differently regarding what is selected after the script has been run. If I run the script as a Marionette Command, it adds the group with the focus points to my current selection with the lighting devices. If I run the script unwrapped/wrapped, I only get the group with the focus points as my selection.
When the focus points are generated through the script Marionette Command, they aren't visible or selectable right away, I can see that they have been created if I look at the OIP since I can see that they've been added to my selection, but I have to update my view or projection for them to start behaving as regular objects on my design-layer. This does not happen if I run the script unwrapped/wrapped. I've tried creating custom nodes (to try to get around this temporarily) that redraw-objects, refreshes view or refreshes projection but with no luck. These nodes work as desired when unwrapped/wrapped but not when turned into a command. It seems like these problems happen after the whole script is run, so even if I refresh my view at the end of the Marionette script, it doesn't help. I'm pretty sure the same applies to the first issue regarding the grouping.
I have attached my latest version of the tool in this post, where you can see the network wrapped in two variations and some lights for testing.
One that is meant to be run straight from the wrapper (this will generate focus points for all lights that have the lighting device record attached on the drawing). This one has the desired behavior, but cannot work with selections, since I can't select a bunch of lights and then run the script from the wrapper.
The second one is meant to be converted into a Marionette Command, so that it can be run from the Tools -> Marionette Commands menu - after making a selection. This is the one that has the aforementioned issues.
I appreciate any help or insights I can get regarding these issues or any other thoughts or ideas for the tool. Hopefully this can become something that makes life a little bit easier for people that work with lighting devices and focus points.
Best regards,
Timothy
FP_Generator_V1.vwx