From 0264b931c5a27ae0181ff0af81d57f88406f0105 Mon Sep 17 00:00:00 2001 From: Brady Johnston Date: Sat, 25 May 2024 19:59:29 +0200 Subject: [PATCH] minor tweak --- molecularnodes/io/parse/cellpack.py | 3 +-- molecularnodes/io/parse/ensemble.py | 4 ++-- molecularnodes/io/parse/star.py | 5 ++--- molecularnodes/ui/ops.py | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/molecularnodes/io/parse/cellpack.py b/molecularnodes/io/parse/cellpack.py index 8cb86bba..cb49f7d7 100644 --- a/molecularnodes/io/parse/cellpack.py +++ b/molecularnodes/io/parse/cellpack.py @@ -1,6 +1,5 @@ from pathlib import Path from typing import Union -from pathlib import Path import numpy as np import bpy @@ -22,7 +21,7 @@ def __init__(self, file_path: Union[str, Path]) -> None: self.chain_ids = self.data.chain_ids def create_model( - self, name: str = "StarFileObject", node_setup: bool = True, world_scale: float = 0.01 + self, name: str = "StarFileObject", node_setup: bool = True, world_scale: float = 0.01, fraction: float = 1.0 ) -> bpy.types.Object: self.data_object = self._create_data_object(name=f"{name}") self._create_object_instances(name=name, node_setup=node_setup) diff --git a/molecularnodes/io/parse/ensemble.py b/molecularnodes/io/parse/ensemble.py index f200e7f3..6b42ea12 100644 --- a/molecularnodes/io/parse/ensemble.py +++ b/molecularnodes/io/parse/ensemble.py @@ -1,7 +1,7 @@ import bpy from abc import ABCMeta import numpy as np -from typing import Union, Optional, Set, List, Dict +from typing import Union from pathlib import Path from ... import blender as bl import warnings @@ -26,7 +26,7 @@ def __init__(self, file_path: Union[str, Path]) -> None: @classmethod def create_model( - self, name: str = "EnsembleObject", node_setup: bool = True, world_scale: float = 0.01 + self, name: str = "EnsembleObject", node_setup: bool = True, world_scale: float = 0.01, fraction: float = 1.0 ) -> bpy.types.Object: """ Create a 3D model in the of the ensemble. diff --git a/molecularnodes/io/parse/star.py b/molecularnodes/io/parse/star.py index 71fad903..89b97b86 100644 --- a/molecularnodes/io/parse/star.py +++ b/molecularnodes/io/parse/star.py @@ -2,8 +2,7 @@ import bpy import starfile.typing from bpy.app.handlers import persistent -from typing import Union, Optional, Set, List, Dict -from numpy.typing import NDArray +from typing import Union, Optional, Dict from pathlib import Path import starfile from .ensemble import Ensemble @@ -201,7 +200,7 @@ def _update_micrograph_texture(self, *_) -> None: self.star_node.inputs["Micrograph"].default_value = image_obj def create_model( - self, name: str = "EnsembleObject", node_setup: bool = True, world_scale: float = 0.01 + self, name: str = "EnsembleObject", node_setup: bool = True, world_scale: float = 0.01, fraction: float = 1.0 ) -> bpy.types.Object: from molecularnodes.blender.nodes import get_star_node, MN_micrograph_material diff --git a/molecularnodes/ui/ops.py b/molecularnodes/ui/ops.py index 21343f03..e8995e01 100644 --- a/molecularnodes/ui/ops.py +++ b/molecularnodes/ui/ops.py @@ -1,6 +1,6 @@ import bpy from ..blender import nodes -from typing import Set, Union, Optional, Dict +from typing import Set class MN_OT_Add_Custom_Node_Group(bpy.types.Operator):