diff --git a/release/datafiles/icons/ops.mesh.spin.duplicate.dat b/release/datafiles/icons/ops.mesh.spin.duplicate.dat deleted file mode 100644 index 4142b9fb4be..00000000000 Binary files a/release/datafiles/icons/ops.mesh.spin.duplicate.dat and /dev/null differ diff --git a/scripts/modules/bpy_extras/anim_utils.py b/scripts/modules/bpy_extras/anim_utils.py index b8084cbc685..15c45104551 100644 --- a/scripts/modules/bpy_extras/anim_utils.py +++ b/scripts/modules/bpy_extras/anim_utils.py @@ -205,11 +205,40 @@ def bake_action_iter( "bbone_easeout": 1, } + def can_be_keyed(value): + """Returns a tri-state boolean. + + - True: known to be keyable. + - False: known to not be keyable. + - None: unknown, might be an enum property for which RNA uses a string to + indicate a specific item (keyable) or an actual string property (not + keyable). + """ + if isinstance(value, (int, float, bool)): + # These types are certainly keyable. + return True + if isinstance(value, (list, tuple, set, dict)): + # These types are certainly not keyable. + return False + # Maybe this could be made stricter, as also ID pointer properties and + # some other types cannot be keyed. However, the above checks are enough + # to fix the crash that this code was written for (#117988). + return None + # Convert rna_prop types (IDPropertyArray, etc) to python types. def clean_custom_properties(obj): + if not bake_options.do_custom_props: + # Don't bother remembering any custom properties when they're not + # going to be baked anyway. + return {} + + # Be careful about which properties to actually consider for baking, as + # keeping references to complex Blender datastructures around for too long + # can cause crashes. See #117988. clean_props = { key: rna_idprop_value_to_python(value) for key, value in obj.items() + if can_be_keyed(value) is not False } return clean_props @@ -339,7 +368,8 @@ def bake_action_iter( lookup_fcurves = {(fcurve.data_path, fcurve.array_index): fcurve for fcurve in action.fcurves} if bake_options.do_pose: for f, armature_custom_properties in armature_info: - bake_custom_properties(obj, custom_props=armature_custom_properties, frame=f) + bake_custom_properties(obj, custom_props=armature_custom_properties, + frame=f, group_name="Armature Custom Properties") for name, pbone in obj.pose.bones.items(): if bake_options.only_selected and not pbone.bone.select: diff --git a/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 4a97fa13400..b505acd4883 100644 --- a/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -803,6 +803,7 @@ class _defs_edit_mesh: def draw_settings(_context, layout, tool): props = tool.operator_properties("mesh.spin") layout.prop(props, "steps") + layout.prop(props, "dupli") props = tool.gizmo_group_properties("MESH_GGT_spin") layout.prop(props, "axis") @@ -815,23 +816,6 @@ class _defs_edit_mesh: draw_settings=draw_settings, ) - @ToolDef.from_fn - def spin_duplicate(): - def draw_settings(_context, layout, tool): - props = tool.operator_properties("mesh.spin") - layout.prop(props, "steps") - props = tool.gizmo_group_properties("MESH_GGT_spin") - layout.prop(props, "axis") - - return dict( - idname="builtin.spin_duplicates", - label="Spin Duplicates", - icon="ops.mesh.spin.duplicate", - widget="MESH_GGT_spin", - keymap=(), - draw_settings=draw_settings, - ) - @ToolDef.from_fn def inset(): def draw_settings(_context, layout, tool): @@ -2996,10 +2980,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): _defs_edit_mesh.bisect, ), _defs_edit_mesh.poly_build, - ( - _defs_edit_mesh.spin, - _defs_edit_mesh.spin_duplicate, - ), + _defs_edit_mesh.spin, ( _defs_edit_mesh.vertex_smooth, _defs_edit_mesh.vertex_randomize, diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index aaf873be126..6846dbb07f2 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -855,7 +855,6 @@ set_property(GLOBAL PROPERTY ICON_GEOM_NAMES ops.mesh.rip ops.mesh.rip_edge ops.mesh.spin - ops.mesh.spin.duplicate ops.mesh.vertices_smooth ops.node.links_cut ops.paint.eyedropper_add