unitytk 0.0.11__tar.gz → 0.0.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unitytk-0.0.11/unitytk.egg-info → unitytk-0.0.12}/PKG-INFO +1 -1
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_render_opacity_e2e.py +14 -13
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_shared_material_standalone.py +26 -27
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/__init__.py +1 -1
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/RenderEffectsController.cs +1 -1
- {unitytk-0.0.11 → unitytk-0.0.12/unitytk.egg-info}/PKG-INFO +1 -1
- {unitytk-0.0.11 → unitytk-0.0.12}/LICENSE +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/MANIFEST.in +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/docs/README.md +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/pyproject.toml +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/setup.cfg +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_asset_delivery.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_audio_events_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_base_test.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_bool_to_fade_curve.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_clip_name_contract_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_controller_runtime_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_deploy_templates.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_emissive_groups_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_fade_window_preservation.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_keyed_visibility.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_launcher.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_lightmap_metadata_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_multi_section_audio_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_render_effects_e2e.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_render_opacity_controller.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_render_opacity_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_run_tests.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_scene_builder.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_shadow_plane_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_shadow_plane_runtime_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_shot_metadata_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_shots_audio_sidebyside_integration.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_standalone_enduser.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/test/test_temp_projects.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/asset_delivery.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/launcher.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/scene_builder.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/template_deployer.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/AudioEventController.cs +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/EmissiveGroupController.cs +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/EmissiveGroups.hlsl +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/EmissiveGroupsLit.shader +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/LightmapMetadataController.cs +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/M3trik.Unitytk.asmdef +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/README.md +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/ShadowPlane.shader +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/ShadowPlaneController.cs +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/ShadowPlaneHorizon.hlsl +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/ShotMetadataController.cs +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/UnitytkSettings.cs +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk/templates/__init__.py +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk.egg-info/SOURCES.txt +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk.egg-info/dependency_links.txt +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk.egg-info/requires.txt +0 -0
- {unitytk-0.0.11 → unitytk-0.0.12}/unitytk.egg-info/top_level.txt +0 -0
|
@@ -11,8 +11,8 @@ curve values, reimport idempotency).
|
|
|
11
11
|
Pipeline:
|
|
12
12
|
1. Maya (mayapy): build a cube + 'opacity' attr, key opacity in a
|
|
13
13
|
4-key fade-in/hold/fade-out pattern, call
|
|
14
|
-
:meth:`RenderOpacity.prepare_for_export` to
|
|
15
|
-
export FBX.
|
|
14
|
+
:meth:`RenderOpacity.prepare_for_export` to stage the curve proxy
|
|
15
|
+
(nothing keys visibility), export FBX.
|
|
16
16
|
2. Unity (batchmode): deploy ``UnitytkSettings.cs`` (the shared
|
|
17
17
|
ImportGate/CarrierImport home), ``RenderEffectsController.cs`` and
|
|
18
18
|
``AudioEventController.cs``. Import the FBX. Verify:
|
|
@@ -65,7 +65,7 @@ def _unity_available() -> bool:
|
|
|
65
65
|
# ======================================================================
|
|
66
66
|
|
|
67
67
|
MAYA_EXPORT_SCRIPT = r'''
|
|
68
|
-
"""Executed inside mayapy — keys opacity,
|
|
68
|
+
"""Executed inside mayapy — keys opacity, stages the curve proxy, exports FBX."""
|
|
69
69
|
import sys, os, json
|
|
70
70
|
|
|
71
71
|
# mayatk/pythontk repo roots arrive via PYTHONPATH set by the parent test.
|
|
@@ -97,11 +97,12 @@ cmds.setKeyframe(cube, attribute="opacity", time=140, value=0.0) # faded out
|
|
|
97
97
|
|
|
98
98
|
assert cmds.attributeQuery("opacity", node=str(cube), exists=True)
|
|
99
99
|
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
#
|
|
100
|
+
# Stage the curve-proxy transport: a fade_cube__opacity child carries the
|
|
101
|
+
# opacity curve on scale.x, which the importer rebinds to the controller
|
|
102
|
+
# (Unity flattens animated custom properties onto the root). Nothing keys
|
|
103
|
+
# visibility: presence is derived from the authored opacity downstream.
|
|
104
104
|
synced = RenderOpacity.prepare_for_export(objects=[cube])
|
|
105
|
+
proxies = cmds.ls("*__opacity") or []
|
|
105
106
|
|
|
106
107
|
vis_keys = cmds.keyframe(cube, attribute="visibility", q=True, tc=True) or []
|
|
107
108
|
opa_keys = cmds.keyframe(cube, attribute="opacity", q=True, tc=True) or []
|
|
@@ -127,6 +128,7 @@ results = {
|
|
|
127
128
|
"opacity_keys": opa_keys,
|
|
128
129
|
"visibility_keys": vis_keys,
|
|
129
130
|
"synced_objects": synced,
|
|
131
|
+
"proxies": proxies,
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
with open(os.path.join(output_dir, "maya_results.json"), "w") as f:
|
|
@@ -407,7 +409,7 @@ class TestRenderOpacityE2E(unittest.TestCase):
|
|
|
407
409
|
|
|
408
410
|
@MayaEnv.skip_unless_available()
|
|
409
411
|
def test_01_maya_export(self):
|
|
410
|
-
"""Author opacity,
|
|
412
|
+
"""Author opacity, stage the curve proxy via prepare_for_export, export FBX."""
|
|
411
413
|
script_path = os.path.join(self.temp_dir, "maya_export.py")
|
|
412
414
|
with open(script_path, "w", encoding="utf-8") as f:
|
|
413
415
|
f.write(MAYA_EXPORT_SCRIPT)
|
|
@@ -444,12 +446,11 @@ class TestRenderOpacityE2E(unittest.TestCase):
|
|
|
444
446
|
r = self.__class__.maya_results
|
|
445
447
|
self.__class__.fbx_path = r["fbx_path"]
|
|
446
448
|
self.assertTrue(r["fbx_exists"])
|
|
447
|
-
# prepare_for_export
|
|
448
|
-
self.
|
|
449
|
-
|
|
450
|
-
0,
|
|
451
|
-
"prepare_for_export should have synced visibility keys",
|
|
449
|
+
# prepare_for_export stages the curve proxy and keys no visibility
|
|
450
|
+
self.assertTrue(
|
|
451
|
+
r["proxies"], "prepare_for_export should have staged the opacity proxy"
|
|
452
452
|
)
|
|
453
|
+
self.assertEqual(r["visibility_keys"], [], "no visibility mirror is written")
|
|
453
454
|
# The opacity keys should match what we authored
|
|
454
455
|
opa_set = {int(round(t)) for t in r["opacity_keys"]}
|
|
455
456
|
self.assertEqual(opa_set, {1, 20, 100, 140})
|
|
@@ -128,13 +128,12 @@ for i, obj in enumerate(objects):
|
|
|
128
128
|
cmds.setKeyframe(obj, attribute="opacity", time=end, value=0.0)
|
|
129
129
|
cmds.setKeyframe(obj, attribute="opacity", time=60, value=0.0)
|
|
130
130
|
|
|
131
|
-
# --
|
|
132
|
-
#
|
|
133
|
-
#
|
|
134
|
-
#
|
|
135
|
-
#
|
|
136
|
-
#
|
|
137
|
-
# scene-exporter calls this in its pre-export hook).
|
|
131
|
+
# -- Stage the curve-proxy transport before export (REQUIRED) --
|
|
132
|
+
# Unity collapses all same-named "opacity" custom-property curves onto the root
|
|
133
|
+
# Animator with empty paths, so each object's curve travels on a transient
|
|
134
|
+
# <leaf>__opacity child's scale.x, which the importer rebinds to that object's
|
|
135
|
+
# RenderEffectsController.opacity. prepare_for_export stages them (the production
|
|
136
|
+
# export bracket calls it); nothing keys visibility.
|
|
138
137
|
RenderOpacity.prepare_for_export(objects)
|
|
139
138
|
|
|
140
139
|
# -- Verify setup before export --
|
|
@@ -142,8 +141,8 @@ for obj in objects:
|
|
|
142
141
|
assert cmds.attributeQuery("opacity", node=str(obj), exists=True), f"{obj} missing opacity attr"
|
|
143
142
|
curves = cmds.listConnections(f"{obj}.opacity", type="animCurve")
|
|
144
143
|
assert curves, f"{obj} has no animation curve on opacity"
|
|
145
|
-
|
|
146
|
-
assert
|
|
144
|
+
leaf = str(obj).split("|")[-1]
|
|
145
|
+
assert cmds.ls(f"{leaf}__opacity"), f"{obj} has no curve proxy (prepare_for_export failed)"
|
|
147
146
|
|
|
148
147
|
# -- Export FBX --
|
|
149
148
|
cmds.select(objects)
|
|
@@ -163,8 +162,8 @@ results = {
|
|
|
163
162
|
"fbx_exists": os.path.exists(fbx_path),
|
|
164
163
|
"object_names": [str(o).split("|")[-1] for o in objects],
|
|
165
164
|
"all_have_opacity": all(cmds.attributeQuery("opacity", node=str(o), exists=True) for o in objects),
|
|
166
|
-
"
|
|
167
|
-
cmds.
|
|
165
|
+
"all_have_curve_proxies": all(
|
|
166
|
+
cmds.ls(str(o).split("|")[-1] + "__opacity") for o in objects
|
|
168
167
|
),
|
|
169
168
|
}
|
|
170
169
|
with open(os.path.join(output_dir, "maya_results.json"), "w") as f:
|
|
@@ -458,12 +457,11 @@ class TestSharedMaterialStandalone(unittest.TestCase):
|
|
|
458
457
|
fbx_path = mr["fbx_path"]
|
|
459
458
|
self.assertTrue(mr["fbx_exists"], "FBX not created")
|
|
460
459
|
self.assertTrue(mr["all_have_opacity"], "Not all objects have opacity attr")
|
|
461
|
-
#
|
|
462
|
-
# curve from — without it the import yields zero opacity curves.
|
|
460
|
+
# The curve proxy is what carries each object's opacity curve to Unity.
|
|
463
461
|
self.assertTrue(
|
|
464
|
-
mr["
|
|
465
|
-
"Not all objects have
|
|
466
|
-
"
|
|
462
|
+
mr["all_have_curve_proxies"],
|
|
463
|
+
"Not all objects have a curve proxy -- RenderOpacity.prepare_for_export "
|
|
464
|
+
"did not stage the transport; Unity will import 0 curves",
|
|
467
465
|
)
|
|
468
466
|
self.assertEqual(
|
|
469
467
|
len(mr["object_names"]),
|
|
@@ -487,20 +485,21 @@ class TestSharedMaterialStandalone(unittest.TestCase):
|
|
|
487
485
|
for name in OBJECT_NAMES:
|
|
488
486
|
self.assertIn(name, fbx_content, f"Object '{name}' missing from FBX")
|
|
489
487
|
|
|
490
|
-
# The
|
|
491
|
-
#
|
|
492
|
-
#
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
f"
|
|
488
|
+
# The curve proxy is what carries each object's opacity curve to Unity
|
|
489
|
+
# (the importer rebinds its scale.x to RenderEffectsController.opacity).
|
|
490
|
+
# Assert one per object is in the FBX, so a regression is caught here,
|
|
491
|
+
# before the costly Unity launch.
|
|
492
|
+
proxies = re.findall(r'"Model::(\w+)__opacity"', fbx_content)
|
|
493
|
+
self.assertEqual(
|
|
494
|
+
sorted(set(proxies)),
|
|
495
|
+
sorted(OBJECT_NAMES),
|
|
496
|
+
f"FBX carries opacity curve proxies for {sorted(set(proxies))}, "
|
|
497
|
+
f"expected {sorted(OBJECT_NAMES)}",
|
|
499
498
|
)
|
|
500
499
|
|
|
501
500
|
logger.info(
|
|
502
501
|
f"Maya export OK: {len(opacity_props)} opacity props, "
|
|
503
|
-
f"{len(
|
|
502
|
+
f"{len(set(proxies))} curve proxies, {len(OBJECT_NAMES)} objects"
|
|
504
503
|
)
|
|
505
504
|
|
|
506
505
|
# === Step 2: Create Unity project ===
|
|
@@ -662,7 +661,7 @@ class TestSharedMaterialStandalone(unittest.TestCase):
|
|
|
662
661
|
# Reimport idempotency
|
|
663
662
|
ri_oc = r.get("reimport_opacity_controllers", -1)
|
|
664
663
|
ri_curves = r.get("reimport_opacity_curves", -1)
|
|
665
|
-
print(
|
|
664
|
+
print(" Reimport idempotency:")
|
|
666
665
|
print(f" Controllers: {oc} -> {ri_oc}")
|
|
667
666
|
print(f" Curves: {curves} -> {ri_curves}")
|
|
668
667
|
self.assertEqual(
|
|
@@ -56,7 +56,7 @@ public class RenderEffectsController : MonoBehaviour
|
|
|
56
56
|
public float highlight = 0f;
|
|
57
57
|
|
|
58
58
|
[Tooltip("The DCC 'highlightColor' attribute (linear).")]
|
|
59
|
-
public Color highlightColor = new Color(0.
|
|
59
|
+
public Color highlightColor = new Color(0f, 0.088656f, 0.723055f, 1f);
|
|
60
60
|
|
|
61
61
|
[Tooltip("Shader color property whose alpha channel is overridden " +
|
|
62
62
|
"(e.g. _BaseColor for URP/HDRP, _Color for Built-in).")]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|