In Blender 2.81, I have a linked collection, and I want to apply a transformation over it. In the UI I just select the empty , so when I scale, translate or rotate the empty the liked data experiences the transformations too.

By the other hand, to do it with bpy, for objects is:

# object.type = 'MESH'

But when I try to do it over an empty type:

# empty.type = 'EMPTY'

I get the error: 'NoneType' object has no attribute 'transform' because the empty's data property is None.

Is there a way to apply the transformations over empties? If there isn't how can I archive the same results?

I need to keep the collection linked because the source file changes quite often.

Thank you.


I found a solution:

You have to modify the empty's location, scale and rotation properties with the information contained in the Transformation Matrix. If you used vectors to build the Transformation Matrix, just apply them:

# For location add the vectors
empty.location = empty.location + traslationVect

# For scale assign the vector
empty.scale = scaleVector

If you have the transformation matrix you'll have to build the vectors based on the matrix's elements

PS: I didn't dive into rotations.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.