MrGAG Posted September 13, 2010 Share Posted September 13, 2010 Hi everyone , I am trying to find an alternative to using sop solver in order to create points at impact location in rbd simulation. The only way I know to do that is to use a sop solver to merge a point at every impact position. the problem is that if found sopsolver terribly time consuming. sop solver is very handy when it comes to complicated stuff like dynamically deform some geometry, but all I want to do is use impact data stored in sim files and create points at this position( if there's a easiest way, I'd be glad to hear from that) So I tried to build some python code to achieve that. def printRecords(): obj = hou.node("/obj/AutoDopNetwork").simulation().objects() sphere = obj[1] for i in range(1,50) : myStr = hou.expandString("fcur "+str(i)) dopNode = hou.node("/obj/AutoDopNetwork/") hou.setFrame(i) print sphere.findAllSubData("Impacts") if(sphere.findSubData("Impacts")): print "data" nothing fancy ... I just move time slider from frame to frame, and try to print out some infos about impact data the problem is, even though time slider is going from frame to frame, print statement always give me thes same result for all the frames. ( actually it seems to only take into account the frame number whitch my time slider is on to when I execute the python function ) What am I missing here ? How do I make python aware of the time slider position to be able to retreive correct data ? Quote Link to comment Share on other sites More sharing options...
graham Posted September 13, 2010 Share Posted September 13, 2010 Here's an example of using a Python SOP to do it all. You can also do it in SOPs basically almost exactly the same as you would with a SOP solver. Are you attempting to do it with Python in a Python DOP? Those have issues caching their data and things don't work so well when scrubbing, but I'd say it is a better idea just doing it in SOPs either using Python or just SOP operators. sop_dopimpacts.otl Quote Link to comment Share on other sites More sharing options...
Ungoliant Posted September 13, 2010 Share Posted September 13, 2010 Here's an example of using a Python SOP to do it all. You can also do it in SOPs basically almost exactly the same as you would with a SOP solver. Are you attempting to do it with Python in a Python DOP? Those have issues caching their data and things don't work so well when scrubbing, but I'd say it is a better idea just doing it in SOPs either using Python or just SOP operators. Hello Man, thanks for sharing, very great tool Quote Link to comment Share on other sites More sharing options...
MrGAG Posted September 13, 2010 Author Share Posted September 13, 2010 that is exactly what I was trying to do !! you are the best, thanks for sharing Are you attempting to do it with Python in a Python DOP? Actually I was trying to do that in houdini session module. I should have thought of a python Sop thank you very much Quote Link to comment Share on other sites More sharing options...
graham Posted September 13, 2010 Share Posted September 13, 2010 Attached is a newer version of the asset. I accidentally uploaded the a version that was a bit older. In the newer I removed some options that were useless and made a couple minor changes changes. The help card also had a description that wasn't even for this operator. sop_dopimpacts.otl 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.