parent in python


(gnux) #1

I just want to make parent/child link between 2 objects in python ,but, when I do something like that :

obj = Blender.Object.Get(“lalalal”)
obj2 = Blender.Object.Get(lililili")
obj.parent = obj2

… it doesn’t work :

“AttributeError : cannot directly assign to item”

I precise that I use the 2.23 release

Is there anybody know how ?


(Devas73) #2

It means it’a a read only attribute… it’s probably not possible (yet) to parent via python in 2.23.


(Fabio) #3

I’m sure it’s possible. If there are some competent people to answer this query.
Please, reply…

Thank You very much…


(theeth) #4

I don’t have the documentations in front of me right now, but I also believe there’s a way to parent in Python. I think the method is called makeParent or something like this.

Of course, Devas is right when saying that the .parent attribute is read-only.

Martin


(gnux) #5

Thank you very very very much Martin !!!

It’s working !

et comme t’es de Montreal, si tu parles français : merci, ça fait 1 semaine qu’on est dessus !


(gnux) #6


(theeth) #7

ouais, je parle français…

Martin