Follyx Posted January 21, 2016 Share Posted January 21, 2016 (edited) Hi, found an interesting file from JOHNNY FARMFIELD https://vimeo.com/farmfield with name "FlipFluid Bullet deformation" https://vimeo.com/123758824 (attached). In the dopnet the RBD_Bullet1 node, in the center of mass you will find the following code: obj = hou.node(hou.parm("soppath").eval()) dopnet = hou.pwd().creator() if dopnet and dopnet.type().category() != hou.objNodeTypeCategory(): dopnet = None if obj is None: return 0 if obj.type().category() != hou.objNodeTypeCategory(): obj = obj.creator() p = hou.Vector3(obj.parm("px").eval(), obj.parm("py").eval(), obj.parm("pz").eval()) tp = p * obj.worldTransform() if dopnet is not None: tp = tp * dopnet.worldTransform().inverted() return tp[0] As I'm relative new to it, please could someone explain it to me? Thanks in advance bullet.collide.v1.hiplc Edited January 21, 2016 by Follyx Quote Link to comment Share on other sites More sharing options...
Farmfield Posted January 21, 2016 Share Posted January 21, 2016 That isn't my expression, though, it's the expression the Houdini dev's created to get the per frame center of mass position for the object, so if you tick that box in any RBD object, that's the expression that will be activated. And you would usually not need to use this in simulations but in some situations, like here when the idea is to get the bullets rotating realistically, computing the center of mass just gives a better result. Quote Link to comment Share on other sites More sharing options...
DASD Posted January 21, 2016 Share Posted January 21, 2016 (edited) As far as I can tell from this code, it does not calculate anything. It rather extracts parameters that the dopnetwork already has. Edited January 21, 2016 by DASD Quote Link to comment Share on other sites More sharing options...
Farmfield Posted January 21, 2016 Share Posted January 21, 2016 It doesn't calculate, it evaluates and returns a value - it's a switch. Or I'm completely wrong, something to always take into account. Quote Link to comment Share on other sites More sharing options...
Follyx Posted January 21, 2016 Author Share Posted January 21, 2016 ok Sirs. Dont calcualte, evaluate. But can anyone explain it to me, please? Quote Link to comment Share on other sites More sharing options...
Farmfield Posted February 3, 2016 Share Posted February 3, 2016 Looking at the code it looks like it's a switch for evaluating the center of mass based on if it's in a DOP network or not, so if the object isn't in a DOP, it won't do anything, but if it's part of a DOP network, it'll set the center of mass as calculated by the current solver settings and evaluate any motion, shifting the center of mass in the direction of the velocity... Or I'm completely wrong. 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.