Get fields outside of node core

Get fields outside of node core

Anonymous
Not applicable
685 Views
6 Replies
Message 1 of 7

Get fields outside of node core

Anonymous
Not applicable

Hello!

 

You can access a string field called 'Foo' inside the 'core' container of a node by doing

node.fields().getString('Foo')

But what about the node's fields that are outside of the core? Some are exposed through the API (like how you can get the Parent field by doing getParent()) but not all are. Is there some trick to it?

 

Thanks!

0 Likes
686 Views
6 Replies
Replies (6)
Message 2 of 7

marcus_fritzen
Autodesk
Autodesk

Hi,

 

no, there is no trick. Most node fields which are important to the user are exposed via the API. You can get the parent, you can also add and remove children, set the active state and get attachments. That should be sufficient. The remaining node fields (flags, externalFlags and index) are internally used and shouldn't be changed.

 

Cheers,

Marcus



Marcus Fritzen
Principal Engineer
0 Likes
Message 3 of 7

Anonymous
Not applicable

Some of those nodes have very relevant information outside the core though, like the AnimNodes (with AnimBlock core and AnimCurve core, which hold the Flipped/Locked/MotionBlur flags, as well as which animation track they occupy)

0 Likes
Message 4 of 7

marcus_fritzen
Autodesk
Autodesk

That's right, but as I wrote, you can retrieve those information with the "getAttachment" function and further vrFieldAccess processing. All information which doesn't belong to the core can be found in attachments.

For the structure of a node (and its attachments), have a look at the "Node Editor".

 

Cheers,
Marcus

 

 



Marcus Fritzen
Principal Engineer
0 Likes
Message 5 of 7

Anonymous
Not applicable

That is incorrect, sadly. The information in blue, for example is inaccessible (I'm more familiar with the animation part, but there might be other examples out there) . Also note how the node has no attachments other than the Name attachment.

image.png

If it has a secret attachment that mirrors all that data, it doesn't seem to be documented anywhere. I get the following output:

# Get one of the animation clips in the scene
root: clip = getAnimClipNodes()[1]

# Dig down to the AnimBlock expanded in the image above
root: interpAnim = clip.getChild(0).getChild(1)

# Print name as sanity check
root: print interpAnim.getName()
InterpAnim

# Select it to view it on the Node Editor
root: selectNode(interpAnim)

# It doesn't show an attachment there. Let's just try our luck anyway
root: print interpAnim.hasAttachment('AnimNode')
False
root: print interpAnim.hasAttachment('AnimBlock')
False
root: print interpAnim.hasAttachment('AnimCurve')
False
root: print interpAnim.hasAttachment('AnimWizClip')
False

How should I proceed to obtain the data in blue?

0 Likes
Message 6 of 7

marcus_fritzen
Autodesk
Autodesk

Ok, now I got it. I missed that point that you want the fields of an AnimNode. Unfortunately, afaik this is currently not possible. I will create an Bugreport with an improvement request for it.

 

Cheers,

Marcus



Marcus Fritzen
Principal Engineer
0 Likes
Message 7 of 7

Anonymous
Not applicable

Ahh, I see.

Thanks!

0 Likes