From 88ffe1a3e14d30fb39310ed6f7318b92a20a2339 Mon Sep 17 00:00:00 2001 From: jamesbaber1 <31859220+jamesbaber1@users.noreply.github.com> Date: Tue, 17 Nov 2020 18:22:26 -0600 Subject: [PATCH] Prevent regenerating a new rig on file load #143 --- ue2rigify/addon/__init__.py | 4 ++-- ue2rigify/addon/functions/scene.py | 2 +- ue2rigify/addon/functions/utilities.py | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ue2rigify/addon/__init__.py b/ue2rigify/addon/__init__.py index 201a3d37..81732c98 100644 --- a/ue2rigify/addon/__init__.py +++ b/ue2rigify/addon/__init__.py @@ -14,9 +14,9 @@ "author": "Epic Games Inc.", "description": "Allows you to convert a given rig and its animations to a Rigify rig.", "blender": (2, 83, 0), - "version": (1, 3, 12), + "version": (1, 3, 13), "location": "3D View > Tools > UE to Rigify", - "wiki_url": "https://github.com/EpicGames/BlenderTools/wiki/UE-to-Rigify-Home", + "wiki_url": "https://epicgames.github.io/BlenderTools/ue2rigify/quickstart.html", "warning": "", "category": "Pipeline" } diff --git a/ue2rigify/addon/functions/scene.py b/ue2rigify/addon/functions/scene.py index df080b06..b87fb967 100644 --- a/ue2rigify/addon/functions/scene.py +++ b/ue2rigify/addon/functions/scene.py @@ -1355,7 +1355,7 @@ def switch_modes(self=None, context=None): if properties.selected_mode == properties.control_mode: convert_to_control_rig(properties) - # record this mode change in the history + # clear the undo history utilities.clear_undo_history() # restore the context diff --git a/ue2rigify/addon/functions/utilities.py b/ue2rigify/addon/functions/utilities.py index b25551e5..eacd3048 100644 --- a/ue2rigify/addon/functions/utilities.py +++ b/ue2rigify/addon/functions/utilities.py @@ -715,6 +715,10 @@ def save_properties(*args): except TypeError: scene_properties[attribute] = str(value) + # if the selected mode is control mode, then save the rig as frozen + if window_manager_properties.selected_mode == window_manager_properties.control_mode: + scene_properties['freeze_rig'] = True + def load_context(properties): """