OrrieL Posted May 4, 2019 Posted May 4, 2019 I am converting dint999s Ran outfits to SMP and I can not figure how to properly set constraints for chains. Spoiler The SMP engine stretches the constraints making the final object apear longer/stretched even though linear limits are set to 0. I have noticed it in the past but it did not bothered me as there were only a few bones in the shapes, but these chains got 19 bones. It is definately affected by weight/gravity because if i set gravity for the chain bones <1 then it suppresses the effect a bit. This is the part of the XML (I omitted the unimportant parts): chainsomitedt.xml I was searching a bit and there should be stiffspring-constraint implemented in SMP, but i was not able to figure out how to use it. This code is definately recognized by SMP engine, because it is not complaining in the log and when i mess up the parameters on purpose then there is a warning in the log about unrecognized parameter. Using stiffspring will probably solve my problem as setting max/min distance factor to 1.0 will basically make the hard distance link between the bones. Spoiler <stiffspring-constraint-default> <minDistanceFactor>1.0</minDistanceFactor> <maxDistanceFactor>1.0</maxDistanceFactor> <stiffness>100</stiffness> <damping>0</damping> <equilibrium>0.5</equilibrium> </stiffspring-constraint-default> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 2" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> Does anyone knows how to solve this? And anyone knows how to use stiffspring-constraint?
OrrieL Posted May 4, 2019 Author Posted May 4, 2019 OK so I made some progress and figured out how the stiffspring constraint works, but unfortunately that is not going to solve my problem. The initial idea to set both minDistanceFactor/maxDistanceFactor to 1.0 wont work, as setting both parameters to the same value breaks the physics and bones go haywire. In the following picture, The left chain is using stiffspring constraint where each chain bone is constrained to the kinematic bone. This is the desired state, but there is ofc issue when the chain is moving and movement of the bones is limited by circling around kinematic bone as pivot. The right chain is using stiffspring constraint between each chain bones, as you see it does not work and behaves like the stiffspring was not even specified. Might be because stiffspring constraint can only be made between kinematic and dynamic bone, not between two dynamic bones. Equilibrium was also an important part, 0 probably means the spring is fully pressed/expanded to min value (1.0) which guarantees no space between the chain links. Spoiler Here are the settings for the picture outcome, hope someone might find this useful in the future. Just a side note, you still need to define generic-constraint between the bones otherwise they float in the air like in the space. Spoiler <stiffspring-constraint-default> <minDistanceFactor>1.0</minDistanceFactor> <maxDistanceFactor>1.1</maxDistanceFactor> <stiffness>4000000</stiffness> <damping>0</damping> <equilibrium>0</equilibrium> </stiffspring-constraint-default> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 2" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 3" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 4" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 5" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 6" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 7" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 8" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 9" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 10" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 11" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 12" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 13" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 14" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 15" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 16" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 17" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 18" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongL 19" bodyB="D_BDO_Ran2_ChaElbLongL 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 2" bodyB="D_BDO_Ran2_ChaElbLongR 1" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 3" bodyB="D_BDO_Ran2_ChaElbLongR 2" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 4" bodyB="D_BDO_Ran2_ChaElbLongR 3" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 5" bodyB="D_BDO_Ran2_ChaElbLongR 4" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 6" bodyB="D_BDO_Ran2_ChaElbLongR 5" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 7" bodyB="D_BDO_Ran2_ChaElbLongR 6" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 8" bodyB="D_BDO_Ran2_ChaElbLongR 7" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 9" bodyB="D_BDO_Ran2_ChaElbLongR 8" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 10" bodyB="D_BDO_Ran2_ChaElbLongR 9" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 11" bodyB="D_BDO_Ran2_ChaElbLongR 10" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 12" bodyB="D_BDO_Ran2_ChaElbLongR 11" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 13" bodyB="D_BDO_Ran2_ChaElbLongR 12" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 14" bodyB="D_BDO_Ran2_ChaElbLongR 13" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 15" bodyB="D_BDO_Ran2_ChaElbLongR 14" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 16" bodyB="D_BDO_Ran2_ChaElbLongR 15" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 17" bodyB="D_BDO_Ran2_ChaElbLongR 16" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 18" bodyB="D_BDO_Ran2_ChaElbLongR 17" /> <stiffspring-constraint bodyA="D_BDO_Ran2_ChaElbLongR 19" bodyB="D_BDO_Ran2_ChaElbLongR 18" /> So i am still dead in the water, some ideas anyone?
Nevershouldhavecomehere Posted May 4, 2019 Posted May 4, 2019 Afraid I can't help you because I'm trying to figure out shit myself, but where did you get the stiffspring stuff from? Is there documentation I missed somewhere?
OrrieL Posted May 4, 2019 Author Posted May 4, 2019 36 minutes ago, Nevershouldhavecomehere said: Afraid I can't help you because I'm trying to figure out shit myself, but where did you get the stiffspring stuff from? Is there documentation I missed somewhere? No documentation, every post or mention about SMP parameters on various sites only describes generic-constraints. There are several constraint types used in the various physics systems and I was kinda hoping there should be some of them implemented in SMP. I dumped the strings from the SMP dll and found out about stiffspring-constraint, then it was not that hard to figure out which parameters it uses. There is also conetwist-constraint, which I am going to test. I have got the xml parameters for it, I managed to setup the defaults without the errors in the log, but as soon as i defined the constraint and equipped the item my game crashed. Unfortunately i do not know the correct syntaxes nor the defaults, that is something that would require disassembly and a lot of time to figure out. Please note those are my findings, nothing official. These might not be even properly implemented. Spoiler <conetwist-constraint-default> <limitX> <limitY> <limitZ> <twistLimit> <twistSpan> <planeLimit> <coneLimit> <swingSpan1> <swingSpan2> <biasFactor> <relaxationFactor> <limitSoftness> </conetwist-constraint-default>
27X Posted May 5, 2019 Posted May 5, 2019 16 hours ago, Nevershouldhavecomehere said: Afraid I can't help you because I'm trying to figure out shit myself, but where did you get the stiffspring stuff from? Is there documentation I missed somewhere? HDT posted a full variable range on QQ, p sure SassaAria also opened the dll itself and looked for operants, like prz and myself but unlike prz and myself she posted it up online, prolly in prz's thread.
OrrieL Posted May 5, 2019 Author Posted May 5, 2019 9 hours ago, 27X said: HDT posted a full variable range on QQ, p sure SassaAria also opened the dll itself and looked for operants, like prz and myself but unlike prz and myself she posted it up online, prolly in prz's thread. Do you have a link please? I can not find anything new that I already know. I am interested in conetwist constraint syntax as this one should not have any spring at all (also this is the preffered constraint type for ragdolls). I was looking at bullet physics sources especially at btGeneric6DofSpring2Constraint and what could solve my problem is "void enableSpring (int index, bool onOff)", but I am affraid enablespring function for generic constraint is not implemented in current itteration of SMP (at least I was not able to find a correct parameters to toggle it). This is bad for my case as I can not disable the generic constraint spring, stiffspring seems to not work between two dynamic bones and conetwist constraint syntax is unknown atm (...if it is even implemented). I have seen the same problem with realclones long hair wigs which were unrealistically stretching during high velocity movement events.
27X Posted May 5, 2019 Posted May 5, 2019 No, no i do not. You'll have to dredge through the SMP thread or Aria's posts.
Guest Posted May 8, 2019 Posted May 8, 2019 Stiffsprings are supported since 2018 in the le plugin, I have a list of all accepted parameters somewhere at my desktop, I will search that for you after work.
realclone Posted May 10, 2019 Posted May 10, 2019 add <constraint-group> </constraint-group> Limited elongation but This command will consume additional machine performance
OrrieL Posted May 11, 2019 Author Posted May 11, 2019 13 hours ago, realclone said: add <constraint-group> </constraint-group> Limited elongation but This command will consume additional machine performance That fixed my issue, you r da man! Thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.