set.Name is read-only?

When I use the setName in an Empty and I get this errror in the Python shell:

“AttributeError: Blender Object object attribute ‘setName’ is read-only”

which doesn’t make a lot of sense to me since ‘set…’ attributes shouldn’t be read-only, right?

Thanks

Old Blender,
Blender 2.54:


>>> o = C.active_  #Ctrl space done!
active_base  active_bone  active_object  active_pose_bone
>>> o = C.active_object
>>> o
bpy.data.objects["Cube"]

>>> o.name="PKHG"
>>> o
bpy.data.objects["PKHG"]

and nicely shown in the 3DView

I’m using Blender 2.49. and changing .setName to .name like you used above was a lovely solution. Thanks a lot

If not really nesseary change to Blender 2.54 SVN >=32600!

can you explain how this command works ?

o = C.active_ #Ctrl space done!

i mean what is the C var here ?
is this a dummy variable ?

and Ctrl space is the autocomplete button on bottom header!

thanks

If you open (in Blender 2.54) the console (above activate Scripting!)
and Type the C
you see that it is a shortcut for bpy.context, see:
>> C
<bpy_struct, Context at 0x02D43008>

>>> bpy.context
<bpy_struct, Context at 0x02D43008>

And in this console the completion operation is Ctrl - space (two keys of the keyboard), very convenient!
Try it e.g.
bpy.c (Ctrl-Space)
bpy.context. (Ctlr-Space)
etc!

ok understand the autcocompletion difference here

but the first one!

If you open (in Blender 2.54) the console (above activate Scripting!)
and Type the C
you see that it is a shortcut for bpy.context, see

sorry i tried this c in the console window
and get this
>>> c + ctrl space
chr( class classmethod( compile( complex( continue copyright( credits(
>>> c

what do you mean by above activate scripting?

i’m still with version 529!

Thanks

Kapital C!