Monday, June 11, 2012

MaterialByElement - rewritten and updated!

11. June 2012 - Berlin


Sorry for the delay,
I've been really busy because I'm working between Milano and Berlin and it's no
simple setting up two different workspaces...


Anyway: I've finally rewritten Material by Element addon in order to be lighter
and more concentred on less tasks. And it's working!


Now, let's see how it works:
you've got two boxes in UI that relate to "material list" and "material"
management; the first menu selector is to choose current working list: it finds
them into the scene through a custom property (bpy.types.Materials.mbe).
This property is added to the scene if not found: its default value is "default
list" (really!?!)
There's a label that shows you which list is active (due to menu issue: check
TODO below) and two buttons: the former selects all objects with a material
belonging to current list applyied, the latter assigns to current selected
objects random list's material.
In the second box you can manage single material:
- "list" property assigns current material to a list ('default list' for
NONE). Just type in list's name.
- remove unused, select orphans and clear slot are the same as in the
previous version


Example:
I want to create the same rooftiles as before (I'm building rooftiles since
August 2011...); take the first object, create material and assing it to a new
list; take the second, assign the material just created, make it unique, modify
something to get a different material. Do this for six, seven times. Ok, now
select all you rooftiles object, select correct working list a click "Assign".
If you want to add new material to collection just assign it to list, select all
objects with first button and reassign all.
With the new 'mbe' property you can use different names, beacuse addon doesn't
care about names now.


What you said? Ok, ok... I understand: I'm upgrading a script and it holds at
least an half than previous version's functions... Du hast recht!
But I don't use that functions and I think that them make it less usable.
Anyway, I'm planning to integrate them as a 'plus' into the script, so you won't
have thousands buttons that you don't use.


DOWNLOAD LINK:
material by element - 0.9.7.tar.gz


ChangeLog (0.9.7):
 - the addon is now splitted into 3 files; to install it, simply unzip
'material_by_element.xxx.tar.gz' into you  addon folder and activate it in user
preferences/addon
 - you cannot generate new materials with random diffuse: this is beacuse in my
everyday work I saw that I never use it. And with cycles it's bettere setting up
every material each one.


TODO:
 - let list selector update itself as soon as you choose
 - identify 'subobject' quickly (quite difficult, please refer to blenderartist
thread: http://blenderartists.org/forum/showthread.php?256937-Get-list-of-selected-vertices-segment-polys-without-looping-the-entire-geometry





I wish to give my thanks to:
blenderartists.org forum - CoDEmanX, TrumanBlending, kgeogeo, batFINGER
Thomas Larsson - "Code snippets. Introduction to scripting with Blender
2.5x."
Mark Pilgrim - "Dive into Python"
Witold Jaworski - "Programming Add-ons for Blender 2.5"
http://blenderpython.blogspot.de/
Blender 2.5x official documentation (www.blender.org)

...sorry if I forgot someone, blender community is really wide!



Cheers,
Pietro

2 comments:

  1. Hello Pietro...thanks for that. i am/was a max user...and i really miss this feature in blender.
    However i've don't really get how to use it properly. is there any guide or video?

    ReplyDelete
  2. Hello Alan! I've tried to upload a videotutorial but it's not good.
    Let me make another one right now, I promise you I'll upload it in a few hours.

    ReplyDelete