Jump to content
Developer Wiki and Function Reference Links Read more... ×
Timothy Besada

Marionette Command Issues (Focus Point Generator)

Recommended Posts

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:

 

  1. 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.
  2. 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

Share this post


Link to post

I'm looking at this now and trying to diagnose some of your issues, but I wanted to make a quick note about when you're naming your Focus Points.

If you re-run this network without deleting the focus points created on the last run, the names of these objects may end up incorrect (they will be incremented by one)

I would suggest doing some handling for this because the lighting devices may end up pointing to the wrong FP after this happens (at least it did in my testing).

 

I'm not sure why these objects are being created in a group/unable to be selected immediately after this brief examination, but hopefully I can figure it out.

 

I've also begun adding filtering after your Objs by Criteria node to sort out objects that are actually lighting devices rather than allowing focus points to also be queried. I'll share my revisions once I make more sense of your other issues.

Share this post


Link to post

Here's my progress so far -

The Focus Points no longer end up in a nested group, though the LDs are still selected. I tried using the Set Selection node, but unfortunately that's not working for some reason (looking into it). This also fixes the issue where they are not immediately selectable.

I did filter at the beginning of your network so that only LDs are queried, you/we may need to adjust the criteria for filtering because I'm not positive that my criteria is always true (I don't often look at the records of LDs.)

I'm also going to look into some error handling for the naming, as I've mentioned above.

FP_Generator_V1_MFarrell.vwx

Share this post


Link to post

You're a true superstar @Marissa Farrell!

 

I'm aware about the issues regarding the naming of the Focus Points and the filtering of the Lighting Devices. I was going to resolve these things after the grouping/selection issues, but you beat me to it! I was thinking of creating a solution where if the tool is used with Lighting Devices that already have Focus Points attached, it would ask if you would like to overwrite these or not. What do you think would be the best solution?

 

I also tried the Set Selection node without any luck. Even tried de-selecting everything first and then passing on just the Focus Point objects to the Set Selection node, but that didn't work either.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×