Source code for cgl.pathlib
from __future__ import annotations
from cgl.pathlib.core.base import PathObject as _Base
from cgl.pathlib.mixins.config import ConfigMixin
from cgl.pathlib.mixins.copy import CopyMixin
from cgl.pathlib.mixins.msd import MSDMixin
from cgl.pathlib.mixins.parsing import ParsingMixin
from cgl.pathlib.mixins.publish import PublishMixin
from cgl.pathlib.mixins.rendering import RenderingMixin
from cgl.pathlib.mixins.thumbs import ThumbsMixin
from cgl.pathlib.mixins.ue import UEMixin
from cgl.pathlib.mixins.validation import ValidationMixin
from cgl.pathlib.mixins.versioning import VersioningMixin
from cgl.pathlib.core.pathmap import get_unc_path
from cgl.pathlib.sequence_model import Sequence
[docs]
class PathObject(
ConfigMixin,
ValidationMixin,
ParsingMixin,
CopyMixin,
UEMixin,
ThumbsMixin,
RenderingMixin,
PublishMixin,
VersioningMixin,
MSDMixin,
_Base,
):
"""Stable, public PathObject surface."""
pass
# If you don't have ConfigMixin yet, just remove it from the list above.
PO = PathObject()
__all__ = ["PathObject",
"PO",
"get_unc_path",
"Sequence"]
if __name__ == "__main__":
# For testing purposes, you can run this module directly.
p = r"C:\alc\p4v\CGL\JLT\PERFORCE\assets\assets.uproject"
# p = r"C:\alc\p4v\JHCS\jcma\PERFORCE\asset_world\asset_world.uproject"
ue_path = r"C:\alc\p4v\CGL\JLT\PERFORCE\assets\assets.uproject"
asset_path = (
r"/Game/assets/drs/tree/mdl/default/drs_tree_mdl/drs_tree_mdl.drs_tree_mdl"
)
po = PathObject.from_path_string(asset_path) # auto-detects UE
# po.copy()
# apo = po.copy_from_ue_path(asset_path)
# assert po.ue_path is True
# assert po.company == "JHCS"
# assert po.project == "jcma"
# assert po.world == "asset_world"
# assert po.ue_root.endswith(r"alc\p4v")
# print(po.get_path()) # backslashes path to the world (and filename if set)
# print(po.get_preview_path()) # /Game/... if content is present
# print(po.get_path())