Jump to content

isField()


photo

Recommended Posts

Posted

Hi chaps

 

I'm looking for a possibility to find out if a node is a field. In the API there are a lot of this calls but not for FieldAnimations. Do you expose this in a future release, or do you have a workaround for it. I'm thinking about checking to type against its name...

 

Kind regards,

Renato

Posted

Hi,

 

We'll add this, thanks for pointing us to a missing method!

 

In the meantime, you can either check Node::getTypeName() indeed, or you can check Node::getType() type index. This should work both in C++ and script APIs. (Except that I don't think we expose the type constants via C++ API, perhaps we should do that too. We do expose them as NODE_xxx constants via script, though.)

 

In the latter case, i.e. with getType(), beware that the specific values may change in the future versions. So don't hardcode checks like if (mynode->getType()==234), they will break eventually.

Posted

Hi Andrew

 

Thanks a lot for the input. We have currently a workaround with getTypeName().

 

It would be nice to get those methods and as well the type constants in the C++ API! =)

 

kind regards,

Renato

×
×
  • Create New...