mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Fix for the workflow between Blender and Unreal for OpenPype 3.0
This commit is contained in:
parent
16d4e9f0c7
commit
5a1889e413
7 changed files with 22 additions and 9 deletions
|
|
@ -6,7 +6,7 @@ class PrePython2Vendor(PreLaunchHook):
|
|||
"""Prepend python 2 dependencies for py2 hosts."""
|
||||
# WARNING This hook will probably be deprecated in OpenPype 3 - kept for test
|
||||
order = 10
|
||||
app_groups = ["hiero", "nuke", "nukex"]
|
||||
app_groups = ["hiero", "nuke", "nukex", "unreal"]
|
||||
|
||||
def execute(self):
|
||||
# Prepare vendor dir path
|
||||
|
|
|
|||
|
|
@ -51,9 +51,18 @@ def set_start_end_frames():
|
|||
"name": asset_name
|
||||
})
|
||||
|
||||
bpy.context.scene.frame_start = asset_doc["data"]["frameStart"]
|
||||
bpy.context.scene.frame_end = asset_doc["data"]["frameEnd"]
|
||||
# Default frame start/end
|
||||
frameStart = 0
|
||||
frameEnd = 100
|
||||
|
||||
# Check if frameStart/frameEnd are set
|
||||
if asset_doc["data"]["frameStart"]:
|
||||
frameStart = asset_doc["data"]["frameStart"]
|
||||
if asset_doc["data"]["frameEnd"]:
|
||||
frameEnd = asset_doc["data"]["frameEnd"]
|
||||
|
||||
bpy.context.scene.frame_start = frameStart
|
||||
bpy.context.scene.frame_end = frameEnd
|
||||
|
||||
def on_new(arg1, arg2):
|
||||
set_start_end_frames()
|
||||
|
|
|
|||
|
|
@ -292,6 +292,9 @@ class UnrealLayoutLoader(plugin.AssetLoader):
|
|||
icon = "code-fork"
|
||||
color = "orange"
|
||||
|
||||
animation_creator_name = "CreateAnimation"
|
||||
setdress_creator_name = "CreateSetDress"
|
||||
|
||||
def _remove_objects(self, objects):
|
||||
for obj in list(objects):
|
||||
if obj.type == 'ARMATURE':
|
||||
|
|
@ -368,7 +371,7 @@ class UnrealLayoutLoader(plugin.AssetLoader):
|
|||
location.get('z')
|
||||
)
|
||||
obj.rotation_euler = (
|
||||
rotation.get('x'),
|
||||
rotation.get('x') + math.pi / 2,
|
||||
-rotation.get('y'),
|
||||
-rotation.get('z')
|
||||
)
|
||||
|
|
|
|||
0
openpype/hosts/unreal/__init__.py
Normal file
0
openpype/hosts/unreal/__init__.py
Normal file
|
|
@ -23,8 +23,8 @@ class UnrealPrelaunchHook(PreLaunchHook):
|
|||
def execute(self):
|
||||
asset_name = self.data["asset_name"]
|
||||
task_name = self.data["task_name"]
|
||||
workdir = self.env["AVALON_WORKDIR"]
|
||||
engine_version = self.app_name.split("_")[-1]
|
||||
workdir = self.launch_context.env["AVALON_WORKDIR"]
|
||||
engine_version = self.app_name.split("_")[-1].replace("-", ".")
|
||||
unreal_project_name = f"{asset_name}_{task_name}"
|
||||
|
||||
# Unreal is sensitive about project names longer then 20 chars
|
||||
|
|
@ -81,8 +81,8 @@ class UnrealPrelaunchHook(PreLaunchHook):
|
|||
# Set "AVALON_UNREAL_PLUGIN" to current process environment for
|
||||
# execution of `create_unreal_project`
|
||||
env_key = "AVALON_UNREAL_PLUGIN"
|
||||
if self.env.get(env_key):
|
||||
os.environ[env_key] = self.env[env_key]
|
||||
if self.launch_context.env.get(env_key):
|
||||
os.environ[env_key] = self.launch_context.env[env_key]
|
||||
|
||||
unreal_lib.create_unreal_project(
|
||||
unreal_project_name,
|
||||
|
|
|
|||
|
|
@ -1123,6 +1123,7 @@ class BuildWorkfile:
|
|||
return output
|
||||
|
||||
|
||||
@with_avalon
|
||||
def get_creator_by_name(creator_name, case_sensitive=False):
|
||||
"""Find creator plugin by name.
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class PrePython2Support(PreLaunchHook):
|
|||
Path to vendor modules is added to the beggining of PYTHONPATH.
|
||||
"""
|
||||
# There will be needed more granular filtering in future
|
||||
app_groups = ["maya", "nuke", "nukex", "hiero", "nukestudio"]
|
||||
app_groups = ["maya", "nuke", "nukex", "hiero", "nukestudio", "unreal"]
|
||||
|
||||
def execute(self):
|
||||
# Prepare vendor dir path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue