Repeat Operator - multiple transform.
Needs ReviewPublic

Authored by Jaume Bellet (mauge) on Sep 5 2015, 12:52 AM.
This revision needs review, but there are no reviewers specified.


Maniphest Tasks
T45734: Grab, rotate, scale with basepoint

coming from

This patch allows and operator to create another operator, repeating the action from beginning that it was performing.

It is tested on modal operators and in the patch is used on transform (translations),allowing the user to continue creating elements pressing "M" key before placing the object.

video: In the video the patch is combined with

To allow it, a new operator result is defined and managed. The parent operator is replaced with a new one, with no direct relationship. In order to get data in new one from previous, a new function copy is created on the operator type, and a new variable is set for the operator.

Diff Detail

rB Blender
Jaume Bellet (mauge) retitled this revision from to Repeat Operator - multiple transform..Sep 5 2015, 12:52 AM
Jaume Bellet (mauge) updated this object.
Jaume Bellet (mauge) set the repository for this revision to rB Blender.

Usually to repeat last operator we use shift-R and system uses the stored properties in RNA by calling the exec function of the operator.

shift-R is not modal, it only create lines of instances using the last parameters for x,y and z. What I understand here is that you can place all your instances precisely in one go, without having to hit alt/shift-D for each instance, which is faster and better for the hands :)

@mathieu menuet (bliblubli) it's exactly how you have described.

I'll try to improve it using RNA properties.

Using RNA properties to store data instead of a new var on operator.

Previous was including a define not used in BF blender.

This commit drops the created copy function on operator. Instead it copies all RNA named properties from previous to current, so any check or setting on new operator can be set reading RNA properties.

Sets a flag on 3D View header to be enabled by default.

Stores mode, so if link or clone operation is changed to rotate or scale, the new operation will perform same operator.