Dishav Vasudev Posted September 27, 2019 Share Posted September 27, 2019 Hello, I'm new to using Marionette Tool in Vectorworks and am finding it very useful for simple parametric object creation. I'd appreciate to know if there is a way to set the marionette-object with pre-defined values which can be selected in a drop-down selection in the object info palette? And, to take the above further, it is also possible to add a 'Custom' option where the user can add their own value and the marionette object will follow? To visualise this, imagine a rectangle with 'Width' and 'Height' defined and user can select it from the Object Info drop down but those 'standard' value may not be suitable (due to real-life use) and needs to change that rectangle to a project based value, therefore also a custom option in the drop-down where the user can specify 'Width' and 'Height'. I don't wish for someone to make the network for me, I'd like to learn and build it myself Thank you in advance. Quote Link to comment
MRoth Posted September 27, 2019 Share Posted September 27, 2019 A simple way to accept custom inputs in addition to the default values is to add a "Use custom value" entry to the dropdown. In addition, you need an input field in which you can do the custom input. Now you can choose with a simple "if" whether the value of the dropdown or the custom input should be used. I know you don't want to see a ready-made solution, but with a picture, it's easier to understand. 1 Quote Link to comment
Dishav Vasudev Posted September 27, 2019 Author Share Posted September 27, 2019 @MRoth I don't know much about the Data Flow & String Nodes and it seems that is what you have used so I will give this a go. Thank you for your explanation on this and looking at your network it makes sense. Hopefully it works the way I intend to use it! ....now only to make the drop down option with default values. Many Thanks! Quote Link to comment
MRoth Posted September 27, 2019 Share Posted September 27, 2019 To customize the default dropdown node "Popup", you have to remove the first line of code and then change the elements of the list in line 13. The example below shows a dropdown with the elements car, train and plane. @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'Popup' ) this.SetDescription('This node shows a dropdown with the elements car, train and plane. The values returned by this node will be integers based on your selection starting with 0 for the first option and increasing by 1 for consecutive options.') #Input Ports #OIP Controls input = Marionette.OIPControl( 'Popup', Marionette.WidgetType.Popup, 0, ['Car', 'Train', 'Plane']) #continue with the standard code Remember that this node outputs integer values. so in the example above I added an Any-node with the selection list and a GetItem-node. 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.