Skip to content

Commit

Permalink
Merge pull request #626 from james-baber/main
Browse files Browse the repository at this point in the history
UE to Rigify 1.6.2
  • Loading branch information
james-baber authored Jun 1, 2023
2 parents 78de5a1 + 9d0777a commit e46075c
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 199 deletions.
1 change: 1 addition & 0 deletions docs/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
- ./:/home/node
environment:
TEST: 1
GA_ID: $GA_ID
working_dir: /home/node
entrypoint: npm
command: run build
158 changes: 1 addition & 157 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"devDependencies": {
"@vuepress/cli": "^2.0.0-beta.62",
"@vuepress/plugin-google-analytics": "^2.0.0-beta.62",
"@vuepress/plugin-palette": "^2.0.0-beta.60"
"@vuepress/plugin-palette": "^2.0.0-beta.62"
}
}
4 changes: 2 additions & 2 deletions tests/test_files/unreal_projects/test01/test01.uproject
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"FileVersion": 3,
"EngineAssociation": "5.1",
"EngineAssociation": "5.2",
"Category": "",
"Description": "",
"Plugins": [
Expand All @@ -17,4 +17,4 @@
"Enabled": true
}
]
}
}
7 changes: 4 additions & 3 deletions ue2rigify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
import importlib
from . import properties, operators, constants
from .settings import tool_tips, viewport_settings
from .core import scene, nodes, templates, utilities
from .core import scene, nodes, templates, utilities, validations
from .ui import view_3d, node_editor, addon_preferences, exporter


bl_info = {
"name": "UE to Rigify",
"author": "Epic Games Inc.",
"description": "Allows you to drive a given rig and its animations with a Rigify rig.",
"version": (1, 6, 1),
"version": (1, 6, 2),
"blender": (3, 3, 0),
"location": "3D View > Tools > UE to Rigify",
"wiki_url": "https://epicgames.github.io/BlenderTools/ue2rigify",
Expand All @@ -35,7 +35,8 @@
properties,
node_editor,
addon_preferences,
viewport_settings
viewport_settings,
validations
]


Expand Down
63 changes: 33 additions & 30 deletions ue2rigify/core/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import importlib

from ..constants import Modes, Collections, Rigify, Template
from . import nodes, utilities, templates
from . import nodes, utilities, templates, validations
from ..ui import view_3d, node_editor
from ..settings.tool_tips import *
from ..settings.viewport_settings import *
Expand Down Expand Up @@ -1599,7 +1599,6 @@ def convert_to_control_rig(properties):
)



def switch_modes(self=None, context=None):
"""
Called every time the mode enumeration dropdown is updated.
Expand All @@ -1609,44 +1608,48 @@ def switch_modes(self=None, context=None):
"""
properties = bpy.context.scene.ue2rigify

# save the current context
utilities.save_context(properties)
# only switch modes if validations pass
validation_manager = validations.ValidationManager(properties)
if validation_manager.run():

# save the metarig
save_meta_rig(properties)
# save the current context
utilities.save_context(properties)

# save and remove the nodes
save_rig_nodes(properties)
# save the metarig
save_meta_rig(properties)

# save metadata
save_metadata(properties)
# save and remove the nodes
save_rig_nodes(properties)

# revert to the source rig
revert_to_source_rig(properties)
# save metadata
save_metadata(properties)

# restore the source mode viewport settings
utilities.restore_viewport_settings()
# revert to the source rig
revert_to_source_rig(properties)

# set the previous mode to the current mode
properties.previous_mode = properties.selected_mode
# restore the source mode viewport settings
utilities.restore_viewport_settings()

# set the template files to the previous mode
templates.set_template_files(properties)
# set the previous mode to the current mode
properties.previous_mode = properties.selected_mode

if properties.selected_mode == Modes.METARIG.name:
edit_meta_rig_template(properties)
# set the template files to the previous mode
templates.set_template_files(properties)

if properties.selected_mode == Modes.FK_TO_SOURCE.name:
edit_fk_to_source_nodes(properties)
if properties.selected_mode == Modes.METARIG.name:
edit_meta_rig_template(properties)

if properties.selected_mode == Modes.SOURCE_TO_DEFORM.name:
edit_source_to_deform_nodes(properties)
if properties.selected_mode == Modes.FK_TO_SOURCE.name:
edit_fk_to_source_nodes(properties)

if properties.selected_mode == Modes.CONTROL.name:
convert_to_control_rig(properties)
if properties.selected_mode == Modes.SOURCE_TO_DEFORM.name:
edit_source_to_deform_nodes(properties)

if properties.selected_mode == Modes.CONTROL.name:
convert_to_control_rig(properties)

# clear the undo history
utilities.clear_undo_history()
# clear the undo history
utilities.clear_undo_history()

# restore the context
utilities.load_context(properties)
# restore the context
utilities.load_context(properties)
Loading

0 comments on commit e46075c

Please sign in to comment.