Question How to access Gen3b autocollider position?

RunRudolf

Well-known member
Messages
109
Reactions
360
Points
63
Hi community
does anyone know how I can access VAM autocollider coordinates (such as those of "Gen3b")? I need them for coordinate transformations (distances).
I am looking for a method similar to how it can be done with controls:
Code:
freecontroller1 = containingAtom.freeControllers.First(fc => fc.name == "xyControl");
or for rigidbodies:
Code:
rigidbody = containingAtom.GetStorableByID("xy") as DAZBone;
Are these autocolliders available for such calculations at all?
Thanks for any hints!!
 
Solution
If anyone else searches for this, the following code does it. Not the most elegant way, but working.


C#:
protected Collider _penisTip;

var penisColliderName = "AutoColliderGen3bHard";
var collider = containingAtom.GetComponentsInChildren<Collider>()
    .Where(c => penisColliderName.Contains(c.name))
    .ToList();
_penisTip = collider[0];
C#:
containingAtom.rigidbodies.First(curRb => curRb.name == colliderName);

But, the autocolliders have extremely weird names and are "cleaned up" inside Collider Editor :p
For a plugin I made, I had to simply output everything and check what were the exact names... but it's something amongst the lines of:

AutoColliderFemaleAutoColliderschest0dJoint
AutoColliderFemaleAutoCollidersLGlute1Joint
AutoColliderFemaleAutoColliderslThigh9Joint
AutoColliderFemaleAutoCollidersabdomen16Joint
 
Upvote 0
Thanks @hazmhox for the input!

I disabled the Gen3b AutoCollider in Collider Editor and looked up the full name in the .json, which is:
"AutoCollider:hip.pelvis.Gen1.Gen2.Gen3.AutoColliderGen3b.AutoColliderGen3b"

However, including this full name in my code leads to an error (while it works perfectly with "lHand" instead):
Code:
protected Rigidbody _penisTip;
_penisTip = containingAtom.rigidbodies.First(rb => rb.name == "AutoCollider:hip.pelvis.Gen1.Gen2.Gen3.AutoColliderGen3b.AutoColliderGen3b");

Any idea what's wrong with the name? Or is it because it's an AutoCollider, not a RigidBody?
 
Last edited:
Upvote 0
"AutoCollider:hip.pelvis.Gen1.Gen2.Gen3.AutoColliderGen3b.AutoColliderGen3b"

You should have understood what that meant by just seeing "hip / pelvis" in that.
That's a path to the collider.

Your collider name should be AutoColliderGen3b if I'm not mistaken.
 
Upvote 0
If anyone else searches for this, the following code does it. Not the most elegant way, but working.


C#:
protected Collider _penisTip;

var penisColliderName = "AutoColliderGen3bHard";
var collider = containingAtom.GetComponentsInChildren<Collider>()
    .Where(c => penisColliderName.Contains(c.name))
    .ToList();
_penisTip = collider[0];
 
Upvote 0
Solution
Back
Top Bottom