Fix T73054: Add DNA defaults for pose_ik_segments

This fixes the crash with pose_ik_segments = 0 in old files.
Some files were saved with the property set to 0, so the versioning code
won't work in that cases. I also changed that to fix the crash in those
files.

Reviewed By: brecht

Maniphest Tasks: T73054

Differential Revision: https://developer.blender.org/D6663
This commit is contained in:
Pablo Dobarro 2020-01-23 21:12:20 +01:00
parent 18c88eac17
commit e7c90438e0
Notes: blender-bot 2023-02-14 09:02:40 +01:00
Referenced by issue #73536, Pose brush crashes with parented geo
Referenced by issue #73054, Sculpt: Pose Brush Crashes with Vincent scene
2 changed files with 3 additions and 2 deletions

View File

@ -4356,8 +4356,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
/* Pose brush IK segments. */
if (!DNA_struct_elem_find(fd->filesdna, "Brush", "int", "pose_ik_segments")) {
for (Brush *br = bmain->brushes.first; br; br = br->id.next) {
for (Brush *br = bmain->brushes.first; br; br = br->id.next) {
if (br->pose_ik_segments == 0) {
br->pose_ik_segments = 1;
}
}

View File

@ -96,6 +96,7 @@
/* sculpting defaults to the draw tool for new brushes */ \
.sculpt_tool = SCULPT_TOOL_DRAW, \
.pose_smooth_iterations = 4, \
.pose_ik_segments = 1, \
\
/* A kernel radius of 1 has almost no effect (T63233). */ \
.blur_kernel_radius = 2, \