Bones No Parent+Not Tail = Crash
Closed, ResolvedPublic

Description

Win7-64
Broken: 5bd8ac9

Single bone without parent
If you add IK constraint and uncheck Use Tail, blender crashes.
Appears to happen consistently (and only) if the bone doesn't have a parent.

ronan ducluzeau (zeauro) triaged this task as Incomplete priority.EditedOct 13 2017, 11:06 AM

I did not manage to reproduce the crash on my machine with current master or 2.79.

Thanks for the report but it would be helpful if you add a blend-file to the report that demonstrates the crash.

Please:

Try to start Blender in factory settings (--factory-startup commandline option) (this will ensure whether this is a userpref or addon issue or not).
Launch Blender from the command line with -d option and attach as text file here any error printed out in the console (do not paste it directly in comment).

Marking as "Incomplete" until the requested information from console or .blend file demonstrating the crash is provided.

Campbell Barton (campbellbarton) raised the priority of this task from Incomplete to Confirmed.Oct 13 2017, 12:22 PM

Only managed to redo this in blender2.8, looks like pointer checks resolve, assigning to Sergey.

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
index d610dc51080..eb7fbaefb95 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
@@ -90,6 +90,9 @@ void DepsgraphNodeBuilder::build_ik_pose(Scene *scene,

    /* Find the chain's root. */
    bPoseChannel *rootchan = BKE_armature_ik_solver_find_root(pchan, data);
+   if (rootchan == NULL) {
+       return;
+   }

    if (has_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name,
                           DEG_OPCODE_POSE_IK_SOLVER))
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
index 88477e512d1..c23d6d3a2bd 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
@@ -83,6 +83,9 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob,
     * - see notes on direction of rel below...
     */
    bPoseChannel *rootchan = BKE_armature_ik_solver_find_root(pchan, data);
+   if (rootchan == NULL) {
+       return;
+   }
    OperationKey pchan_local_key(&ob->id, DEG_NODE_TYPE_BONE,
                                 pchan->name, DEG_OPCODE_BONE_LOCAL);
    OperationKey init_ik_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT_IK);

I assumed it was understood by the tags I used. I'm still assuming you knew that but since it's not happening, I believe I should stop assuming it:

use startup command: --enable-new-depsgraph

The issue is not Blender per se, it's new dependency graph. I found the issue because I never start Blender without it (except accidentally/not on purpose, or when testing a bug/crash). It's not a "default-blender-run" error.
If you need me to upload a file, I can but it's just a bone. Shift+A>>Single bone. Insert IK, uncheck Use Tail

If my assumption "was" correct and you already knew that it's depsgraph, then I also renamed/moved my user prefs folder before starting, and it's the same thing.

We don't need a .blend file.
I am sorry for missing the tag and quickly triage the report as incomplete.

But it will help if you could precise that you are using the command until master is out of 2.79 like status and new depsgraph becomes default one.

@¿? (edtion) please be more specific in your bug reports, tags like Dependency Graph only mean issue is with a depsgraph, it does not imply at all that it is with the new one (or the old one). That’s why we ask our reporters that they follow our submission template and guidelines, read these tips about bug reports, and make a complete, valid bug report, with required info, precise description of the issue, precise steps to reproduce it, small and simple .blend and/or other files to do so if needed, etc.

@Campbell Barton (campbellbarton), patch seems fine to me. Dont' see anything wrong with the resulting relations either.