Page MenuHome

Grab, rotate, scale with basepoint
Needs ReviewPublic

Authored by Jaume Bellet (mauge) on Sep 3 2015, 6:36 PM.



coming from

The patch adds the cursor as Snap Element, and "Manual" on Snap Target, and also "manual" as pivot point.

When Snap Target or pivot point are set to Manual you must first set it. If both are activated, pivot point goes first.

The target can be set once the transform is running using "B" Key.
The pivot point can be set once the transform is running using "C" Key.

When selecting the snap target or pivot points, events are bypassed on modal, so you can move around the scene.
You can also more around the scene pressing using "N" Key.

When rotating using a manual snap target, you can rotate using the resulting axis between both points, pressing "W" key once the target is selected.

Also there is missing a reference value for resize, and selecting a 3 points to define a plane for mirroring.

Any suggestion are welcome.

some videos uploaded

Diff Detail

rB Blender

Event Timeline

Jaume Bellet (mauge) retitled this revision from to Patch applying T45734.
Jaume Bellet (mauge) updated this object.
Jaume Bellet (mauge) set the repository for this revision to rB Blender.
Jaume Bellet (mauge) retitled this revision from Patch applying T45734 to Grab, rotate, scale with basepoint.Sep 3 2015, 7:39 PM

Thanks Jaume, its's huge improvement! Minor issue at least for me is that snap on target works sometimes only when zooming in and out slightly or changing view direction slightly. But in general it's amassing :)

Little thing. When in edit mode and manual snap target activated. This manual snap point could not be selected on active vertex itself. Workaround would be to switch modes, but for consistency I think it would be better to be able to select even active vertex itself.

Jaume Bellet (mauge) updated this object.

This commit fixes some issues founds, and enhances UI input, like custom cursors to indicate you are selecting a point.

The "C" keystroke for directly select cursors as snap target has been removed, as is best using the snap_target as cursor.

The manual snap target select has diverged from snap code, and now it using a selected_point also used to select the pivot_point.

This patch doesn't work anymore. It's a really good addition, please update it :)

It can now be applied to bf master and includes the transform multiple feature.

with your update and VS2013 i get this:

source\blender\editors\transform\transform_constraints.c(504) : error C2059: syntax error : '}'
source\blender\editors\transform\transform_constraints.c(508) : error C2065: 'v2' : undeclared identifier
source\blender\editors\transform\transform_constraints.c(508) : warning C4047: 'function' : 'float *' differs in levels of indirection from 'int'
source\blender\editors\transform\transform_constraints.c(508) : warning C4024: 'sub_v3_v3v3' : different types for formal and actual parameter 1
source\blender\editors\transform\transform_constraints.c(509) : error C2065: 'v2' : undeclared identifier
source\blender\editors\transform\transform_constraints.c(509) : warning C4047: 'function' : 'const float *' differs in levels of indirection from 'int'
source\blender\editors\transform\transform_constraints.c(509) : warning C4024: 'cross_v3_v3v3' : different types for formal and actual parameter 3

Master branch compiles without problem.
I use "arc patch D1501" and it applies without error but some warnings about whitespaces.

Solves compiler error on empty vector initialization

Hi Jaume,
Thank you, it gets better, but VS still gives errors:
source\blender\editors\transform\transform_snap.c(966) : error C2059: syntax error : '}'

Solved same issue of bad empty vector initialization. I'm not Windows user (was working fine for me) and i did not detect it in previous diff upload.

Really strange error this time. While compiling, it start makesrna.exe, which then crash and breaks the compile process, but without any usefull error message (just : "terminated because of errors"). I build with scons on vs2013 / win7 x64. Master still builds without problems so it doesn't come from the environment.

Um.... as I am not a VS studio user (no windows avaliable at this moment), it's dificult for me to see what's going on, as in as is working (for me) on linux.

I've seen that for any unknown reason the struct draw_channels_items was lost the null termination, i'll re-upload the patch again..

Null terminated for draw_channels_items struct was lost.

I get errors now applying the patch:

C:\Users\test\AppData\Local\Temp\d5uhf4fgwokw4ws\23415B3.tmp:530: trailing whitespace.
                Object *ob = base->object;
C:\Users\test\AppData\Local\Temp\d5uhf4fgwokw4ws\23415B3.tmp:1605: trailing whitespace.

Checking patch source/blender/windowmanager/intern/wm_event_system.c...
Checking patch source/blender/makesrna/intern/rna_space.c...
Checking patch source/blender/makesrna/intern/rna_scene.c...
Checking patch source/blender/makesrna/intern/rna_access.c...
Checking patch source/blender/makesrna/RNA_access.h...
Checking patch source/blender/makesdna/DNA_windowmanager_types.h...
Checking patch source/blender/makesdna/DNA_view3d_types.h...
Hunk #1 succeeded at 320 (offset -1 lines).
Checking patch source/blender/makesdna/DNA_scene_types.h...
Checking patch source/blender/editors/transform/transform_snap.c...
Checking patch source/blender/editors/transform/transform_ops.c...
Checking patch source/blender/editors/transform/transform_manipulator.c...
Checking patch source/blender/editors/transform/transform_generics.c...
C:\Users\test\AppData\Local\Temp\d5uhf4fgwokw4ws\23415B3.tmp:883: new blank line at EOF.
Checking patch source/blender/editors/transform/transform_conversions.c...
Checking patch source/blender/editors/transform/transform_constraints.c...
Checking patch source/blender/editors/transform/transform.h...
Checking patch source/blender/editors/transform/transform.c...
Checking patch source/blender/editors/include/ED_transform.h...
Applied patch source/blender/windowmanager/intern/wm_event_system.c cleanly.
Applied patch source/blender/makesrna/intern/rna_space.c cleanly.
Applied patch source/blender/makesrna/intern/rna_scene.c cleanly.
Applied patch source/blender/makesrna/intern/rna_access.c cleanly.
Applied patch source/blender/makesrna/RNA_access.h cleanly.
Applied patch source/blender/makesdna/DNA_windowmanager_types.h cleanly.
Applied patch source/blender/makesdna/DNA_view3d_types.h cleanly.
Applied patch source/blender/makesdna/DNA_scene_types.h cleanly.
Applied patch source/blender/editors/transform/transform_snap.c cleanly.
Applied patch source/blender/editors/transform/transform_ops.c cleanly.
Applied patch source/blender/editors/transform/transform_manipulator.c cleanly.
Applied patch source/blender/editors/transform/transform_generics.c cleanly.
Applied patch source/blender/editors/transform/transform_conversions.c cleanly.
Applied patch source/blender/editors/transform/transform_constraints.c cleanly.
Applied patch source/blender/editors/transform/transform.h cleanly.
Applied patch source/blender/editors/transform/transform.c cleanly.
Applied patch source/blender/editors/include/ED_transform.h cleanly.
warning: 3 lines add whitespace errors.

I always check the patch before submitting... and I cannot see the error. I see you apply the patch over a more recent version of master, so i upgraded my base. I use patch command, so I tryed to apply the patch using arcanist and i get OKAY Successfully committed patch. Only a hunk offset, which is not a problem/error.

Did you tried to build it ¿?

And it works :) Nice job. Even better than I expected, we can move the view while grabbing!!!! Please make a separate patch for it to get it in trunk. For the purpose of the patch itself, nicely done. I miss some feedback sometime. The little circle around the vertex that will be chosen to snap is not showing every-time. Sometime yes, sometime not, but I couldn't find a reproducible way to showcase it.
By the way you did both well during the conference regarding the issues you had with the technique :)
Going to test further, but thumbs up on that one anyway :)

Oh and by the way, add some reviewers like Campbell ?

Edit: We can only move the view while moving the snap target/element. It would be nice to make it consistent and add it to the grab/duplicate/rotate and scale function.

I think we should move this kind of comments on the Task rather than the diff ;)

Yes, you can move around the scene to select the points, that was because i considered interesting to allow it for better selection ;) it's done bypassing events on the modal, this means it's not modal, so mouse inputs as not working as usual when applying the transform. I was thinking on a keystroke or button to enable/disable the modal.

We have had a presentation about this feature, but i have problems... because i upgraded my OS on July, and i did not test the video output from then (was working before), so it was not working due to drivers issues.. You can see it there

the first 15 minuts we are trying to solve the problem. it is a 30 min presentation. Also @Justas Ingelevičius (ingis) is presenting and addon related to cad improvements.

Jaume Bellet (mauge) updated this object.

Add the kestroke N while performing a transform allowing user to move around the scene.

It also ads an icon to enable by default the transform-multiple flag

Nice :) But i get following error:

error: unpack requires a string argument of length 8:
  File "C:\Users\test\blender_git_v2\blender\SConstruct", line 825:
  File "C:\Users\test\blender_git_v2\blender\SConstruct", line 768:
  File "source/blender/datatoc\", line 156:
    icondir_to_png(path_src, file_dst)
  File "source/blender/datatoc\", line 135:
    icon_merge(f, pixels_canvas, canvas_w, canvas_h)
  File "source/blender/datatoc\", line 88:
    head, pixels = icon_read(file_src)
  File "source/blender/datatoc\", line 81:
    head, pixels = icon_decode(f_src)
  File "source/blender/datatoc\", line 62:
    head = icon_decode_head(f_src)
  File "source/blender/datatoc\", line 48:
    icon_w, icon_h = struct.unpack('<2I', temp_data)

Icon stuff have been removed from diff as it seems there are some issues with it on previous diff.

Full test can be with a checkout from, enabling WITH_MECHANICAL flag.

compiles now much further, but again the makesrna.exe problem: While compiling, it start makesrna.exe, which then crash and breaks the compile process, but without any usefull error message (just : "terminated because of errors").

Should fixes an issue on RNA on some systems, although i cannot check as it works for me.

@mathieu menuet (bliblubli) maybe you could try to checkout from

the branch mechanical-grab-w-basepint-bf should match this patch. the master may include more mechanical/architectural CAD improvements. we'll try to keep regularly updated with bf blender master.

Sweeeeeeeeeeettt :) Just tested this patch, it rocks. I'll check your branch tomorrow to see the other goodies !

Would it be possible to make the free view default behavior? At the moment, axis constrained can be done with (shift) x,y and z (and is done this way by all artists I know). So having the MMB also for it by default is redundant. People not using the keyboard shortcut, if any, can then press N to get the old behavior back. In the meantime it would also solve the keymap problem for most people.

by the way, specify a reviewer like Campbell.