willofmaine Posted August 22, 2017 Share Posted August 22, 2017 How do I use Marionette to re-scale 3D symbols? Attached is a simple network that I expected would do the trick, but when I run it it just places an un-scaled version of the symbol. Thanks! 06-Rescale 3D Symbol.vwx Quote Link to comment
Pat Stanford Posted August 22, 2017 Share Posted August 22, 2017 You are not doing anything wrong. Scale just does not work on Symbols. It does not work because the Symbols don't respond to the HScale3d Vectorscript command in the Scale node. They have to be scaled using a different method. OH @Marissa FarrellWe need a node to take a tuple of real values as input and SetObjectVariableReal for the three scaling factors. The object selectors are 102, 103, 104 for X, Y, and Z scaling. SetObjectVariableReal(MyObject, 102, XScaleFactor) SetObjectVariableReal(MyObject, 103, YScaleFactor) SetObjectVariableReal(MyObject, 104, ZScaleFactor) If it does not show up by Monday night I might take a crack at it myself, but I won't have time before then. Quote Link to comment
willofmaine Posted August 22, 2017 Author Share Posted August 22, 2017 Okay, thanks for the response & explanation. I'll stop trying to get it to work!... Quote Link to comment
Marionette Maven Marissa Farrell Posted August 22, 2017 Marionette Maven Share Posted August 22, 2017 1 hour ago, Pat Stanford said: OH @Marissa FarrellWe need a node to take a tuple of real values as input and SetObjectVariableReal for the three scaling factors. The object selectors are 102, 103, 104 for X, Y, and Z scaling. What would you suggest I name this node? Quote Link to comment
Pat Stanford Posted August 22, 2017 Share Posted August 22, 2017 How about ScaleSymbol3D? Quote Link to comment
the frog Posted August 23, 2017 Share Posted August 23, 2017 here is the way I scale symbols in marionette Take a look at the script "frame3" once the popup is changed to a group you can scale in x or y even z if you change for a 3D point. What is nice is the fact that using the same symbol you can have objects with different sizes frame 3.vwx Quote Link to comment
Marionette Maven Marissa Farrell Posted August 23, 2017 Marionette Maven Share Posted August 23, 2017 Here's the ScaleSymbol3D node. Right now you just have to make sure that you have your symbol set to Scaling: Asymmetric in the Object Info Palette, but I'll see if I can find something that will automatically set that for you. EDIT: Got it. File updated. ScaleSymbol3D_v2017.vwx 1 Quote Link to comment
willofmaine Posted August 24, 2017 Author Share Posted August 24, 2017 Excellent! I got it to work. Thank you for this! Quote Link to comment
Marionette Maven Marissa Farrell Posted August 24, 2017 Marionette Maven Share Posted August 24, 2017 11 minutes ago, willofmaine said: Excellent! I got it to work. Thank you for this! Anytime Quote Link to comment
willofmaine Posted August 25, 2017 Author Share Posted August 25, 2017 Help! Now I'm having trouble with this node. When I copy and paste it, or import it, into a brand new blank file, I can't get it to run. Files 02, 04, and 06 include detailed explanations of what's happening. (Files 01 and 05 are just for reference). Maybe I'm missing something simple... Thanks! Will 01-ScaleSymbol3D_v2017-Marissa-MLF 06-09.vwx 02-Copy and Paste.vwx 04-Name and H-02.vwx 05-Operations-WJT-Application Support.vwx 06-Import Node.vwx Quote Link to comment
Marionette Maven Marissa Farrell Posted August 25, 2017 Marionette Maven Share Posted August 25, 2017 The problem you're encountering is that you're trying to match the string in the Name node to the name of your symbol in the Resource Manager. Name has to match the name of your symbol on the document in the Object Info Palette. So in my original file, I named the symbol instance "s" in the OIP and the Name node references "s" in the OIP. Let me know if you still need help! (Also, obj and h are irrelevant. We're internally changing the prefixes of ports on nodes to be more helpful for the user. This will make more sense later ) Quote Link to comment
willofmaine Posted August 26, 2017 Author Share Posted August 26, 2017 Ah! I see. That little "Name:" field at the bottom of the OIP. So that two or more instances of the same symbol can't have the same name (which I'm guessing would confuse Marionette?). I'd thought maybe your "s" was looking for symbols (the way "s" finds symbols when used in a worksheet) but, of course, that would have been really tricky, what with a script trying to process all of the symbols in a drawing... So, okay.... When I originally tried your ScaleSymbol3D node (and it worked without a problem), I'd plugged it into a similar network, but one that also had a Symbol node (see attached file). And in that case, a String node (not the Name node) seems to identify the source symbol (I guess from the Resource Manager?...). Ultimately, with different combinations of input nodes and with or without the Symbol node (see file), I get confusing results. Which leads me to: What's the difference between the "Name" and the "String" input nodes, and how does one choose which to use? And, more generally, is there a document, or some similar source, that lists all of the default nodes with more detailed explanations of their use (beyond the "Description" available for each node via the OIP)? Thanks! -Will VWIS105 Quote Link to comment
Marionette Maven Marissa Farrell Posted August 26, 2017 Marionette Maven Share Posted August 26, 2017 I'll try to answer these as clearly as I can, but if I fail to make sense, let me know and I will try to clarify further. In the network I shared, I already had a symbol on the drawing area, so I used the Name node to reference that specific instance. The Name node will search for an item in your document that matches that name (this can be an object, a layer, and some other types of objects in Vectorworks that have what is called a 'handle', which basically is a unique identifier) When you made your network using the Symbol node, the Symbol node actually returns the 'handle' to the newly placed Symbol instance in your document, and since the ScaleSymbol3D node wants a 'handle' as an input, the network ran correctly. The Symbol node takes a String input (the name of your Symbol in the RM) because it looks specifically at symbols and not all types of Vectorworks objects. As for the difference between the Name node and the String node, the Name node has a very specific use (returning the handle to an item, as stated above), whereas you can use a String for multiple uses (i.e. defining what a Text node will put on your drawing area, naming an object, or pretty much any other thing you would type a word into) There currently isn't an official (or even unofficial, to my knowledge) document/database that gives more specific uses for nodes, HOWEVER we are in the process of adding prefixes to all of the ports on nodes to help users easily identify what type of data is flowing out of a node's port, as well as what type of data a node's port is expecting. (Which is why you saw my new Name node has 'h' as the output port, which refers to a type of 'handle') There's a plan in the pipelines later to expand upon use cases for nodes on a more descriptive level, but that will likely take a lot longer than defining what type of data is flowing through wires, so we tackled that goal first. I hope this helps clear some things up, but if you need a little more description on anything, let me know and I'll happily keep going Quote Link to comment
willofmaine Posted August 26, 2017 Author Share Posted August 26, 2017 Excellent, thank you for this! Though I'm gonna need to read it again. Or maybe even a couple of more times... I'm sure questions will be generated... In the meantime, thanks! Quote Link to comment
Pat Stanford Posted August 26, 2017 Share Posted August 26, 2017 Marissa, jump in if I am off on this. As of VW2017, for a Marionette network to operate on an object it needs a way to identify what object you want to operate on. The two primary ways to do that are to either put the objects into the Control Geometry (where the objects actually become part of the Marionette object) or to use Criteria to specify which objects to operate on. Name is really a specific type of Criteria that uses the name of the object as shown at the bottom of the OIP. If you wanted a way to modify more than one object at a time you could use different criteria. Layer and Class are always good options, but Color, Line eight, Object Type, Record or Field data, or something else might be better for a specific case. The challenge is to identify a set of criteria that will identify ALL of the objects you want to modify while NOT identifying ANY of the objects you don't want identified. Currently Marionette can not use Selection State as part of the criteria because when you run the network you have to select it (changing the selection state of the drawing to just that Marionette Node or Network). If you have multiple objects you want to ScaleSymbol3D, the easiest option is probably to create a new Layer (or Class) and temporarily (manual) move the objects there, run the Marionette, then move them back. I prefer Layer just because I am more likely to the the Layer Options set to Show/Snap Others and the Class Options set to Show/Snap/Modify Others. That means if I use Class, I will have to manually select the objects. If I use Layers, I can change the layer and Select All in a single step. HTH Quote Link to comment
Marionette Maven Marissa Farrell Posted August 26, 2017 Marionette Maven Share Posted August 26, 2017 Yep, @Pat Stanford is correct, though this was also true in 2016. Marionette can be adapted to most cases, so it's just a matter of figuring out exactly what you want to do before tackling the logic behind it. Quote Link to comment
Kevin McAllister Posted August 26, 2017 Share Posted August 26, 2017 18 hours ago, Marissa Farrell said: (Also, obj and h are irrelevant. We're internally changing the prefixes of ports on nodes to be more helpful for the user. This will make more sense later ) Yay labelling! KM Quote Link to comment
the frog Posted August 26, 2017 Share Posted August 26, 2017 Back in the discussion Another way to operate is to go back to vw use of symbols. I’ll try to make myself understandable. First I build my object from the symbols in 2 or 3D and the marionette script, including the scale part (see earlier in the post). Second I duplicate the object and create a symbol of the object. Then I have the choice, or I use the object (copy paste etc…) and it becomes easy to change its size as a unique object, or I decide I will need to change all the objects so I draw with my symbol and edit it if necessary using then the scale function of the script. In that case all the objects are changing. Again for me marionette is a tool like all the others, sometime it’s faster to draw a rectangle than to use marionette sometime not. At the end what count’s is the gain of productivity (and the pleasure of achieving scripts!). Quote Link to comment
Pat Stanford Posted August 26, 2017 Share Posted August 26, 2017 @the frog, you are completely correct. My understand of @willofmaine's problem was that he wanted to use Marionette to scale a single instance of an already existing symbol. As you say use the right tool and it makes it easy. If all the symbols should be scaled by the same amount, then just edit the symbol and be done without needing Marionette. To create scaled symbols, you need to process each individually. Your way works fine as long as you don't mind most of your objects being Marionette objects inside of symbols. It does make it harder to access the information in a worksheet. It all depends on what you are comfortable with and how your brain works. I used to do a presentation titled "Seven ways to shorten a line in VW". It just depends on the situation and the requirement. The flexibility is one of the great points of VW. And this forum is great in that you almost always end up with more than one way to accomplish any desired outcome. 1 Quote Link to comment
Jack_Moleta Posted February 13 Share Posted February 13 Hey @Marissa Farrell Thanks for making this node. It seems to work but outputs the wrong data. I don't know what I'm doing in terms of Python but I changed the "s" to an "i" in the code and it seems to work now 🙂 The node in the 2024 marionette library has the same issue. Thanks, Quote Link to comment
Marionette Maven Marissa Farrell Posted February 15 Marionette Maven Share Posted February 15 Thanks, @Jack_Moleta I'll put a ticket in for this 🙂 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.