Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Get dormant colors in Viewport 2.0?

Get dormant colors in Viewport 2.0?

Anonymous
Not applicable
814 Views
5 Replies
Message 1 of 6

Get dormant colors in Viewport 2.0?

Anonymous
Not applicable

Hi,

I am porting one of our old locator nodes to Viewport 2.0.

We use some of the locator's functions: colorRGB() and the M3dView's colorAtIndex() (to get the dormant colors).

My question is if there is any ways to use these functions in VP2.0 or is there any alternative to get the dormant colors? I searched the API documentation but didn't find anything.

 

Thanks,

Ferenc

0 Likes
Accepted solutions (1)
815 Views
5 Replies
Replies (5)
Message 2 of 6

cheng_xi_li
Autodesk Support
Autodesk Support

Hi ferenc,

 

I am not sure about your requirement. But if you want to make your node using default Maya color, you can use MGeometryUtilities::wireframeColor to get current Maya default color for your node. If you want to specify a different color for dormant, you can use MGeometryUtilities::displayStatus to get current display status and set a color for your drawing.

 

Yours,

Li

0 Likes
Message 3 of 6

Anonymous
Not applicable

Hi Li,

In our node (which draws handles to some geometry) the user can choose what kind of color drawing method he wants.

The first option is default color, where the plugin sets a status based color with the MPxLocatorNode::colorRGB function.

The second is the color index mode, where the plugin sets the drawing color with M3dView::colorAtIndex(index, M3dView::kDormantColors) function, where the user sets the index of the color to get from the dormant colors.

(The third option is custom color, set by the user.)

 

I guess the MGeometryUtilities::wireframeColor is similar to the first option. Is there any method for VP2.0 which is similar to the second option, to get one of the dormant colors?

 

Thanks,

Ferenc

0 Likes
Message 4 of 6

cheng_xi_li
Autodesk Support
Autodesk Support

Hi ferenc,

 

I've just had a short chat with or engineers, M3dView::colorAtIndex should be working with VP2. Isn't working on your side now?

 

Yours,

Li

0 Likes
Message 5 of 6

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi ferenc,

 

I've just had a short chat with or engineers, M3dView::colorAtIndex should be working with VP2. Isn't it working on your side now?

 

Yours,

Li

0 Likes
Message 6 of 6

Anonymous
Not applicable

Hi,

Thanks for the help, it worked!

It didn't know it is allowed to use M3dView in VP2.0.

 

Thanks again!

 

Cheers,

Ferenc

0 Likes