Object.Layer - bug?

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
M_i_c_h_e_l
Posts: 6
Joined: Mon Dec 29, 2003 1:59 pm

Object.Layer - bug?

Post by M_i_c_h_e_l » Thu Jan 22, 2004 3:58 pm

Hi!

Is it me or is there a bug with Object.Layer?
I tried to move an object to a different layer within a script - but changing the value of Object.Layer does not affect anything. The object is still where it was before...
Accessing the value again afterwards with Object.Get(_name_of_my_object_).Layer shows that the value has indeed changed. But in Blender the object is still displayed on the old layer.
Is there something wrong or am i missing anything here?
Thanks for your help,
Michael

tuinbels
Posts: 17
Joined: Mon Nov 18, 2002 4:19 pm

Post by tuinbels » Thu Jan 22, 2004 9:06 pm

Did you update the scene with python?

M_i_c_h_e_l
Posts: 6
Joined: Mon Dec 29, 2003 1:59 pm

Post by M_i_c_h_e_l » Fri Jan 23, 2004 12:25 pm

Thanks for your reply tuinbels!

Yes I did try that - with "0" and with a "1" as argument - no luck. Also did Blender.Redraw and Window.redrawAll - same result.
But I figured it out myself yesterday: It's possible to change the Layer-values before linking the object to the scene. So you have to create objects by creating a mesh with NMesh.new, an object with Object.new, then link the mesh with the object - change object values like Layer, LocX, ... and then link the object to the scene. This works - Creating objects with putRaw links the object to scene automatically but doing so i have not found a solution for the problem described above.

Post Reply