Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor attributes code #641

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
20 changes: 1 addition & 19 deletions molecularnodes/blender/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
from pathlib import Path
from typing import Union
import bpy


def path_resolve(path: Union[str, Path]) -> Path:
if isinstance(path, str):
return Path(bpy.path.abspath(path))
elif isinstance(path, Path):
return Path(bpy.path.abspath(str(path)))
else:
raise ValueError(f"Unable to resolve path: {path}")


def active_object(context: bpy.types.Context = None) -> bpy.types.Object:
if context is None:
return bpy.context.active_object

return context.active_object
from .utils import path_resolve
115 changes: 0 additions & 115 deletions molecularnodes/blender/bones.py

This file was deleted.

11 changes: 11 additions & 0 deletions molecularnodes/blender/bpyd/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from .object import ObjectTracker, BlenderObject, create_object
from .attribute import (
named_attribute,
store_named_attribute,
Attribute,
AttributeType,
AttributeTypeInfo,
AttributeTypes,
Domains,
DomainType,
)
Loading
Loading