PDA

View Full Version : camera script problem


ajfavaron
11-22-2008, 08:01 PM
Hello everybody,

I'm working on a camera script and I ran into a big problem. So maybe you guys could give me a hand on it :)

I basically need to tumble the camera without overriding the current context (select, move, rotate, etc), just in the way that standard Alt + LMB does, plus adding an action on the moment that I drag. So far I tried the following:

if (`draggerContext -exists CamNavCtx`)
deleteUI CamNavCtx;

global proc CamNavCtx_PRESS()
{
print ("Pressing");
}

global proc CamNavCtx_DRAG()
{
print ("Dragging");
TumbleTool; // This calls the command setToolTo tumbleContext;
//do other stuff here…;
}

global proc CamNavCtx_RELEASE()
{
print ("Releasing");
}

draggerContext
-pressCommand "CamNavCtx_PRESS"
-dragCommand "CamNavCtx_DRAG"
-releaseCommand "CamNavCtx_RELEASE"
CamNavCtx;

setToolTo CamNavCtx;
I would assign this command to a hotkey, so every time I hold the key and drag with the LMB, a couple of commands would be done (including tumbling), plus not overriding the current tool (select, move, rotate, etc…)

Problems:
1. When I drag, “TumbleTool;” command overrides the CamNavCtx context and it’s gone.
2. The move tool, for example, that I had previously active, is gone (of course, I set the tool to CamNavCtx…)

So, I suppose I can’t use this context stuff, but I have no clue of a different way for doing it :(
I don’t mind if I need to lean Maya API for doing this as well. I just need to know whether it's possible to be done in Maya and what would be the path to follow.

Thanks in advance,

Alex

CGTalk Moderation
11-22-2008, 08:01 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.