willofmaine Posted September 2, 2017 Share Posted September 2, 2017 The "Get Texture" node creates a dropdown list in the OIP for selecting textures. Is there not a similar node to create a dropdown list in the OIP for selecting symbols?... If not, it sure would be very helpful!! Quote Link to comment
Patrick Winkler Posted September 4, 2017 Share Posted September 4, 2017 @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): def get_SymDefs_in_File (): ''' Returns all Symbol-Definitions as list found in the active Document. ''' syms = [] SYMBOL_DEFINI_TYPE = 16 CURRENT_DOC = 0 Res_List, NumItems = vs.BuildResourceList (SYMBOL_DEFINI_TYPE, CURRENT_DOC, '') for i in range (NumItems): # Die Resourcelist beginnt nicht wie üblich mit dem Index 0 sondern mit 1 i += 1 h = vs.GetResourceFromList (Res_List, i) syms.append ( vs.GetName(h)) return syms ### this = Marionette.Node( 'Get Sym' ) sym_list = get_SymDefs_in_File () sym_popUp = Marionette.OIPControl( 'Syms', Marionette.WidgetType.Popup, 0, sym_list) sym = Marionette.PortOut() def RunNode(self): sel_idx = self.Params.sym_popUp.value self.Params.sym.value = self.Params.sym_popUp.popupChoices[sel_idx] Unfortunately you have to run it to refresh the popup values. 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.