Setting Display Type

114 views
Skip to first unread message

likage

unread,
Jan 21, 2015, 5:06:12 AM1/21/15
to python_in...@googlegroups.com
Hi all,

I am doing a bit of rigging stuff and thought of adding in a few attributes that will toggle the visibility of the controllers/mesh etc as well as the ability to set the Display Type of the Mesh - Normal/Template/Reference and I am doing this in the very pythonic way...

I am having troubles with the latter part of the Display Type where it changes the mesh Display Type in either of the 3 options but how do I go doing that without using any display layers/ enabling the Drawing Overrides?
Have tried looking through the documentation but I am unable to find much information about it.


Marcus Ottosson

unread,
Jan 21, 2015, 5:09:45 AM1/21/15
to python_in...@googlegroups.com
Have a look under Drawing Overrides in the Attribute Editor. Both transforms and shapes have these, and they act similar to Display Layers, and they can be scripted like any other attribute.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ba615d3e-493f-45d5-ada7-76fe66454c55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Andres Weber

unread,
Jan 21, 2015, 2:27:49 PM1/21/15
to python_in...@googlegroups.com
From my understanding you HAVE to have overrideEnabled set on in order for it to pay attention to those settings.  You can control that attribute just like any other by connecting your display override attribute to it with an SDK (or some node combination of your own) to control it however you want to.


On Wednesday, January 21, 2015 at 5:09:45 AM UTC-5, Marcus Ottosson wrote:
Have a look under Drawing Overrides in the Attribute Editor. Both transforms and shapes have these, and they act similar to Display Layers, and they can be scripted like any other attribute.
On 21 January 2015 at 10:06, likage <dissid...@gmail.com> wrote:
Hi all,

I am doing a bit of rigging stuff and thought of adding in a few attributes that will toggle the visibility of the controllers/mesh etc as well as the ability to set the Display Type of the Mesh - Normal/Template/Reference and I am doing this in the very pythonic way...

I am having troubles with the latter part of the Display Type where it changes the mesh Display Type in either of the 3 options but how do I go doing that without using any display layers/ enabling the Drawing Overrides?
Have tried looking through the documentation but I am unable to find much information about it.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.



--
Marcus Ottosson
konstr...@gmail.com

likage

unread,
Jan 22, 2015, 1:59:39 AM1/22/15
to python_in...@googlegroups.com
I know that using SDK and the Drawing Overrides is one of the solution to go.
Just wondering if there are any other alternate ways to do so, other than the mentioned ones?

Marcus Ottosson

unread,
Jan 22, 2015, 3:10:35 AM1/22/15
to python_in...@googlegroups.com
You could write an OpenGL or DirectX shader and expose toggles on it to make meshes show their wireframe, or write an alternate viewport renderer and have it expose those toggles, but other than that I don't know.

Perhaps you could elaborate on why layers or drawing overrides isn't sufficient for you? I've used them in rigs before with much success.

On 22 January 2015 at 06:59, likage <dissid...@gmail.com> wrote:
I know that using SDK and the Drawing Overrides is one of the solution to go.
Just wondering if there are any other alternate ways to do so, other than the mentioned ones?

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/25e915ff-40c9-4ada-b081-539b44996ebc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

likage

unread,
Jan 22, 2015, 3:54:05 AM1/22/15
to python_in...@googlegroups.com
Hey Marcus,

Thanks for getting back to me. The reason I asked is because I have downloaded this rig from somewhere where within one of its controllers called Preference.

And within it, I saw it has an attribute that toggles the display type of the mesh. Initially I had thought it maybe driven by SDK, but while I toggle between the attributes, I am not seeing anything being changed in the Drawing Overrides which sort of leads me to think whether the rigger did uses some sort of special "mechanism" or method.

Seeing that my knowledge is pretty much limited to SDK...

Marcus Ottosson

unread,
Jan 22, 2015, 4:01:01 AM1/22/15
to python_in...@googlegroups.com
If you click on the controller with the attribute that toggles the display type, and graph it in the Node Editor, or Hypergraph, you should be able to see where the connection goes. It's possible that it goes to the shape of the mesh, as opposed to the transform, which may make it look like it isn't connected when looking in the Attribute Editor.

Andres Weber

unread,
Jan 22, 2015, 2:15:18 PM1/22/15
to python_in...@googlegroups.com
You've piqued my interest now if there's another (seemingly simple) way of doing it without doing some API sort of stuff for draw calls/shaders etc.  Do you have a link to the rig?

damon shelton

unread,
Jan 22, 2015, 2:20:01 PM1/22/15
to python_in...@googlegroups.com
You might also want to check for an expression, it may use setAttr instead of a direct attribute connection. this won't show as a connection if you graph the node that has the setAttr called on it.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

likage

unread,
Jan 22, 2015, 9:26:59 PM1/22/15
to python_in...@googlegroups.com
Hi all,

> Marcus: Upon checking from the Node Editor, you are right. There is indeed a connection between the Display Type and Visibility. It didn't occurs to me to check it via Node Editor, as I have used it very rarely, probably less than 5 times ever since I started using Maya :x

> Damon: There are no expressions, nothing was listed in the Expression Editor

> Andres: I will try and see if I can find the rig. No guarantees as this rig that I am using, I seem to either have download it long ago or one of my friend whom have passed it to me. I have to check :(


This question may be slightly off topic but any advice would be appreciated. Is Node Editor a handy tool for rigging, just like how Animators uses Graph Editor for their anim. stuff?

Marcus Ottosson

unread,
Jan 25, 2015, 2:22:44 PM1/25/15
to python_in...@googlegroups.com
​> Is Node Editor a handy tool for rigging, just like how Animators uses Graph Editor for their anim. stuff?

I think you hit the nail on the head with that analogy. I personally always keep an eye on the nodes as I rig. Nowadays I may even go as far as to say I primarily make any and all connections through Hypershade, after creating the node via a call to `cmds.createNode()`. At least if I intend the rig to last or be extended upon, as is often the case.

Then again, I've seen animators who never use the Graph Editor nor look at curves so "your mileage may vary".

likage

unread,
Jan 26, 2015, 2:26:55 AM1/26/15
to python_in...@googlegroups.com
Hey Marcus,

Thanks again. Well.. I may be wrong with the Graph Editor analogy, perhaps that differs from animators to animators. :D
I have rarely used Hypershade as a means for rigging, well I did for some stretchy (multiply/divide nodes?) but that was like 2 years ago? Then again, I will try to dig around for any tutorials on rigging that covers Hypershade or Node Editor..

P.S: Would you happen to know any tutorials on it?

Cheers!

Andres Weber

unread,
Jan 28, 2015, 11:10:56 AM1/28/15
to python_in...@googlegroups.com
Oh man...the Node Editor is insanely handy.  I use it and have now fully made the move from the Hypershade to the Node Editor.  Checking all available connections, creating/maintaining connections and checking data types has never been easier.  Plus the whole Nuke style workflow for tab-node creation is super handy.  I'd fully recommend it.  Sometimes I'll open things in Hypergraph: Connections if it's an insane node tree because both the Hypershade and Node Editor can get a big sluggish when mapping out intense networks.  Also Node Editor vs Hypershade, not having to not care whether your swatch updates etc are on/off is pretty handy since I'm pretty lazy and can't be bothered to toggle swatch updating on/off and don't care about looking at shaders 90% of the time.

This is a pretty good overview and comparison:
https://www.youtube.com/watch?v=_yi7J7cc00A

I checked a couple youtube videos but couldn't find something quickly that was pretty comprehensive...it's actually becoming a pretty deep window with a lot of options with each Maya release so also be sure to check the release notes from the official autodesk youtube channels since there's a ton of information on those too.

likage

unread,
Jan 29, 2015, 5:33:40 AM1/29/15
to python_in...@googlegroups.com
Hey Andres,

Thanks for letting me know. Guess this will take me a while to get used to the idea of using Node Editor.
Well, I did use Hypershade Connection but that is usually in the case for mapping out those Constraints stuff.

This is something new for me (if I did not mentioned it) but it should be interesting, hopefully..
Reply all
Reply to author
Forward
0 new messages