asnowcappedromance Posted October 17, 2011 Share Posted October 17, 2011 If I create a Python DOP node and try to access subData, for example "Impacts"'s "Impacts" I always get an error message like "Attribute Error: 'NoneType' object has no attribute 'record'. That is obviously due to the fact that on frame 1 of the simulation there is no Impact data yet. How can I make Python understand that it should only start creating subdata variables if a collision has already happened ? I'm basically iterating through dop objects in my scene doing something like this: objects = hou.pwd().objectsToProcess() for i in objects: impacts = i.findSubData("Impacts") subdata = impacts.record("Impacts") thanks, Manuel Quote Link to comment Share on other sites More sharing options...
sam.h Posted October 17, 2011 Share Posted October 17, 2011 imapacts should be None, so you can test it: for i in objects: impacts = i.findSubData("Impacts") if impacts != None: subdata = impacts.record("Impacts") else: whatever Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted October 17, 2011 Author Share Posted October 17, 2011 imapacts should be None, so you can test it: for i in objects: impacts = i.findSubData("Impacts") if impacts != None: subdata = impacts.record("Impacts") else: whatever That's it ! Thanks Sam ! 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.