VRED, python API v2, vrdTransformNode issue

VRED, python API v2, vrdTransformNode issue

Anonymous
Not applicable
1,939 Views
8 Replies
Message 1 of 9

VRED, python API v2, vrdTransformNode issue

Anonymous
Not applicable

Hi,

 

Im trying to move objects in the scene by getting the vrdTransformNode.

 

My findings are:

- Creating a vrdTransformNode from a vrdNode or vrdReferenceNode does not work. It returns a vrdTransformNode, but the node is not valid.

 

transform = vrKernelServices.vrdTransformNode(vrdNode/vrdReferenceNode)

 

- When creating a new node of the type Transform3D and casting this to a vrdTransformNode works, but sadly this does not fix my issue, because I want to animate a skeleton.

 

node = vrNodeService.getNodeFromId(vrScenegraph.createNode("Transform3D", "Test").getID())
transform = vrKernelServices.vrdTransformNode(node)

 

 - When getting the vrdGeomertyNode from a mesh, it is possible to move it. (probably because the geometry node inherits the transform node) This does not fix my issue either, because not all objects have to be moved are meshes.

 

transform = vrKernelServices.vrdGeometryNode(node)

 

 

Thanks for your help in advance,

 

-Nevin

0 Likes
1,940 Views
8 Replies
Replies (8)
Message 2 of 9

chr33z
Advocate
Advocate

Hi,

 

what transformations do you want to perform on your nodes? The new vrdNodes should inherit their methods from vrdTransformNode. Consider this simple example that uses a QVector3D object to set its translation:

 

v1 = QVector3D(-500, 500, 1500)
p1 = vrNodeUtils.createSphere(1, 100, 1, 1, 1)
vrNodeService.getNodeFromId(p1.getID()).setTranslation(v1)
p1.setName("p1")

 

Cheers!

Message 3 of 9

Anonymous
Not applicable

This is exactly what I need, but the reason  this works is because the sphere is of the type vrdGeometryNode, which derived from the vrdTransformNode.

print(vrNodeService.getNodeFromId(p1.getID()))
#prints <vrKernelServices.vrdGeometryNode object at 0x000001900450AC08>

 

I have to apply translations and quaternions to normal, non geometry, vrdNode objects

0 Likes
Message 4 of 9

chr33z
Advocate
Advocate

Ok, I see. Basically any "vrd...Node" somehow inherites from vrdTransformNode, but vrdNode itself...

0 Likes
Message 5 of 9

Anonymous
Not applicable

Do you think this is a bug?
Are there any workarounds?
I got the same issue with the vrdReferenceNode, which you can obtain from the vrNodeService

0 Likes
Message 6 of 9

chr33z
Advocate
Advocate

Hi,

 

this might be a bug. The API v2 is rather "new" and here and there is something missing or not yet implemented. But a definitive answer can only give Autodesk.

 

You could try to use the translation funtions from the old API.

oldNodePtr = toNode(newVRDObject.getObjectId())

 

Message 7 of 9

sinje_thiedemann
Autodesk
Autodesk

@Anonymous wrote:

 

- When creating a new node of the type Transform3D and casting this to a vrdTransformNode works, but sadly this does not fix my issue, because I want to animate a skeleton.

 


Animate a skeleton, i.e. change transformation of Joint nodes (joint node icon is 3 white dots connected by blue lines)? It is a current limitation of the v2 API, caused by the fact that the joint node type is not exposed yet. Same for all other node types that are transformable but not exposed as an explicit type to the API.

Thanks for making us aware, we will look into it.

Message 8 of 9

Anonymous
Not applicable

Yes, They are the nodes with the 3 white dots connected with blue lines.
Do  you have an ETA for when this will be implemented?

0 Likes
Message 9 of 9

sinje_thiedemann
Autodesk
Autodesk

Hi, sorry, I can give no estimate dates.

Regarding your two other questions:

I can confirm it is a bug that vrdReferenceNode does currently not derive from vrdTransformNode.

The workaround is to use API v1 functions (all the vrNodeUtils.setTransformNode... functions, or the vrNodePtr functions related to transformations).

0 Likes