Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Drawing Overrides Shading now working?

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
Sebastian_Wiendl
1269 Views, 10 Replies

Drawing Overrides Shading now working?

Hi all,

 

I have been trying to figure this out, but can't seem to get it working.

What I want to do is to enable Drawing Overrides on meshes.

 

I enabled it and I set a color, but it just won't draw in that color.

 

If I switch to Bounding Box, or untick Shading, I see the object in wireframe and drawn in the green color.

 

So why doesn't it draw the mesh in green when I am in Shading mode?

 

Any and all help is much appreciated.

 

Cheers,

Sebastian

10 REPLIES 10
Message 2 of 11
daunish
in reply to: Sebastian_Wiendl

In your viewport, if you go to:

shading - wireframe on shaded

 

Your object wireframes are being shaded correctly by the override, but when you are in shaded mode you cant see wireframes. If you switch the scene to wireframe mode (4) you will see the wireframes reflect the colors you are picking.

 

Hope this is what you're looking for, let me know.

Message 3 of 11
Sebastian_Wiendl
in reply to: daunish

Hi @daunish,

 

Thanks for your response.

This is unfortunately not what I want.

I want a fully colored sphere, not just the wireframe.

Something like what's shown in my screenshot attached to this message.

 

For the purposes of the screenshot, I assigned a green material.

But I do not want to do this via material, as my meshes already have a bunch of materials set on them, and I don't want to override/lose them.

 

I was hoping this could be done via the Drawing Override.

 

Thanks so much.

Sebastian

 

Message 4 of 11
daunish
in reply to: Sebastian_Wiendl

Ah, that color-corrected screenshot helped, I see what you are trying to do. This is not what drawing overrides were designed for, and there is nothing on the shape node that would allow for doing this.

 

Depending on what your end goal is there are a couple of workarounds.

The easiest and most straight forward is to create material overrides via the shading node on the surface. Check out the attached image. In the image, I am using an Arnold shader, but this will work with most other render engines. I have a lambert with the color green going into the "surface shader" attrib of my material's shading engine. This will display in my viewport. But going into the "ai surface shader" attrib I have flowing my render material. This allows me to have two different materials, one for the viewport, one for the render.

 

I'd recommend this approach, I realize it is far more tedious than a simple override on the shape. But this has the most flexibility and can be easily scripted should you need to.

 

Let me know if this works for you. If not then I may need more info on your end goals and why you are trying to do this (the approach will shift depending).

Message 5 of 11
Sebastian_Wiendl
in reply to: daunish

I have attached 2 screenshots.

This is a very simplified example of what I am trying to do.

Basically, I have a number of meshes and run an algorithm that matches them together based on some criteria that are not important for this example. (they are not as trivial as size or rotation, etc.)

Matches get grouped together under transforms.

Now, the algorithm can fail and sometimes match wrong pairs together.

I want a way to quickly visualize all matches to check if things are okay, so that I can manually fix any issues.

Quick as in tick a box and get a visualization, then untick to go back to normal visualization.

 

While the wireframe coloring is somewhat okay for the spheres as they have a relatively dense tessellation, you can see that for the cubes it gets harder.

Now imagine 200 pairs, all with random colors. A light pink will be indistinguishable from a dark ping on a wireframe cube.

In addition, each mesh could have a material on it, which will make it even harder to see the wireframe colors.

So I really need a solid color to get as clear of a visualization as possible.

 

I hope this makes sense?

 

Message 6 of 11
daunish
in reply to: Sebastian_Wiendl

Ah, ya that totally makes sense. Since you are scripting this anyways. Why not just use color sets (vertex colors). They are super easy to manipulate via a couple of lines of code. You can group together object into single sets, create random colors for each set. Then via a check box (you would need to wrap this in a UI probably), you can hide, unhide, or delete the sets altogether.

 

At this point, I'm just suggesting other options on how I would do it. You arent going to find a preexisting check box to do it for you I'm afraid.

Message 7 of 11
Sebastian_Wiendl
in reply to: daunish

Okay, thanks a lot for the suggestion.

I'll give it a try tomorrow or early next week.

Message 8 of 11

Tried this approach and it works very well.

Thanks again for all of your help.

Much appreciated!

Message 9 of 11

Hi @daunish,

 

Sorry to bother you again, but I have a follow up question.

It appears that (at least the way I am doing it), adding colors / color sets drastically increases file sizes.

 

For example, I have an empty scene, then add a standard plane, make it 100x100 subdivs, i.e. end up with a plane thats got 10,000 quads.

If I save the file, it is 50KB large.

 

Then, if I do

polyColorPerVertex -r 1 -g 0 -b 0 -cdo "pPlaneShape1";

 

and save the file now, it is 9,662KB large, i.e. over 9MB

Am I doing this wrong? What's happening under the hood?

I would assume that a color is stored internally as a Vector of 4 floating point values, and even if Maya uses full precision, i.e. 64bit, that would be 4 * 64bit = 32Byte per vertex color vector.

The mesh has got 10,201 vertices, so it would be 10,210 * 32 Byte = 326,432Byte, i.e. less than a third of a MB.

So where does the rest of the 9MB of the file size come from? 

 

Another file I had went from 20MB to around 450MB.

I must be doing something wrong, right?

I also tried applying through the color set editor, but get exactly the same outcome.

 

Any and all help is much appreciated.

 

Cheers,

Sebastian

Message 10 of 11
daunish
in reply to: Sebastian_Wiendl

Yup, I get the same result. 

Personally, I never use vertex colors in Maya, so you'll have to forgive me if I'm off with my guess here.

 

I took a look at a ma file with vertex colors. What I think is happening is they are assigning the colors to the face vertexes.

So each face has 4 unique face vertexes. That would turn 4 faces with 9 verts (shared) into 16 verts (unique). This is kinda cool cuse you can paint a corner of a face without color bleed on to the surrounding faces. But it also sucks cuse, ya, file size.

 

I have no solution for a workaround as I think this is an internal Maya thing. As for your script, I think annoyingly you're going to have to set up a visualize feature that deletes the sets so they don't save with your scene.

Message 11 of 11
Sebastian_Wiendl
in reply to: daunish

Hi @daunish,

 

Thanks for getting back to me.

 

Personally, I never use vertex colors in Maya, so you'll have to forgive me if I'm off with my guess here.


No worries, I was just wondering if maybe I am doing something wrong here. Just felt so off.

 

As for your script, I think annoyingly you're going to have to set up a visualize feature that deletes the sets so they don't save with your scene.

Yeah, my thought as well, but unfortunately, for scenes with large geometry (I'm talking 1million+ triangles), reapplying colors takes quite a bit of time, so I need to either accept large file sizes, or spend >30sec waiting for recalculation/reapplication of colors everytime I want to see them again.

 

I really appreciate your help and will let you know if I manage to figure out a better strategy.

 

Cheers,

Sebastian 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report