Friday, February 25, 2011

Pressure Test Stomach

Blender Script: Select the objects instantiated

Here I am, after a long pause.
Finally (and I mean really: FINALLY!) I integrated into my blender production flow, using it as the core software in a new job that I am following.

soon as I have more time I'm going to publish a small study on the organization of the new pipeline, but for now are mostly full and I am considering which rendering engine will join the team permanently retired once 3DStudioMax (Thea and VRay are candidates because of the progress of the exporter blender).

Anyway ... I write?
Why work with Blender on a scene with a number of instances I noticed that the outliner unfortunately does not have all the functions of selection that provides Max Then, in full open source philosophy, I decided to write scripts to do this work:)

This is a "beta" of a switch instances: instances of the active search and select. Very simple, very stupid if you want but loooong comfortable.
soon I'll know better use the API of Blender 2.6 I want to expand and integrate a pop-up.

course is available to anyone, licensed under GPL:

BEGIN GPL LICENSE BLOCK ##### # ##### #
# This program is free software, you can Redistribute it and / or # modify it under
the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####


#!BPY
"""
Name: 'Select object instances'
Blender: 256
Group: 'Object'
Tooltip: 'Select object instances'
"""
#author: Pietro Grandi (pietro909.blogspot.com)
#inspired by "atylmo" (http://atylmo.wordpress.com)
#

import bpy

scena = bpy.context.scene #punta the active scene

i = 0 # counter for loop

sel_obj bpy.context.active_object = # active object
sel_obj_type sel_obj.data.name = # object type selected
sel_obj_name sel_obj.name = # name of the selected


print ("E 'active object" + + sel_obj_name "type" + sel_obj_type)
print ("Instances:")

for object in scena.objects: # for each object in the scene
current_obj scena.objects = [i] # get the object name if
current_obj.data.name == sel_obj_type: # check if the selected type
print ("Selected" + current_obj.name ) # print it
current_obj.select = True # select
i + = 1 # advances the counter



0 comments:

Post a Comment