From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

Vertex Pinning in Edit Mode (BMesh)

--- Overview ---

I'm currently working on pinning functionality - as you know it from the UV Editor - for mesh editing. I have the majority of the code working as of now and apart from simply locking down verts completely it also allows to only lock verts on certain axes (global/local) and - when using the PET - it also offers a falloff.

The main reason I wrote it was that when working with the PET I don't always want all verts within its radius to be affected by the transformation. Especially if the radius of the PET is rather large one has to either act very carefully or hide those parts of the geometry which in no case should be affected. Those obviously are no ideal solutions for the problem but quite the contrary.

  • In general: Locking parts of the mesh in order to protect them from (unwanted) editing is not possible in a proper way by default, yet very much needed.

Only locking verts on certain axes (as proposed by Wahooney on the mailinglist) is also a pretty nice thing to have: It can be used like "Do Clipping" in the Mirror Modifier but without being bound to any other functionality. Hence it's possible to use it for a way broader field of modeling tasks.


In the experiments and test sessions I did within the last few days it became apparent that pinning has great capabilities as a "support mesh tool" as well. By pinning well-considered parts of the geometry and then applying any sort of transformation one can archieve great results and/or enhance working speed.

I'm absolutely sure that there are a number of more uses for it but those alone make it completely worthwhile in my opinion.


--- Implementation: UI ---

I think pinning is neither completely a "real" mesh tool (in the sense of directly modifying the mesh) nor can it be considered as something equal to the PET; it's something in between, but touching both worlds. This of course brings up the question how it can be properly integrated:

Personally - based on the experiences I made during testing - I tend towards putting it (and the corresponding options) in the Tool Bar. Depending on the workflow of the user it can play a very important role in the mesh editing process and thus should be placed in prominent area for this very purpose.

DingTo and I agreed the best way would be to use a seperate panel in order to be able to minimize it if it's not needed.

  • Example: [1] (As the falloff is only available in combination with the PET the falloff size slider only toggles visible accordingly.)

Concerning the pin falloff size: Currently it can be set before starting the tranformation by simply using the slider, and in order to also be able to change the radius while transforming it can aditionally be changed with Alt+Mousewheel.


Also: Should there be a button to choose between global and local axes, or should it simply check for the current Transform Orientation and use that? (only local or global)


I think consistency (in color) between UV Editor pins and 3D View pins should also be given, but that's currently not the case:

In my opinion red should definitely not be used in the 3D View; I tested it for a bit and it's way too obtrusive and is exertive for your eyes after a while. Additionally red is used for sharp and seam edges already (hopefully a subject to change) and adding another one would't help that at all. Currently it uses a light blue: [2]

I'm not too sure if changing the color of the UV Editor pins would work that well but it would be good to have consistency, maybe even with a different color?


--- Implementation: other mesh tools---

An issue that's more related to the internals is how to deal with other mesh tools such as extrude, duplicate, split, etc. Currently they take pinning into account and thus inherit the danger of producing unnoticed doubles. I plan to make them ignore pinning by default but it might be a good idea to also implement an option to disable this somewhere. In combination with extrude e.g. pinning can speed up the workflow in a few cases if used wisely.

  • Example: [3] (The selected verts were pinned and then everything within was extruded upwards. This of course produced doubles at the borders but removing them can be faster than archieving the same result using a different technique.)

As mentioned above such tools should ignore pinning by default though, this is a lot safer.


Broken recently asked me how this integrates with the Mirror Modifier and for what I've tested so far it works great. The behaviour mirrors without any complaints.


--- Test Builds ---

Thanks a bunch to DingTo and Fish for making Windows and Linux builds available, here are the links:

Linux 32bit: http://www.graphicall.org/builds/builds/showbuild.php?action=show&id=1114
Linux 64bit: http://www.graphicall.org/builds/builds/showbuild.php?action=show&id=1115
Windows 32bit: http://www.graphicall.org/builds/builds/showbuild.php?action=show&id=1123



I would very much appreciate any C&C in order to make this a valuable addition to Blender.

Thanks,

Fabian


Frigi 02:05, 18 September 2009 (UTC)