Thread: access node inside a group with python

Reply to Thread
Results 1 to 5 of 5
  1. #1 access node inside a group with python 
    Join Date
    Jan 2011
    Posts
    16
    This is probably a very noob question but I'm not really able to figure it out :S
    I did a simple gizmo trough python (the number of node inside is variable so I had to script it). I just built the comp for the gizmo, selected all the nodes and I used nuke.collapseToGroup().
    Now I have 3 fixed input from the gizmo and I would like to rename them to something.
    How can access them??

    Thanks
    Luca Fiorentini - 3D Lighting Artist

    My Showreel - http://www.vimeo.com/lucafiorentini/reel2010
    My Blog - http://lucafiorentini.wordpress.com
    My Flickr - http://www.flickr.com/photos/lucafiorentini
    Reply With Quote  

  2. #2  
    Join Date
    Jan 2011
    Posts
    16
    yeah, it was a quite noob question
    If someone is interested the begin() and end() functions let you begin and end the editing inside a group.

    Code:
    myGroup = nuke.nodes.Group()
    myGroup.begin()
    #do whatever
    myGroup.end()
    Luca Fiorentini - 3D Lighting Artist

    My Showreel - http://www.vimeo.com/lucafiorentini/reel2010
    My Blog - http://lucafiorentini.wordpress.com
    My Flickr - http://www.flickr.com/photos/lucafiorentini
    Reply With Quote  

  3. #3  
    Join Date
    Sep 2008
    Posts
    114
    like that or by using the with statement which gives you a better visual feedback over what you are doing
    Code:
    from __future__ import with_statement 
    import nuke
    
    grp = nuke.toNode("Group1")
    
    with grp:
        nodes = nuke.allNodes()
        print nodes
    Reply With Quote  

  4. #4  
    Join Date
    Jan 2011
    Posts
    16
    Thanks Alex, this is quite useful
    Luca Fiorentini - 3D Lighting Artist

    My Showreel - http://www.vimeo.com/lucafiorentini/reel2010
    My Blog - http://lucafiorentini.wordpress.com
    My Flickr - http://www.flickr.com/photos/lucafiorentini
    Reply With Quote  

  5. #5 Question how to access in case of Python 2.5 in nuke 6.1v3 
    Join Date
    Apr 2007
    Location
    India
    Posts
    185
    Blog Entries
    1
    Quote Originally Posted by alexB View Post
    like that or by using the with statement which gives you a better visual feedback over what you are doing
    Code:
    from __future__ import with_statement 
    import nuke
    
    grp = nuke.toNode("Group1")
    
    with grp:
        nodes = nuke.allNodes()
        print nodes
    How would you access nodes if its Python 2.5 in case of Nuke 6.1v3 since above logic fails to access nodes inside group.

    Reply With Quote  

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Python button inside DAG?
    By RumbleMonk in forum NUKE from The Foundry
    Replies: 3
    Last Post: May 19th, 2011, 11:00 AM
  2. getting the current node inside group nuke python
    By narasimhamk in forum NUKE from The Foundry
    Replies: 0
    Last Post: March 23rd, 2011, 04:23 AM
  3. Getting Access to ToolCenter Position via Python
    By furtive in forum Fusion Scripts & Plugins
    Replies: 4
    Last Post: February 14th, 2011, 07:28 AM
  4. Python access to multiple views
    By jordanw in forum NUKE from The Foundry
    Replies: 7
    Last Post: August 18th, 2010, 07:43 PM
  5. Replies: 10
    Last Post: April 13th, 2009, 08:06 AM
Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts