How does one get one matrix value of a node in Jscript to then drive another value in another node?
For example, I need the rotation of a joint to drive a morph, but I need to do this without exporting the joint matrix or exploding it. I still want to be able to move such object (as a control)?
Get one value from one node to drive another value - How?
- Draise
- Captain
- Posts: 3198
- Joined: 21 Sep 2009, 19:33
- Type the number ten into the box: 0
- Location: Bogota, Colombia
- Contact:
Re: Get one value from one node to drive another value - How?
Here are some hints to use any matrix value as a driver, but I'd need to learn how to use it properly I guess, with a watchdog?
Gets transform matrix element for given object. It works properly for objects with Transform subobject, Expanded Matrix or Euler Transform as well.
Parameters:
szNodeName – full name of object
szElemName – transform element name (e.g. 'sx', 'tx', 'roll')
pVal – returned value of given transform element
Sets transform matrix element for given object. It works properly for objects with Transform subobject, Expanded Matrix or Euler Transform as well.
Parameters:
szNodeName – full name of object
szElemName – transform element name (e.g. 'sx', 'tx', 'roll')
newVal – value of transform elem to be set
Example: use this command to set x position of object to 0, while keeping all others position/scale/rotation params untouched
Code: Select all
HRESULT IRiSpaceCommand::NodeMatrixElement (
[in] BSTR szNodeName,
[in] BSTR szElemName,
[out, retval] VARIANT * pVal
)
Parameters:
szNodeName – full name of object
szElemName – transform element name (e.g. 'sx', 'tx', 'roll')
pVal – returned value of given transform element
Code: Select all
HRESULT IRiSpaceCommand::NodeMatrixElement (
[in] BSTR szNodeName,
[in] BSTR szElemName,
[in] VARIANT newVal
)
Parameters:
szNodeName – full name of object
szElemName – transform element name (e.g. 'sx', 'tx', 'roll')
newVal – value of transform elem to be set
Example: use this command to set x position of object to 0, while keeping all others position/scale/rotation params untouched
Code: Select all
Space.NodeMatrixElement('/Project/Space 3D/Cube', 'tx') = 0.0