san Posted May 12, 2009 Share Posted May 12, 2009 why this code doesnt work in python shell .. of houdini... here is what i get >>> g = hou.node("/obj/geo1") >>> g >>> g >>> g.path() Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'NoneType' object has no attribute 'path' >>> g = hou.node("/obj/geo1") >>> g >>> g.path() Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'NoneType' object has no attribute 'path' >>> Quote Link to comment Share on other sites More sharing options...
graham Posted May 13, 2009 Share Posted May 13, 2009 Do you have a node called "geo1" at the object level? Quote Link to comment Share on other sites More sharing options...
san Posted May 13, 2009 Author Share Posted May 13, 2009 yea Quote Link to comment Share on other sites More sharing options...
graham Posted May 13, 2009 Share Posted May 13, 2009 Well the code works fine for me. It is obviously not finding "/obj/geo1" in your scene which is why 'g' isn't getting assigned. If the node exists it will work, if not then I don't know what else to say. Quote Link to comment Share on other sites More sharing options...
san Posted May 13, 2009 Author Share Posted May 13, 2009 i got it when i create geometry the new default name is not geo1 dont know why.. Quote Link to comment Share on other sites More sharing options...
Symbolic Posted May 13, 2009 Share Posted May 13, 2009 i got it when i create geometry the new default name is not geo1 dont know why.. So? Do you have the node /obj/geo1 or not? The code works for me as well. try this: g = hou.node('/obj/geo1') sometimes "/obj/geo1" causes problems compared to '/obj/geo1' Quote Link to comment Share on other sites More sharing options...
static Posted May 14, 2009 Share Posted May 14, 2009 >>> g = hou.node("/obj/geo1") >>> g >>> g >>> g.path() Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'NoneType' object has no attribute 'path' >>> g = hou.node("/obj/geo1") >>> g >>> g.path() Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'NoneType' object has no attribute 'path' >>> According to this code it doesn't exist, simply because it printed None when you typed 'g' in the second line. Also, if it had been assigned correctly, you would have seen something along the lines of "Result: <obj geo1 blah blah blah>". If the node doesn't exist, do something like g = hou.node('/obj').createNode('geo','geo1'). 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.