unitytk 0.2.0__tar.gz → 0.2.1__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.2.0/unitytk.egg-info → unitytk-0.2.1}/PKG-INFO +1 -1
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_asset_delivery.py +25 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_run_tests.py +5 -2
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/__init__.py +1 -1
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/asset_delivery.py +19 -2
- {unitytk-0.2.0 → unitytk-0.2.1/unitytk.egg-info}/PKG-INFO +1 -1
- {unitytk-0.2.0 → unitytk-0.2.1}/LICENSE +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/MANIFEST.in +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/docs/README.md +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/pyproject.toml +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/setup.cfg +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_articulated_rig_runtime.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_audio_events_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_base_test.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_blender_render_effects_e2e.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_blender_shadow_plane_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_blender_shot_metadata_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_bool_to_fade_curve.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_clip_name_contract_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_controller_runtime_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_deploy_templates.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_embedded_dependencies_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_emissive_groups_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_fade_window_preservation.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_keyed_visibility.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_launcher.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_lightmap_metadata_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_maya_surface_materials_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_multi_section_audio_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_render_effects_e2e.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_render_opacity_controller.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_render_opacity_e2e.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_render_opacity_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_scene_builder.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_shadow_plane_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_shadow_plane_runtime_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_shared_material_standalone.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_shot_metadata_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_shots_audio_sidebyside_integration.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_standalone_enduser.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/test/test_temp_projects.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/launcher.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/scene_builder.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/template_deployer.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulatedRigController.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulatedRigController.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulatedRigPointerGrab.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulatedRigPointerGrab.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulationRecord.g.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulationRecord.g.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/ArticulatedRigXRGrab.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/ArticulatedRigXRGrab.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/ArticulatedRigXRSetup.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/ArticulatedRigXRSetup.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/M3trik.Unitytk.XR.asmdef +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/M3trik.Unitytk.XR.asmdef.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/AudioEvent/AudioEventController.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/AudioEvent/AudioEventController.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/AudioEvent.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/EmissiveGroup/EmissiveGroupController.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/EmissiveGroup/EmissiveGroupController.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/EmissiveGroup/EmissiveGroups.hlsl +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/EmissiveGroup/EmissiveGroups.hlsl.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/EmissiveGroup/EmissiveGroupsLit.shader +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/EmissiveGroup/EmissiveGroupsLit.shader.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/EmissiveGroup.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/LightmapMetadata/LightmapMetadataController.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/LightmapMetadata/LightmapMetadataController.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/LightmapMetadata.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/M3trik.Unitytk.asmdef +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/M3trik.Unitytk.asmdef.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/MayaSurface/MayaSurfaceMaterialImporter.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/MayaSurface/MayaSurfaceMaterialImporter.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/MayaSurface.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/README.md +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/README.md.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/RenderEffects/RenderEffectsController.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/RenderEffects/RenderEffectsController.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/RenderEffects.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShadowPlane/ShadowPlane.shader +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShadowPlane/ShadowPlane.shader.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShadowPlane/ShadowPlaneController.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShadowPlane/ShadowPlaneController.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShadowPlane/ShadowPlaneHorizon.hlsl +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShadowPlane/ShadowPlaneHorizon.hlsl.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShadowPlane.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShotMetadata/ShotMetadataController.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShotMetadata/ShotMetadataController.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShotMetadata.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/UnitytkSettings.cs +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/UnitytkSettings.cs.meta +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/__init__.py +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk.egg-info/SOURCES.txt +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk.egg-info/dependency_links.txt +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk.egg-info/requires.txt +0 -0
- {unitytk-0.2.0 → unitytk-0.2.1}/unitytk.egg-info/top_level.txt +0 -0
|
@@ -160,6 +160,31 @@ class DeliveryTest(unittest.TestCase):
|
|
|
160
160
|
self.assertEqual(open(dest, "rb").read(), b"FBX-BYTES")
|
|
161
161
|
self.assertFalse(result["launched"])
|
|
162
162
|
|
|
163
|
+
def test_a_copy_cut_short_never_replaces_the_asset_unity_reads(self):
|
|
164
|
+
"""The copy lands whole or not at all (``ptk.FileUtils.atomic_write``):
|
|
165
|
+
a copy into the project cut short (a full disk, a sync client holding
|
|
166
|
+
the file) left Unity a truncated FBX under the asset's own name.
|
|
167
|
+
Added: 2026-10-13"""
|
|
168
|
+
from unittest import mock
|
|
169
|
+
|
|
170
|
+
import unitytk.asset_delivery as delivery
|
|
171
|
+
|
|
172
|
+
dest = os.path.join(self.project, "Assets", "Models", "Robot.fbx")
|
|
173
|
+
os.makedirs(os.path.dirname(dest))
|
|
174
|
+
with open(dest, "wb") as fh:
|
|
175
|
+
fh.write(b"OLD")
|
|
176
|
+
|
|
177
|
+
def cut_short(src, dst, *args, **kwargs):
|
|
178
|
+
with open(dst, "wb") as fh:
|
|
179
|
+
fh.write(b"HALF")
|
|
180
|
+
raise OSError(28, "No space left on device")
|
|
181
|
+
|
|
182
|
+
with mock.patch.object(delivery.shutil, "copy2", side_effect=cut_short):
|
|
183
|
+
self._deliver({"ASSETS_SUBDIR": "Models"}, default_name="Robot")
|
|
184
|
+
with open(dest, "rb") as fh:
|
|
185
|
+
self.assertEqual(fh.read(), b"OLD")
|
|
186
|
+
self.assertEqual(os.listdir(os.path.dirname(dest)), ["Robot.fbx"])
|
|
187
|
+
|
|
163
188
|
def test_deliver_uses_default_subdir_and_asset_name(self):
|
|
164
189
|
_bridge, result = self._deliver({}, default_name="Cube")
|
|
165
190
|
self.assertEqual(
|
|
@@ -519,8 +519,11 @@ class ChildSettingsSandboxTest(unittest.TestCase):
|
|
|
519
519
|
with mock.patch.dict(os.environ, env, clear=True):
|
|
520
520
|
UnityTestRunner.sandbox_children(self.root)
|
|
521
521
|
armed = os.environ.copy()
|
|
522
|
-
# As in a run: TEMP
|
|
523
|
-
|
|
522
|
+
# As in a run: TEMP and pythontk's own root (read first, since
|
|
523
|
+
# pythontk 0.15.0) name the run's root, which the stores nest in.
|
|
524
|
+
armed.update(
|
|
525
|
+
TEMP=self.root, TMP=self.root, TMPDIR=self.root, PYTHONTK_TEMP_ROOT=self.root
|
|
526
|
+
)
|
|
524
527
|
armed.pop("PYTHONTK_TEST_TEMP_ROOT", None)
|
|
525
528
|
scripts = pathlib.Path(__file__).resolve().parents[2]
|
|
526
529
|
armed["PYTHONPATH"] = os.pathsep.join(str(scripts / pkg) for pkg in packages)
|
|
@@ -156,7 +156,7 @@ class CopyToAssetsDeliverer(ptk.Deliverer):
|
|
|
156
156
|
OSError: The copy failed.
|
|
157
157
|
"""
|
|
158
158
|
if not ptk.FbxFile.is_fbx(source):
|
|
159
|
-
|
|
159
|
+
CopyToAssetsDeliverer._place(source, dest)
|
|
160
160
|
return
|
|
161
161
|
hook = getattr(bridge, "lightmap_search_dirs", None)
|
|
162
162
|
try:
|
|
@@ -181,10 +181,27 @@ class CopyToAssetsDeliverer(ptk.Deliverer):
|
|
|
181
181
|
"exported."
|
|
182
182
|
)
|
|
183
183
|
report = None
|
|
184
|
-
|
|
184
|
+
CopyToAssetsDeliverer._place(
|
|
185
|
+
staged if report and report["embedded"] else source, dest
|
|
186
|
+
)
|
|
185
187
|
finally:
|
|
186
188
|
scratch.cleanup()
|
|
187
189
|
|
|
190
|
+
@staticmethod
|
|
191
|
+
def _place(source: str, dest: str) -> None:
|
|
192
|
+
"""Copy *source* to *dest* whole or not at all.
|
|
193
|
+
|
|
194
|
+
Through a ``.part`` beside *dest*, promoted once complete
|
|
195
|
+
(``ptk.FileUtils.atomic_write``): a copy cut short -- a full disk, a
|
|
196
|
+
sync client holding the file -- leaves the asset Unity already
|
|
197
|
+
imported as it was, never a truncated FBX under its name. *source* is
|
|
198
|
+
only read (it may be the user's own file).
|
|
199
|
+
|
|
200
|
+
Raises:
|
|
201
|
+
OSError: The copy failed; *dest* is untouched.
|
|
202
|
+
"""
|
|
203
|
+
ptk.FileUtils.atomic_write(dest, lambda part: shutil.copy2(source, part))
|
|
204
|
+
|
|
188
205
|
@staticmethod
|
|
189
206
|
def sanitize_asset_name(name: str) -> str:
|
|
190
207
|
"""Return *name* reduced to a safe Unity asset filename stem.
|
|
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
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulatedRigController.cs
RENAMED
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulatedRigController.cs.meta
RENAMED
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulatedRigPointerGrab.cs
RENAMED
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulatedRigPointerGrab.cs.meta
RENAMED
|
File without changes
|
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/ArticulationRecord.g.cs.meta
RENAMED
|
File without changes
|
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/ArticulatedRigXRGrab.cs.meta
RENAMED
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/ArticulatedRigXRSetup.cs
RENAMED
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/ArticulatedRigXRSetup.cs.meta
RENAMED
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/M3trik.Unitytk.XR.asmdef
RENAMED
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ArticulatedRig/XR/M3trik.Unitytk.XR.asmdef.meta
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/EmissiveGroup/EmissiveGroupController.cs.meta
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/EmissiveGroup/EmissiveGroupsLit.shader.meta
RENAMED
|
File without changes
|
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/LightmapMetadata/LightmapMetadataController.cs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/MayaSurface/MayaSurfaceMaterialImporter.cs
RENAMED
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/MayaSurface/MayaSurfaceMaterialImporter.cs.meta
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/RenderEffects/RenderEffectsController.cs.meta
RENAMED
|
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
|
{unitytk-0.2.0 → unitytk-0.2.1}/unitytk/templates/ShotMetadata/ShotMetadataController.cs.meta
RENAMED
|
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
|