Quick Assign Material (with patch and OSX test build)

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Post Reply
Posts: 126
Joined: Wed Oct 16, 2002 9:58 am
Location: The Netherlands

Quick Assign Material (with patch and OSX test build)

Post by wavk »

Quick Assign Material (with patch and OSX test build)

I'd like your opinions about a new way of assigning materials in Blender. Easy to grasp and use and much faster for such a repetitive task.

For new to intermediate users, it can be frustrating working with material indexes. With buttons spread all over the place in the material buttons and the edit buttons. For experienced users it's interface requires too many actions for such a simple and repetitive task. Especially for architectural modeling, assigning materials is very repetitive.

The way you currently assign selected faces a material is as follows. Go to the edit buttons, if the material is already in the mesh, find its material index and press 'Assign'. More often than not, it's not in the mesh yet. In that case you press 'New' followed by 'Assign'. Then go to the Material buttons to select the material you want to be assigned. I bet most new users don't even understand the < 1 Mat 1 > button.

This interface is a direct reflection of how the code underneath works. The materials are in the mesh, so the panel for the indexes is in the edit buttons. It's good that this is visible. But for almost every use, it's too much for such a simple task as just assigning a material.

With the current material index system, you have the option to link materials to either the Mesh or the Object. This is the only benefit I can think of. This can be useful when having instances with different colors, but you virtually never need this and you don't want to bother yourself with material indexes.

Those are the reasons why I decided to code this feature, first in Python and now in C. You can access it through the Specials popup menu (W), or in the toolbox under Edit->Faces->Assign Material. In both cases you have to be in edit mode.

You are presented with a popup menu with all materials in the scene. When you choose a material, it looks if the material is already in the meshes material indexes. If not, it adds the material to the mesh. It then assigns each selected face the chosen material. This code respects material indexes linked to the object and leaves them untouched except.

There's a maximum of 16 materials per mesh. If that is reached the script says so and does nothing.

If your selection covers all faces of a material, it replaces that one, as well as unused material indexes.

I had a Win32 build, but the mail scanner didn't trust it, maybe tuesday...

I'd like your opinions about the naming, placement in the specials menu and in the toolbox, and of course the operation. Any bugs, suggestions?

Please test it with a scene with a bunch of materials. I did a lot of testing, but you never know how other people work.

When coding this I got to think about the material system and ways to make it better. For me it would be much cleaner to get rid of the index system, at least it should not be visible to the user. To get the benefit of the linking of a material to the object instead of the mesh, I suggest an easier to use Modifier 'Replace Material'.

Would this be possible without breaking old files?

Have fun,

Wybren van Keulen

Posts: 1
Joined: Mon Oct 21, 2002 1:44 pm
Location: Ireland

Post by malCanDo »

Hi there,

I agree with you in that the current way of assigning additional materials is a royal pain, for both newbies and experienced users.

I look forward to testing your Windows build when you upload it!


Posts: 21
Joined: Wed Oct 16, 2002 2:31 am

Post by aoe2bug »

I have never had much conflict with the current system, but using your test build is very nice, I think you may be able to find a more convenient place for the menuitem, but other than that this is great! :)

(the menuitem isnt that bad, but that menu is very long, perhaps it should be split in someway, but that is another topic)

thank you

Post Reply