Maya api custom move tool

Hello People,

I am new to Maya Api and was checking out the custom moveTool example provided in the devkit. The part that am not getting is why the tool does not work in the perspective viewPort? Yep its not written to, but when I do the following

cmd->setVector(endW.x - startW.x,endW.y - startW.y,endW.z - startW.z);

it still does not work effectively(there seems to be a super lag).

The delta is calculated by the difference in the start and end worldPoint coordinates provided by the viewToWorld function of m3dview. So why does the same logic not work for perspective view??

Will be grateful for your help and suggestions. I searched the forum for an answer and could not find one, and hence the question. Sorry if am repeating it.

thanks.

[QUOTE=mrudul sarang;27036]Hello People,

I am new to Maya Api and was checking out the custom moveTool example provided in the devkit. The part that am not getting is why the tool does not work in the perspective viewPort? Yep its not written to, but when I do the following

cmd->setVector(endW.x - startW.x,endW.y - startW.y,endW.z - startW.z);

it still does not work effectively(there seems to be a super lag).

The delta is calculated by the difference in the start and end worldPoint coordinates provided by the viewToWorld function of m3dview. So why does the same logic not work for perspective view??

Will be grateful for your help and suggestions. I searched the forum for an answer and could not find one, and hence the question. Sorry if am repeating it.

thanks.[/QUOTE]

I think I have got an answer . Maya SDK help does hint how to resolve it

If i get that working will post it here.

thanks.

[QUOTE=mrudul sarang;27037]I think I have got an answer . Maya SDK help does hint how to resolve it

If i get that working will post it here.

thanks.[/QUOTE]

Its going to take me some time doing this, but for those who would like to understand the steps am taking to make this work, please follow this link

Nicely explained step by step.

My logic is to get the closest intersectionPoint using MFnMesh and then construct a plane equation to move the object in the plane based of the closest point. Once I do that, I will post the code here.

thank you.

Hi mrudul

Thanks for the links this might be helpful coz am working on a custom move context in maya that draws a Bounding Box Manipulator on the selected object and also does a cheap interactive collision detection with existing object.
Will keep a check :lookdown: on this thread

Regards
Mayur

Hi Mayur,

Sure. Cool.