KingChaos Posted November 1, 2021 Share Posted November 1, 2021 Hi, i used this "Get Texture" Node and i wonder how it has to be modyfied to work with symbols, placed in a specific folder in the ressource manager. I made a few marionettes, but scripting a complete new node i cant do. #COMMAND;READONLYREFFILE;[VWLibDef]/Textures\01. Common\Get Texture.py; #Modified by MF May 2017 #Modified by MF Feb 2019 - provided index for texture @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( "Get Texture" ) this.SetDescription( 'Returns the selected texture from the dropdown list' ) #Input Ports #OIP Controls selectedTexture = Marionette.OIPControl('Texture', Marionette.WidgetType.PopupTextures, 0) selectedTexture.SetDescription( "A list of the available textures on the document" ) #Output Ports texName = Marionette.PortOut('sTexName') texName.SetDescription( "The selected texture's name" ) texIndex = Marionette.PortOut('iTexRef') texIndex.SetDescription( "The selected texture's index" ) #BEHAVIOR def RunNode(self): #functions def callback(): return 0 #inputs index = self.Params.selectedTexture.value #script # Populate the texture list texNameList = [] texListID, numItems = vs.BuildResourceList(97, 100, '', True) for i in range(1, numItems + 1): texNameList.append(vs.GetNameFromResourceList(texListID, i)) vs.ImportResToCurFileN(texListID, index+1, callback) #outputs self.Params.texName.value = texNameList[index] self.Params.texIndex.value = vs.Name2Index(texNameList[index]) is is possible, to modify this node and get a "Get Symbol" node somehow? Is someone capable to help me with that? I need it for changing symbols in a marionette network which is placing symbols along a polyline. For sure it wont work if i replace all the bold strings into symbol but it is not so far away from this, right? KC Quote Link to comment
KingChaos Posted November 5, 2021 Author Share Posted November 5, 2021 I found some node "get symbols from folder" but it opens a graphic selection for the symbols in a specific folder right as i run the script. for my "project" i need a node which works in the same way as the "get texture" node with a popup/pulldown menu. Quote Link to comment
KingChaos Posted November 8, 2021 Author Share Posted November 8, 2021 thx i will try Quote Link to comment
KingChaos Posted November 11, 2021 Author Share Posted November 11, 2021 and how to fill the nodes choices with thy symbol list of my folder? °^:) Quote Link to comment
SimA Posted November 11, 2021 Share Posted November 11, 2021 On the picture you can find the code in which I write my few symbols. If you have a lot of symbols, you'll need to make changes to the script at this point. However, I can't help you with the script. Auf dem Bild findest du den Code in dem ich meine wenigen Symbole hineinschreibe. Wenn du viele Symbole hast, musst du an dieser Stelle änderungen am Skript vornehmen. Beim Skript kann ich dir jedoch nicht helfen. @MRoth 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.