Jump to content

Archived

This topic is now archived and is closed to further replies.

InkedInBlood

Access object from python node in xpresso

Recommended Posts

  • Topic Author
  • Is there a way to access the object the xpresso tag is on from the python node in its network?

    Share this post


    Link to post

    (Kinda late posting this, hopefully it's still helpful.)

     

    Just use the variable: op.  In a python tag, for example, op would return the tag, but I just tested it and for some reason in an xpresso python node, using op will return the object the xpresso tag is attached to.  :Shrug:

     

    HTH

    Share this post


    Link to post

    Scratch that.  I was using a result node set to Link to test it, aaand that's wrong.  Sorry xD

     

    op actually returns the node, like I originally thought it should (it generally returns whatever 'has' the code, in short).  So to return the object with the Xpresso tag go:

     

    op.GetNodeMaster().GetOwner().GetObject()

     

    op is the node.  op.GetNodeMaster() would return the GvNodeMaster object (not important now).  myNodeMaster.GetOwner() would return the Xpresso tag object, and, finally, running myXpressoTag.GetObject() would return the object the tag is attached to.

     

    Yay!

    Share this post


    Link to post
  • Topic Author
  • Author of the topic Posted

    Scratch that.  I was using a result node set to Link to test it, aaand that's wrong.  Sorry xD

     

    op actually returns the node, like I originally thought it should (it generally returns whatever 'has' the code, in short).  So to return the object with the Xpresso tag go:

     

    op.GetNodeMaster().GetOwner().GetObject()

     

    op is the node.  op.GetNodeMaster() would return the GvNodeMaster object (not important now).  myNodeMaster.GetOwner() would return the Xpresso tag object, and, finally, running myXpressoTag.GetObject() would return the object the tag is attached to.

     

    Yay!

    Thanks Whithers! I found a similar answer on the plugin forums. Definitely a bit trickier finding the object from a pynode!

    Share this post


    Link to post
    Guest
    This topic is now closed to further replies.

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×
    ×
    • Create New...

    FORUMS INFO:

    Dear members, we are aware of few more bugs that are still present withing the theme.We just wanted to let you know that we are working to fix them as soon as possible.
     

    NEW MEMBERS:

    Please be aware that we are manually approving all new registrations, due to spam prevention. Please be patient in case you cannot login right away, we will approve you within 12h or less if we decide you are not potential spammer. 

     

    Thanks for understanding! :cowboypistol: