Jump to content
Developer Wiki and Function Reference Links ×

new Node "Get Symbol"


KingChaos

Recommended Posts

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

Link to comment

255201260_Bildschirmfoto2021-11-11um09_31_28.thumb.png.f98a272d5bc61ec5fc0a051defc9db10.pngOn 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

 

255201260_Bildschirmfoto2021-11-11um09_31_28.thumb.png.f98a272d5bc61ec5fc0a051defc9db10.png

  • Like 1
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...