Discussion:
[Maya-Python] Setting Display Type
likage
2015-01-21 10:06:12 UTC
Permalink
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+***@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
2015-01-21 10:09:41 UTC
Permalink
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.
Post by likage
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/ba615d3e-493f-45d5-ada7-76fe66454c55%40googlegroups.com
<https://groups.google.com/d/msgid/python_inside_maya/ba615d3e-493f-45d5-ada7-76fe66454c55%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
*Marcus Ottosson*
***@gmail.com
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBfbx%2B5ekN1brV%2Bee4DC3g83bo4C5qpB8Yg_Xst6P-VHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Andres Weber
2015-01-21 19:27:49 UTC
Permalink
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.
Post by Marcus Ottosson
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.
Post by likage
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/ba615d3e-493f-45d5-ada7-76fe66454c55%40googlegroups.com
<https://groups.google.com/d/msgid/python_inside_maya/ba615d3e-493f-45d5-ada7-76fe66454c55%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
*Marcus Ottosson*
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/156da9fa-a527-4520-8ab0-93e757d926a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
likage
2015-01-22 06:59:39 UTC
Permalink
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_maya+***@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
2015-01-22 08:10:31 UTC
Permalink
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.
Post by likage
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/25e915ff-40c9-4ada-b081-539b44996ebc%40googlegroups.com
<https://groups.google.com/d/msgid/python_inside_maya/25e915ff-40c9-4ada-b081-539b44996ebc%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
*Marcus Ottosson*
***@gmail.com
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOB_LG2%2BQsSuvUnRmqBJretGjAnJcQSr90t69YRfU8Fiog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
likage
2015-01-22 08:54:05 UTC
Permalink
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...
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/251dad8c-d957-4adc-99f1-a540f672fb08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marcus Ottosson
2015-01-22 09:00:57 UTC
Permalink
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.
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCaQjy_JHVP2cFUQrouLoyyA4oLjYF7dFegGaXGJFVgzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Andres Weber
2015-01-22 19:15:18 UTC
Permalink
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?
Post by Marcus Ottosson
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.
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/70c577c4-cc5c-4b7f-ac45-a48f43ac4317%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
damon shelton
2015-01-22 19:19:53 UTC
Permalink
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.
Post by Andres Weber
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?
Post by Marcus Ottosson
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.
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/70c577c4-cc5c-4b7f-ac45-a48f43ac4317%40googlegroups.com
<https://groups.google.com/d/msgid/python_inside_maya/70c577c4-cc5c-4b7f-ac45-a48f43ac4317%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM9RXoJRkP0VGCMCq-S3Of68BHktHOGG_F2ZDe6Wo5ktk52kKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
likage
2015-01-23 02:26:58 UTC
Permalink
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?
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/605074bd-25b2-493b-94d2-e5f52beb07ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marcus Ottosson
2015-01-25 19:22:41 UTC
Permalink
​> 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".
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCewOnDTaO7Nw1-5bE22_gEQ7i-gNvrcnXED_E9kzs3dA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
likage
2015-01-26 07:26:55 UTC
Permalink
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!
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/09afb8e5-0d87-435a-b77e-cf923e4499f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andres Weber
2015-01-28 16:10:55 UTC
Permalink
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:


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.
Post by likage
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!
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/fcb76cd3-30f7-4198-8175-831c6592717c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
likage
2015-01-29 10:33:39 UTC
Permalink
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..
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b500184a-1242-4881-af49-f5856e297387%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...