{"id":21713736,"url":"https://github.com/blurstudio/cross3d","last_synced_at":"2025-07-14T04:33:59.646Z","repository":{"id":50901281,"uuid":"63918794","full_name":"blurstudio/cross3d","owner":"blurstudio","description":"A python module provides a consistent interface to multiple DCC application api.","archived":false,"fork":false,"pushed_at":"2017-10-28T22:12:39.000Z","size":2057,"stargazers_count":139,"open_issues_count":2,"forks_count":32,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-06-09T17:14:56.435Z","etag":null,"topics":["3dsmax","maya","softimage"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blurstudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-22T02:58:09.000Z","updated_at":"2025-01-27T08:31:15.000Z","dependencies_parsed_at":"2022-09-24T23:02:49.932Z","dependency_job_id":null,"html_url":"https://github.com/blurstudio/cross3d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blurstudio/cross3d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blurstudio%2Fcross3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blurstudio%2Fcross3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blurstudio%2Fcross3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blurstudio%2Fcross3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blurstudio","download_url":"https://codeload.github.com/blurstudio/cross3d/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blurstudio%2Fcross3d/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265240553,"owners_count":23733054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3dsmax","maya","softimage"],"created_at":"2024-11-26T00:20:06.434Z","updated_at":"2025-07-14T04:33:59.625Z","avatar_url":"https://github.com/blurstudio.png","language":"Python","funding_links":[],"categories":["Game-Design-Tool","Libraries","Tools, Pipeline \u0026 Utilities"],"sub_categories":["CG Software API","Scene \u0026 Pipeline Tools"],"readme":"# Cross3d\nA python implementation of commands that work in multiple programs(Studiomax, Softimage).\nIt utilizes a abstract definition of commands, and a software specific implementation of those commands.\n\n# Package Overview\n## cross3d\nThe majority of classes used by scripters in cross3d are directly inside the cross3d module. \n### cross3d.Scene\nUsed to access information about the current scene. Create as many instances of this class as needed.\n### cross3d.application\nUsed to access information about the current application(application name, version, etc). Instance of `cross3d.Application`. Do not manually create a new instance of cross3d.Application.\n### cross3d.dispatch\nUsed to monitor the DCC for callbacks. It automatically connects/disconnects to the DCCs callback mechanism so if a callback is not used it will not cause extra overhead(depending on the DCC). Instance of `cross3d.Dispatch`. Do not manually create a new instance of cross3d.Dispatch.\n### cross3d.constants\nThis class contains enumerators used in cross3d. Instead of passing string objects as identifiers to functions these enumerators are passed.\n### cross3d.external\nThis class is used to lookup install paths for and to run scripts in DCCs regardless of what DCC or lack of a DCC python is currently running in.\n## cross3d.migrate\nThis module is being used to migrate blur pipeline specific functionality from our pipeline. Most of the contents of this module will probably be removed.\n## cross3d.classes\nThis module contains classes that do not need software specific overrides. You should not directly use these classes. The classes that are used by scripters will be available directly from cross3d. `cross3d.FileSequence` for example.\n## DCC Specific implementations\nThese modules are the core of how cross3d works. cross3d.abstract is defines how scripters work with the api and all DCC specific implementations must subclass from inside abstract.\n## cross3d.abstract\nThis module defines the generic structure of the cross3d classes. All software specific implementations inherit from classes in this module. If cross3d is imported in a standard python interpreter(outside of a DCC) these modules should import without error. If a one of these classes is not defined for a specific DCC the class defined inside this module will be used.\nAt the bottom of most of the python files inside this folder you will see code similar to this:\n```python\n# register the symbol\ncross3d.registerSymbol('Scene', AbstractScene, ifNotFound=True)\n```\nThis code is used to store the AbstractScene class(`cross3d.abstract.abstractscene.AbstractScene`) in the official cross3d name of `cross3d.Scene`. 'ifNotFound=True'  should only be used in the abstract module. It tells registerSymbol to only register this class if a subclass hasn't already registered for that class.\n## cross3d.maya, cross3d.motionbuilder, cross3d.studiomax, etc\nThese modules subclass from cross3d.abstract. Not everything in cross3d.abstract needs to be implemented for cross3d to function in a DCC. Any changes to public methods must be reflected in all of these modules and cross3d.abstract to maintain the cross DCC integration.\n\nAt the bottom of most of the python files inside this folder you will see code similar to this:\n```python\n# register the symbol\ncross3d.registerSymbol('Scene', StudiomaxScene)\n```\nThis code is used to store the StudiomaxScene class(`cross3d.studiomax.studiomaxscene.StudiomaxScene`) in the official cross3d name of `cross3d.Scene`.\n\n# Additional packages\n* Currently `PyQt4` is required for cross3d.\n* `cross3d.FCurve` requires `numpy`\n\nDepending on the DCC some additional modules are needed. These are documented in the DCC's readme.md file.\ncross3d.FileSequence has a few methods that use ffmpeg. Currently you can pass the path to ffmpeg as a argument to these functions. By default it assumes that ffmpeg is in the path variable.\n# Examples\nGet objects in a scene:\n```python\nfrom cross3d import Scene\nscene = Scene()\nfor obj in scene.objects():\n\tprint obj\n```\noutput(when run inside 3ds max):\n```python\n\u003cStudiomaxSceneObject (Box001)\u003e\n\u003cStudiomaxSceneObject (Box002)\u003e\n\u003cStudiomaxSceneObject (Sphere001)\u003e\n\u003cStudiomaxSceneObject (Sphere002)\u003e\n\u003cStudiomaxSceneCamera (Camera001)\u003e\n```\nTo get a list of camera's in the scene:\n```python\nfrom cross3d import Scene\nfrom cross3d.constants import ObjectType\nscene = Scene()\nfor obj in scene.objects(type=ObjectType.Camera):\n\tprint obj\n```\noutput(when run inside 3ds max):\n```python\n\u003cStudiomaxSceneCamera (Camera001)\u003e\n```\n\n```python\n\u003e\u003e\u003e sel = scene.selection()[0] # Get the first selected object\n\u003e\u003e\u003e sel.objectType() == ObjectType.Geometry # Check the type of the selection\nTrue\n\u003e\u003e\u003e print 'fps:', scene.animationFPS(), 'Frame Range:', scene.animationRange()\nfps: 30.0 Frame Range: cross3d.FrameRange( 0, 100 )\n\u003e\u003e\u003e scene.currentFileName()\nC:\\Max2016_x64\\3ds Max 2016\\scenes\\cross3d.max\n\u003e\u003e\u003e from blur3d.constants import CameraType\n\u003e\u003e\u003e camera = Scene.createCamera(scene, 'TestCamera', constants.CameraType.Physical)\n\u003e\u003e\u003e camera\n\u003cStudiomaxSceneCamera (TestCamera)\u003e\n```\n### cross3d.external\nThe cross3d.external class allows you to get the installed path for supported DCCs from within any dcc or even outside of a dcc.\n```python\n\u003e\u003e\u003e import cross3d\n\u003e\u003e\u003e cross3d.external('Maya').binariesPath()\nC:\\Program Files\\Autodesk\\Maya2016\\bin\n\u003e\u003e\u003e cross3d.external('Maya').binariesPath(2014)\nC:\\Program Files\\Autodesk\\Maya2014\\bin\n\u003e\u003e\u003e cross3d.external('StudioMax').binariesPath(2012)\nC:\\Max2012_x64\\3ds Max 2012\n\u003e\u003e\u003e cross3d.external('StudioMax').binariesPath(2013) # StudioMax 2013 is not installed on this computer\nTraceback (most recent call last):\n  File \"\u003cstring\u003e\", line 1, in \u003cmodule\u003e\n  File \"c:\\blur\\dev\\local\\code\\python\\lib\\cross3d\\studiomax\\external.py\", line 136, in binariesPath\n    raise Exceptions.SoftwareNotInstalled('Studiomax', version=dispVersion, architecture=architecture, language=language)\ncross3d.classes.exceptions.SoftwareNotInstalled: Studiomax  2013 64-bit not installed for English.\n```\nStart 3ds Max(with interface) and run script(valid filename or text of script)\n```python\ncross3d.external('StudioMax').runScript(script, 2016, headless=False) \n```\n\n## Environment Variables\ncross3d uses environment variables to configure specific settings for module initialization.\n\n### CROSS3D_LOGGING_LEVEL\nSetup logging for the cross3d library. To access the logger object call cross3d.logger. If the environment variable \n\"CROSS3D_LOGGING_LEVEL\" is set a StreamHandler will be created that prints all output to sys.stdout. Otherwise it will create a NullHandler.\n\n### CROSS3D_DEBUG_LEVEL\nThis allows developers to create additional workflows inside the code that helps with debugging and development. By default it defaults to DebugLevels.Disabled, but you can control the default with the \"CROSS3D_DEBUG_LEVEL\" environment variable.\nTo change the current debug level: `cross3d.debugLevel = cross3d.constants.DebugLevels.Mid`\nTo check if the current debug level is Mid or higher: `cross3d.debugLevel \u003e= cross3d.constants.DebugLevels.Mid`\n\n### CROSS3D_ABSTRACTMETHOD_MODE\nSimilar to CROSS3D_DEBUG_LEVEL, this variable allows a cross3d developer to have a log message sent any time a abstractmethod function is called and is not overriden by the DCC specific code. This is useful for auditing what functions still need implemented. \n\nHere are the valid values:\n* \"\": A empty string disables any logs or exceptions from being raised. The Default.\n* \"raise\": If a abstractmethod is called without a subclass, raise a exception.\n* \"warn\": If a abstractmethod is called log a message that it was called.\n\n### CROSS3D_DEBUG_MODULE\nBy default cross3d suppresses exceptions when it imports the software specific module. It uses the first module that successfully imports. When programming a software specific module this makes it hard to debug. If you set the environment variable CROSS3D_DEBUG_MODULE to the name of the module you are working on it will only try to load that module(and abstract) and it will raise all exceptions.\n\n### CROSS3D_STUDIO_IGNORED_[DCCNAME]\nCurrently: CROSS3D_STUDIO_IGNORED_MAYA, CROSS3D_STUDIO_IGNORED_MOTIONBUILDER, CROSS3D_STUDIO_IGNORED_SOFTIMAGE, CROSS3D_STUDIO_IGNORED_STUDIOMAX\n\nThese variables are used to ignore speciffic versions of DCC when using cross3d.external. Each of these variables should contain a comma seperated list of versions that if installed should be ignored when automatically choosing the version of the DCC. It is ignored if the version is explicitly requested.\n\n# History\ncross3d was originally called blurapi. Eric Hulser and a few others wrote the initial framework in late 2008. It was later renamed blur3d with a major refactor. blur3d has been used in many tools at blur. It has been touched by most of the TD's and programmers at blur at some point. When releasing it as a module on github we renamed it to cross3d and removed(planning to remove) a lot of the blur specific logic to reduce the number of requirements.\n\n## TODO:\nblur3d has been used in blur for several years. It uses several blur specific api's and is dependent on several of blur api's that are not currently easily available via open source, and in most cases are completely unnecessary outside of blur. We are migrating blur3d to cross3d we are taking the opportunity to remove the extra dependencies. Here are a list of upcoming changes planned to make cross3d easier to integrate in other pipelines.\n\n* **PyQt4:** Currently cross3d is dependent on PyQt4 which is not easily available in most DCCs. We need it for our database api, so we end up compiling a compatible version for each DCC. If possible we will remove Qt dependencies entirely(I think `cross3d.dispatch` is the only module that currently needs Qt for signals). Otherwise I will make it so cross3d can be configured to use PyQt4 or PySide.\n* **cross3d.enum.enum:** Currently many of the enums are using `cross3d.enum.enum`. These should all be converted to EnumGroup subclasses. I want to verify how each is being used and make sure the conversion doesn't cause problems.\n* **cross3d.migrate:** This module contains duplicate code for modules that are need for cross3d to function. Some of them may end up in separate packages and some may be removed entirely.\n  * **XML:** This module may be removed, or replaced with a more standard xml parsing module.\n  * **dsofile:** This module is used to parse custom file properties in max files. It will probably not be removed. To be used it requires downloading a dll. See module docstring for more info.\n  * **imagesequence:** This is a collection of functions used to parse a filename for frame numbers and get a list of filenames or representation of a image sequence on disk. It is used by `cross3d.FileSequence` and will probably be moved into that module.\n  * **winregistry:** Several convenience methods used to pull info from the windows registry. These functions are used by the external modules to find the install location of DCCs. It will most likely stay in cross3d.\n* **Cross platform support:** Currently at blur all of our 3d DCC's are running on windows. While nothing in cross3d requires windows, it has not been tested on other platforms so additional development will be needed for it to work on Linux or Mac. `cross3d.external` for example currently uses winregistry to find the installed location of the requested DCC. Softimage uses pywin32 for just about everything.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblurstudio%2Fcross3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblurstudio%2Fcross3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblurstudio%2Fcross3d/lists"}