I think that's because you are giving the MPoint position outside the nurbs
surface range. Try pick a point on the surface and run it again. I've
quickly tested it and that seems to be the reason of # RuntimeError
(kInvalidParameter): value not in valid range #  error.

On Wed, Sep 9, 2015 at 9:13 PM, Rémi Deletrain <[email protected]>
wrote:

> Actually I do not have the crash problem. Many thank you r4inm4ker!
>
> But now I have an error :
> # RuntimeError (kInvalidParameter): value not valid in ranks #
>
> while I give (MPoint, double, double, bool).
>
> Well I guess the problem is MPoint, but I do not understand why.
> He requested a position and I give him a Vector3 or Vector4 it's the same
> ...
>
> Le mercredi 9 septembre 2015 10:24:37 UTC+2, Rémi Deletrain a écrit :
>>
>> Hello everyone,
>>
>> I am trying to retrieve a position of a uv nurbssurface from a point in
>> space.
>> For this I use the Maya API.
>>
>> I tried with a mesh and it works very well. The problem I have with the
>> nurbssurface is that when I run my script Maya plant ...
>> Is someone already had this problem?
>>
>> That's the code:
>>
>>
>> ------------------------------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------------------------------
>>
>> shape = 'nurbsSphereShape1'
>>
>> dag_path = maya_api_utils.get_dag_path(shape)
>> mfn_nurbs = OpenMaya.MFnNurbsSurface(dag_path )
>>
>> point = OpenMaya.MPoint(0.0, 3.116, 4.508)
>> u = MScriptUtil().asDoublePtr()
>> v = MScriptUtil().asDoublePtr()
>>
>> toto = mfn_nurbs.getParamAtPoint(point, u, v, False)
>>
>>
>> ------------------------------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------------------------------
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/5aeccf02-b45c-46f8-bcdb-11ce0ab936c2%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/5aeccf02-b45c-46f8-bcdb-11ce0ab936c2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CACdyi7pWfCc25jjnZ_sTZTRM77W-NudALZRPxw7S_PHE5E9cJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to