Page MenuHome

Fix:T99742 Crash blender when generate rig with Rigify
ClosedPublic

Authored by Jun Mizutani (jmztn) on Jul 16 2022, 4:23 AM.

Diff Detail

Event Timeline

Jun Mizutani (jmztn) requested review of this revision.Jul 16 2022, 4:23 AM
Jun Mizutani (jmztn) created this revision.

Hello, thank you for the fix but this breaks the camera focus when the bone is renamed.

Here is a better fix:

diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c
index 8d5ae6f3654..9de9fc8268f 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -285,7 +285,7 @@ void ED_armature_bone_rename(Main *bmain,
       /* fix camera focus */
       if (ob->type == OB_CAMERA) {
         Camera *cam = (Camera *)ob->data;
-        if (cam->dof.focus_object->data == arm){
+        if ((cam->dof.focus_object != NULL) && (cam->dof.focus_object->data == arm)){
           if (STREQ(cam->dof.focus_subtarget, oldname)) {
             BLI_strncpy(cam->dof.focus_subtarget, newname, MAXBONENAME);
             DEG_id_tag_update(&cam->id, ID_RECALC_COPY_ON_WRITE);

fix diff as your suggestion

This revision was not accepted when it landed; it landed in state Needs Review.Jul 18 2022, 2:53 PM
This revision was automatically updated to reflect the committed changes.