GetUserPropBool - string - float etc

GetUserPropBool - string - float etc

stigatle
Enthusiast Enthusiast
419 Views
2 Replies
Message 1 of 3

GetUserPropBool - string - float etc

stigatle
Enthusiast
Enthusiast
I've made a custom helper object.
the object name is : "LRSettings001"

I'm able to check if a userprop exists by using this:

INode* node;
if (ip->GetINodeByName("LRSettings001"))
node = ip->GetINodeByName("LRSettings001")

if (node->UserPropExists("ExportEXR"))
{
node->GetUserPropBool("ExportEXR",*What GOES HERE?*))


}


I want to get the bool property from my object, but I do not understand how the command is used properly..

I've tried with:

 if (node->GetUserPropBool("ExportEXR"))
{
//my code goes here if property is true
}


but this returns:

Error 1 error C2660: 'INode::GetUserPropBool' : function does not take 1 arguments


same with float\string etc.

Please note that I've been coding for some years, it's just that I'm new to c++ (I'm a c# coder).
But I'm spending my free time learning c++ and help out with coding the exporter for Luxrender.

any help is greatly appreciated.
thanks in advance.
0 Likes
420 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
virtual BOOL INode::GetUserPropBool (const MSTR &key, BOOL &b)

Always consult the prototype. It takes a BOOL &.

So

BOOL fMyProp;
node->GetUserPropBool("foo", fMyProp)

// fMyProp contains the property value of foo.
0 Likes
Message 3 of 3

stigatle
Enthusiast
Enthusiast
thank you, this is what I needed.
0 Likes