Page MenuHome

addon Mesh:Extra Tools operator Add Armature is flaky
Closed, ResolvedPublic

Description

Blender Version
Broken: 2.71

Short description of error
meta-andoctro on IRC asked me to help find out what is wrong with the Mesh: Extra Tools Multi Face Extrude / Add Armature tool. I have managed to confuse myself.

Exact steps for others to reproduce the error

start with the default cube.
go to the addons tab in the Tool region and chose Multi Face Extrude from the Multi Extrude Plus panel
Without doing anything else, click the Add Armature button.

The operator will fail with a "Select a face or a vertex where the chain should end..." error message.
According to meta-andoctro this workflow used to work in the past. I'll let him provide more detail.

Details

Type
Bug

Event Timeline

Robert Forsman (mutantbob) raised the priority of this task from to Needs Triage by Developer.
Robert Forsman (mutantbob) updated the task description. (Show Details)

Since the Add Armature operator requires you to select some faces, I jumped to the conclusion that the Multi Face Extrude should complete its operation leaving the tips of the extrusions selected.

The following patch seems to accomplish that.

diff --git a/mesh_extra_tools/mesh_mextrude_plus.py b/mesh_extra_tools/mesh_mextrude_plus.py
index ed0ab86..c855f07 100644
--- a/mesh_extra_tools/mesh_mextrude_plus.py
+++ b/mesh_extra_tools/mesh_mextrude_plus.py
@@ -131,6 +131,8 @@ class MExtrude(bpy.types.Operator):
         bm.from_mesh(obj.data)
         sel = [f for f in bm.faces if f.select]
 
+        after = []
+
         # faces loop
         for i, of in enumerate(sel):
             rot = vrot(self, i)
@@ -159,9 +161,14 @@ class MExtrude(bpy.types.Operator):
 
                 bm.faces.remove(of)
                 of = nf
+            after.append(of)
 
         for v in bm.verts: v.select = False
         for e in bm.edges: e.select = False
+
+        for f in after:
+            f.select = True
+
         bm.to_mesh(obj.data)
         obj.data.update()

Unfortunately, while this alteration does allow the Add Armature button to succeed, something weird is going on with the parameters region for the Add Armature operator. Adjusting any of the parameters (such as Max Bones) resets the mesh to the state before Multi Face Extrude was clicked.

If you do any other operation between Multi Face Extrude and Add Armature (such as toggling to edit mode) then the problem does not exhibit itself.

My grip on how adjustments to these operator parameters are handled in the state and the UI is nonexistent, so I'm going to need some help to create a "boundary" between the two operators.

Bastien Montagne (mont29) lowered the priority of this task from Needs Triage by Developer to Normal.
Bastien Montagne (mont29) updated the task description. (Show Details)
Bastien Montagne (mont29) edited projects, added Add-ons; removed BF Blender.
Brendon Murphy (meta-androcto) triaged this task as Confirmed, Medium priority.Sep 12 2014, 3:53 PM

hi, I've been aware of this issue & I am trying to fix with little success atm.
It may be that I will have to remove if it cannot be fixed properly within a few weeks.
Thanks mutantbob for the multi extrude fix, I will look at that too.
I',m really not sure what caused these issues as these two addons worked perfectly in 2.63 without the need for selected end face.

Thanks for report & help.

committed part on of the fix, by mutantbob
fix for last face selected thanks purplefrog
rBACea70fe1bab8187b4df8bd8b4aed8314c20b0b441

I have a test version of the addon (parent addon mesh_extra tools) with add armature removed.
I'll allow some more time to try to fix before removing add armature & closing this report.

The problem with the armature is definitely related to the undo system.

If you do
Multi Face Extrude
Add Armature
Undo
then it undo-s both of the operations, not just the Add Armature.

I'm inclined to blame the undo system for the time being.

hi, the current problem with the armature code is the length of the bones, when the addon was working it followed edge loops nicely, now the bone length is incorrect.

hi,
only a few days to go, if anyone can fix the armature length issue, please do, if not, we lose this feature.

removed armature function from menu.