PDA

View Full Version : Selection


Oodini
08-19-2009, 02:32 PM
Hello,

I created a shader node, and one attribute must refer to a camera in the Maya scene.

I'd like the user be able to select it from 3 ways :


by typing the camera name in a text field
by clicking on a button next the text field; then, the user can choose the camera from a window where are listed the cameras, or by clicking on the camera in the 3D viewports
The problem is the third way (the user select the object in the scene view). I think it is related to contexts, but I don't know anything to contexts, cand I can't find any doc except reference doc.

Thanks for help.

isoparmB
08-20-2009, 04:39 PM
string $panels[] = `getPanel -visiblePanels`;
string $item;

for($item in $panels)
{
if(`modelEditor -q -activeView $item`)
{
print `modelPanel -q -camera $item`;
break;
};
};

Oodini
08-21-2009, 08:34 AM
Well, thanks, but it seens I didn't succeed to make me clear.

I want to select a camera by selecting the camera object in the viewport, not the viewport associated to a camera.

cbamber85
08-21-2009, 08:15 PM
Can't you just do an 'ls -sl'? Then obviously throw in error checking, you could even grab the 'listRelatives -shape' and compare to 'ls -cameras' output to guarantee it's a camera.

CGTalk Moderation
08-21-2009, 08:15 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.