Object.dimensions doesn't support shortshands (e.g. *=) #36958

Closed
opened 2013-10-04 20:36:52 +02:00 by CodeManX · 5 comments
Member

%%%--- Blender version with error, and version that worked ---
r60402

- Steps for others to reproduce the error (preferably based on attached .blend file) ---

bpy.context.object.dimensions = bpy.context.object.dimensions * 3 # works
bpy.context.object.dimensions *= 3 # does nothing%%%

%%%--- Blender version with error, and version that worked --- r60402 - Steps for others to reproduce the error (preferably based on attached .blend file) --- bpy.context.object.dimensions = bpy.context.object.dimensions * 3 # works bpy.context.object.dimensions *= 3 # does nothing%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

%%%Guess that one is for Campbell too… ;)%%%

%%%Guess that one is for Campbell too… ;)%%%

%%%Whats happening is 'dimensions' works in quite a strange way.

Dimensions reads from the object matrix, but sets the object scale.
So writing if the vector is set, then immediately read, the read value will remain unchanged.

This causes a problem for in-place multiplication since the vector is written to once for the in place multiplication, but read again for the attribute assignment.

Attached a workaround when skips the assignment if an RNA variable is assigned to its self, however I don't think its acceptable.

IMHO dimensions shouldn't even be an RNA attribute, it was only added for the interface and has problems with the order values are set in too - perhaps this could be redone in C and the rna attribute removed.%%%

%%%Whats happening is 'dimensions' works in quite a strange way. Dimensions reads from the object matrix, but sets the object scale. So writing if the vector is set, then immediately read, the read value will remain unchanged. This causes a problem for in-place multiplication since the vector is written to once for the in place multiplication, but read again for the attribute assignment. Attached a workaround when skips the assignment if an RNA variable is assigned to its self, however I don't think its acceptable. IMHO dimensions shouldn't even be an RNA attribute, it was only added for the interface and has problems with the order values are set in too - perhaps this could be redone in C and the rna attribute removed.%%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

This is weak design on blenders part, but not going to change, I would say fix is to remove dimensions but probably this would annoy script authors too.

closing (wontfix)

This is weak design on blenders part, but not going to change, I would say fix is to remove `dimensions` but probably this would annoy script authors too. closing (wontfix)
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#36958
No description provided.