Thursday, June 14, 2012

MBE in Blender 0.9.9

HI!
News on Material by Element in Blender .263a:

  • Assign to Subobjects: assign to group of linked polygons inside an object
  • Assign to Polygons: assign to single polygons
  • Fill slots: fill active object's material slots with all material from selected list
  • improved UI
  • docstrings for operators and functions
feel free to use it, modify it and  including operators in your scripts.


Screenshot:



Thank you,
ciao!
Pietro

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

Wednesday, May 9, 2012

Eberhard Extrafort 125°

Eberhar Extrafort 125° by pietro.grandi
Eberhar Extrafort 125°, a photo by pietro.grandi on Flickr.
Hello,
this is my last work: a 3D for Eberhard.

Done in Blender, rendering VRay, postproduction Photoshop.

Wednesday, May 2, 2012

Material by Element - Blender 2.6 addon - Tutorial

Material by Element - new buttons

Another update:

  • fill slot: takes the mbe list using active material and for each material in list add a slot.
  • clear slot: remove all material (even not mbe) and slots and keep only the first
  • assign to polygons: works on single mesh's polygons.
  • KAOS and NMATS have been moved to bpy.context.scene so you don't need to have a valide mbe material selected, and I've solved this way the startup issue.
  • Change "kaos" algorythm due to my need... today I had to setup very little color variations so the new formula is:
    • r+(random.randint(0,K)/1000) -> now you can use it between 1 and 999


Goin' forward with textures... stay tuned!
Pietro



Monday, April 30, 2012

Material By Element - 0.9

Hello guys,
today I finally found the time to clean out the code and to organize interface:



downlad link:
material_by_element.py

A few words about this script
The goal would be, having an object with some element (like rooftile or bricks):
  1. generate 'N' materials based on the first and varying diffuse color of 'K
  2. splitt the former mesh into more objects
  3. apply randomly the materials to each object
Beside this 'core functionality' I needed some more functions:
  • find a precise 'mbe' list, in order to have more in one scene without contrast
  • select all objects involved in a selected list
  • find out objects without material (in a big scene could be tricky)
  • remove all unused material from scene (I know: just restart blender. But the keyword is: FAST and EASY)
  • completely remove active material from scene and objects with one click
  • completely remove materials of an 'mbe' list from scene and objects, and get back base material
  • any suggestion? :-)
For more explanation I suggest you to read previous posts about "Material By Element".


MORE INFO:
the scripts is able to find materials throug a marker string ('.mbe-') and the basename (all you have before marker) so... DON'T change material's name after, because you could have problems.


Installation: copy python script into your addons folder and check it on into "User Preferences\Addons\Material"
more info at http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/Add-Ons


As soon as possible I'll make videotutorial, wikipage and all that "bureocraty" stuff :)


The script is released under GPL 2.0, feel free to reuse/modify/cook/freeze/blend... but please let me know :-) I'm curious.


Pietro

Thursday, April 19, 2012

Ubuntu 12.04 beta - ls a colori [ITA]


Ubuntu 12.04 beta - ls a colori

Ciao,
stamattina ho avuto un problema con Ubuntu 12.04 che mi ha fatto perdere un po' troppo tempo. Ho deciso di condividere la soluzione:

1 - su Ubuntu 12.04 per qualche strano motivo l'output di ls non è più colorato
2 - non riesco a lavorare con l'output normale
3 - il comando per avere il colore è ls --color=auto
4 - per averlo in automatico bisogna sovrascrivere il comando ls tramite alias ls='ls --color=auto'
5 - inserendo il codice in $HOME/.bashrc l'alias rimane valido anche dopo il riavvio della console o del sistema
6 - se modificate /root/.bashrc create automaticamente l'alias per tutti gli utenti

Questo metodo è valido per la maggior parte degli altri comandi e relative opzioni.

saluti,
pietro