How to freeze position and rotation with one click

VRmatt

Active member
Joined
Jul 9, 2022
Messages
285
Solutions
1
Reactions
56
Does anyone know a plugin that would allow one-click to freeze all?
I'd add it to the floor / slate, and furniture nodes, etc (so I don't accidentally move it around during streaming scenes).
Thanks!!
 
One easy solution might be to do this through naming conventions.

Eg. A "-static" postfix in the universal id (uid).

Option A) - Throw all the assets you want to take on this behavior into a subscene with a "-static" postfix.

Option B) - Just add the postfix directly to the Atom names you want to take on the behavior.

It'd be pretty simple

C#:
// retrieve all Atoms with the "-static" postfix.
SuperController.singleton.GetAtomUIDs().Where(str => str.Contains(name + "-static"));

// (inside of a loop,) make each found Atom's controller static
atom.mainController.canGrabPosition = false;
atom.mainController.canGrabRotation = false;
atom.mainController.currentPositionState = FreeControllerV3.PositionState.Lock;
atom.mainController.currentRotationState = FreeControllerV3.RotationState.Lock;

one could check if the found Atom is a subscene, and if so, have another inner loop to apply the code to its child atoms...

I'm trying to wrap up 2 of my own much more complex scripts currently, but I feel a lot of script writers could pump this out within a day if not an hour...
 
Back
Top Bottom