[Bf-committers] Fwd: change active object

Campbell Barton ideasman42 at gmail.com
Sun May 15 04:36:40 CEST 2011


if the object is only created be sure to link it to the scene first.
  bpy.context.scene.objects.link(ob)

to change the active object do:
  bpy.context.scene.objects.active = ob

2011/5/15 Yuniel Castro González <ycastrog at estudiantes.uci.cu>:
> Hi again.
> I have a new StringProperty that contain a brush_name and a segment of codes:
>
> for d in bpy.context.scene.objects:
>    if d.name == brush_name:
>        bpy.context.SceneObjects.active = d
>
> to change an active object in scene, but when I use new active object I am not obtain good results.
> Suggest me.
>
>
> ----- Mensaje reenviado -----
> De: "Yuniel Castro González" <ycastrog at estudiantes.uci.cu>
> Para: "listaBlender" <Bf-committers at blender.org>
> Enviados: Domingo, 15 de Mayo 2011 1:58:27 GMT +01:00 Amsterdam / Berlín / Berna / Roma / Estocolmo / Viena
> Asunto: change active object
>
> hello to all.
> I am programming a script for Blender 2.5 and I need to change the active object in the scene.
> How can I do?
> Thanks in advance.
>
> --
>
>
>
>
>
>
>
>
> Yuniel
>
> --
>
>
>
>
>
>
>
>
> Yuniel
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list