zetavfx Posted April 20, 2020 Share Posted April 20, 2020 Hi, let me explain the best way I can. 1.- I have multiple objects in an alembic 2.- They have name attr 3.- I want to create a material (pxrmaterialbuilder) with that name attr and have it assigned to that object with a material node I am trying to do it with a python node written like this (not like this, this does´t work) node = hou.pwd() geo = node.geometry() # Add code to modify contents of geo. # Use drop down menu to select examples. import hou import itertools # Define geometry node name geometryName = 'name' # Get scene root node sceneRoot = hou.node('/obj/Ship/matnet1/') # Check if "MY_GEO" exists if hou.node('/obj/{}'.format(geometryName)) == None: # Create empty geometry node in scene root geometry = sceneRoot.createNode('pxrmaterialbuilder', run_init_scripts=False) # Set geometry node name geometry.setName(geometryName) # Display creation message hou.ui.displayMessage('{} node created!'.format(geometryName)) else: # Display fail message hou.ui.displayMessage('{} already exists in the scene'.format(geometryName)) Here are my questions: 1.- How do I pass the attr name to the pxr node? 2.- Is this the way to go? thanks. Z.- Quote Link to comment Share on other sites More sharing options...
davpe Posted April 21, 2020 Share Posted April 21, 2020 hi, check this article out: https://vfxbrain.wordpress.com/2016/03/15/python-in-houdini/ these are my notes I was taking when learning how to use Python. I guess it might help you. cheers, D. Quote Link to comment Share on other sites More sharing options...
zetavfx Posted April 21, 2020 Author Share Posted April 21, 2020 excelente, I will look into it! Quote Link to comment Share on other sites More sharing options...
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.