MSceneRender components doesn't work

MSceneRender components doesn't work

onefabis
Participant Participant
1,024 Views
7 Replies
Message 1 of 8

MSceneRender components doesn't work

onefabis
Participant
Participant

Hello. I'm trying to achieve selective (components) Render Override with MRenderOverride and MSceneRender from official example https://help.autodesk.com/view/MAYAUL/2018/ENU/?guid=__py_ref_scripted_2py_view_render_override_8py_...

But unfortunately MSceneRender (def objectSetOverride) doesn't want to work with specified polygon components and Override works not on the part of the mesh but on entire mesh. Could you help me to solve this?

Thanks in advance.

 

0 Likes
1,025 Views
7 Replies
Replies (7)
Message 2 of 8

onefabis
Participant
Participant

There is an interesting part from 836 line of the code from the link - # Turn this on to query the active list and only use that for drawing:

if self.mFilterDrawSelected:
selList = om.MGlobal.getActiveSelectionList()
if selList.length() > 0:
	iter = om.MItSelectionList(selList)
	while not iter.isDone():
		comp = iter.getComponent()
		self.mSelectionList.add( comp[0], comp[1] )
		iter.next()
if self.mSelectionList.length() > 0:
	print "\t" + self.name() + " : Filtering render with active object list"
	return self.mSelectionList

 Even though I pass to the code polygons or sets it assign shader only to the whole mesh - https://c2n.me/3UwklPY - here is the example of selected components, that I want to draw override, but override with green color somehow assigned to the whole mesh

0 Likes
Message 3 of 8

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

It is a limitation of Maya API. I've talked with my colleague few days earlier. There is an improvement requirement in our system. Our enigneers will look at this in the future.

 

Yours,

Li

0 Likes
Message 4 of 8

onefabis
Participant
Participant

Thanks for the answer. Hm, very interesting, but how maya built-in feature Isolate select works? Maya creates new set and somehow works with it, apparently processing this set through some draw override. Maybe I'm wrong.

0 Likes
Message 5 of 8

cheng_xi_li
Autodesk Support
Autodesk Support

According to the code, IsolateSelect is a command for setting varies model editor's settings.

 

Let me debug it for you tomorrow. Maybe I have missed something. 

 

Yours,

Li

0 Likes
Message 6 of 8

cheng_xi_li
Autodesk Support
Autodesk Support

Sorry, I didn't find anything new yesterday. Since it is logged in our system, if there is any feedbacks from our engineers. I'll let you know.

 

Yours,

Li

0 Likes
Message 7 of 8

onefabis
Participant
Participant

Hmm, interesting. Thanks for the answer.

 

You've mentioned about IsolateSelect and that it works in model panel (editor).. Maybe you can give any advise how to achieve this in that direction? Or probably another approaches? All I need is to override some polygons in color display, preserving the actual textures and shaders. Just add some color twist in order to visualize some polygons that active now without actual selection. I already created approach where the mesh duplicated with active polys and then done render override. But this is expensive approach in cases of high res model and big amount of that poly-copy meshes. So I want any method that allow me to add some component draw override without dealing with the actual mesh, just draw

Thanks in advance. 

 

0 Likes
Message 8 of 8

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

It is for enabling isolateselect mode and it is an internal class. I am afraid it won't work in your case.

 

I had a discussion with our engineers to an hour ago and we think your current implement probably is the only way right now. He suggested that component level filtering is not supported by VP2 directly now. It is implemented similar in your way - generating a render item for isolate selection.

 

If you looked at apiMeshGeometryOverride(2018 Update 3), there is an update for creating isolate selection version renderItem to make it support isolate selection.

 

Yours,

Li

0 Likes