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
RealFlow Vector type
-
jesse nicodemus
- Posts: 23
- Joined: Fri Oct 07, 2011 8:23 pm
- Contact:
- LuisMiguel
- Posts: 528
- Joined: Fri Jun 04, 2010 2:37 pm
Re: RealFlow Vector type
Hello jesse,
have you tried with PARAM_TYPE_VECTOR?.
luisM.
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
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')
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')
Re: RealFlow Vector type
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
RealFlow Team
Next Limit Technologies