Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Fussion: added support for Fusion 17 (#5614)
Browse files Browse the repository at this point in the history
* OP-6780 - vendorized necessary libraries for Python 3.6

* OP-6780 - better resolution of app_version

* Update openpype/hosts/fusion/addon.py

Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>

* OP-6780 - add vendorized libraries even before menu creation

This should help when version of Fusion > 17, but it is still using 3.6

* OP-6780 - added todo message to remember to remove this

* OP-6780 - move injection of PYTHONPATH much sooner

At previous position it was too late.

* OP-6780 - better capture of broken imports

* OP-6780 - SyntaxError is thrown only if directly importing

* OP-6780 - remove unnecessary imports

Only urllib3 and attrs are actually needed

* OP-6780 - vendorize even directly in Fusion if Python < 3.7

* OP-6780 - remove update of PYTHONPATH in addon

More important and required is check directly in interpreter in Fusion, it doesn't make sense to pollute addon and have it on two places. It might get removed altogether in next-minor.

* OP-6780 - added comment

---------

Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
  • Loading branch information
kalisp and BigRoy committed Sep 15, 2023
1 parent b502588 commit 67abbaa
Show file tree
Hide file tree
Showing 63 changed files with 16,846 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openpype/hosts/fusion/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ def get_launch_hook_paths(self, app):
return []
return [os.path.join(FUSION_HOST_DIR, "hooks")]

def add_implementation_envs(self, env, _app):
def add_implementation_envs(self, env, app):
# Set default values if are not already set via settings

defaults = {"OPENPYPE_LOG_NO_COLORS": "Yes"}
for key, value in defaults.items():
if not env.get(key):
Expand Down
13 changes: 13 additions & 0 deletions openpype/hosts/fusion/deploy/MenuScripts/openpype_menu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import os
import sys

if sys.version_info < (3, 7):
# hack to handle discrepancy between distributed libraries and Python 3.6
# mostly because wrong version of urllib3
# TODO remove when not necessary
from openpype import PACKAGE_DIR
FUSION_HOST_DIR = os.path.join(PACKAGE_DIR, "hosts", "fusion")

vendor_path = os.path.join(FUSION_HOST_DIR, "vendor")
if vendor_path not in sys.path:
sys.path.insert(0, vendor_path)

print(f"Added vendorized libraries from {vendor_path}")

from openpype.lib import Logger
from openpype.pipeline import (
install_host,
Expand Down
78 changes: 78 additions & 0 deletions openpype/hosts/fusion/vendor/attr/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
from __future__ import absolute_import, division, print_function

import sys

from functools import partial

from . import converters, exceptions, filters, setters, validators
from ._cmp import cmp_using
from ._config import get_run_validators, set_run_validators
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
from ._make import (
NOTHING,
Attribute,
Factory,
attrib,
attrs,
fields,
fields_dict,
make_class,
validate,
)
from ._version_info import VersionInfo


__version__ = "21.2.0"
__version_info__ = VersionInfo._from_version_string(__version__)

__title__ = "attrs"
__description__ = "Classes Without Boilerplate"
__url__ = "https://www.attrs.org/"
__uri__ = __url__
__doc__ = __description__ + " <" + __uri__ + ">"

__author__ = "Hynek Schlawack"
__email__ = "hs@ox.cx"

__license__ = "MIT"
__copyright__ = "Copyright (c) 2015 Hynek Schlawack"


s = attributes = attrs
ib = attr = attrib
dataclass = partial(attrs, auto_attribs=True) # happy Easter ;)

__all__ = [
"Attribute",
"Factory",
"NOTHING",
"asdict",
"assoc",
"astuple",
"attr",
"attrib",
"attributes",
"attrs",
"cmp_using",
"converters",
"evolve",
"exceptions",
"fields",
"fields_dict",
"filters",
"get_run_validators",
"has",
"ib",
"make_class",
"resolve_types",
"s",
"set_run_validators",
"setters",
"validate",
"validators",
]

if sys.version_info[:2] >= (3, 6):
from ._next_gen import define, field, frozen, mutable

__all__.extend((define, field, frozen, mutable))
Loading

0 comments on commit 67abbaa

Please sign in to comment.