RealFlow Vector type

Post Reply
jesse nicodemus
Posts: 23
Joined: Fri Oct 07, 2011 8:23 pm
Contact:

RealFlow Vector type

Post by jesse nicodemus » Fri Oct 11, 2013 11:42 pm

Hello,

I seem to be having trouble with the RealFlow Vector type. I am using a python function that gets all parameters then grabs all their values. Some of the values are pointers for RealFlow Vector. Type(foo) is successfully identifying the vectors but the if statement will not except RealFlow Vector as a type to check against.

# this works
rfKeys = node.getParameter('Scale')
if type(rfKeys) is float:
scene.message('is a float')
else:
scene.message('is not a float')


# this does not work
# it will also break if I replace the vector with a float or str.
rfKeys = node.getParameter('Scale')
if type(rfKeys) is RealFlow Vector:
scene.message('is a RealFlow Vector')
else:
scene.message('is not a RealFlow Vector')


type(rfKeys) returns <type,'RealFlow Vector'> but will not check for it.

I have also tried:
RealFlowVector
Vector


Is there another way to test for this? Any information would be great.

Thanks,

Jesse

User avatar
LuisMiguel
Posts: 528
Joined: Fri Jun 04, 2010 2:37 pm

Re: RealFlow Vector type

Post by LuisMiguel » Mon Oct 14, 2013 11:02 am

Hello jesse,

have you tried with PARAM_TYPE_VECTOR?.

luisM.

jesse nicodemus
Posts: 23
Joined: Fri Oct 07, 2011 8:23 pm
Contact:

Re: RealFlow Vector type

Post by jesse nicodemus » Mon Oct 14, 2013 9:21 pm

Hello Luis,

That did not seem to work. Rather than testing against the output of type(attr) I converted to a string and that is working.

attrTest = type(attr)
if str(attrTest) == "<type 'RealFlow Vector'>":
scene.message('success')

User avatar
Alex
Site Admin
Posts: 143
Joined: Mon Jun 14, 2010 9:35 am

Re: RealFlow Vector type

Post by Alex » Tue Oct 15, 2013 12:57 pm

Another way could be something like this:

Code: Select all

vectorType = type(Vector.new())
...
if type(attr) is vectorType:
  scene.message('success')
Alex Ribao
RealFlow Team
Next Limit Technologies

Post Reply