Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wentww committed Dec 29, 2023
1 parent f724394 commit 1f7312b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion samples/blender/04_staticmesh_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from xrfeitoria.data_structure.models import SequenceTransformKey as SeqTransKey
from xrfeitoria.utils import setup_logger

from ..utils import visualize_vertices
from ..config import assets_path, blender_exec
from ..utils import visualize_vertices

root = Path(__file__).parents[2].resolve()
# output_path = '~/xrfeitoria/output/samples/blender/{file_name}'
Expand Down
2 changes: 1 addition & 1 deletion samples/unreal/04_staticmesh_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from xrfeitoria.data_structure.models import SequenceTransformKey as SeqTransKey
from xrfeitoria.utils import setup_logger

from ..utils import visualize_vertices
from ..config import assets_path, unreal_exec, unreal_project
from ..utils import visualize_vertices

root = Path(__file__).parents[2].resolve()
# output_path = '~/xrfeitoria/output/samples/unreal/{file_name}'
Expand Down
20 changes: 14 additions & 6 deletions src/XRFeitoriaBpy/core/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def set_sequence_properties(
frame_end: int,
frame_current: int,
resolution_x: int,
resolution_y: int
resolution_y: int,
) -> None:
"""Set the sequence properties.
Expand All @@ -146,7 +146,9 @@ def set_sequence_properties(
collection.sequence_properties.resolution_x = resolution_x
collection.sequence_properties.resolution_y = resolution_y

def get_sequence_properties(collection: 'bpy.types.Collection') -> 'Tuple[bpy.types.Scene, int, int, int, int, int, int]':
def get_sequence_properties(
collection: 'bpy.types.Collection',
) -> 'Tuple[bpy.types.Scene, int, int, int, int, int, int]':
"""Get the sequence properties.
Args:
Expand Down Expand Up @@ -176,9 +178,15 @@ def open_sequence(seq_name: str) -> 'bpy.types.Scene':
# get sequence collection
seq_collection = XRFeitoriaBlenderFactory.get_collection(seq_name)
# get sequence properties
level_scene, fps, frame_start, frame_end, frame_current, resolution_x, resolution_y = XRFeitoriaBlenderFactory.get_sequence_properties(
collection=seq_collection
)
(
level_scene,
fps,
frame_start,
frame_end,
frame_current,
resolution_x,
resolution_y,
) = XRFeitoriaBlenderFactory.get_sequence_properties(collection=seq_collection)
# deactivate all cameras in this level
for obj in level_scene.objects:
if obj.type == 'CAMERA':
Expand Down Expand Up @@ -250,7 +258,7 @@ def close_sequence() -> None:
frame_end=level_scene.frame_end,
frame_current=level_scene.frame_current,
resolution_x=level_scene.render.resolution_x,
resolution_y=level_scene.render.resolution_y
resolution_y=level_scene.render.resolution_y,
)
# unlink the sequence from the level
XRFeitoriaBlenderFactory.unlink_collection_from_scene(collection=collection, scene=level_scene)
Expand Down
4 changes: 3 additions & 1 deletion src/XRFeitoriaBpy/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def active_sequence_update(self, context):
if self.active_sequence is None:
XRFeitoriaBlenderFactory.close_sequence()
elif XRFeitoriaBlenderFactory.is_sequence_collecion(self.active_sequence):
level_scene, _, _, _, _, _, _ = XRFeitoriaBlenderFactory.get_sequence_properties(collection=self.active_sequence)
level_scene, _, _, _, _, _, _ = XRFeitoriaBlenderFactory.get_sequence_properties(
collection=self.active_sequence
)
if self.active_sequence.name not in level_scene.collection.children:
XRFeitoriaBlenderFactory.open_sequence(self.active_sequence.name)
else:
Expand Down
2 changes: 1 addition & 1 deletion xrfeitoria/sequence/sequence_blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _new_seq_in_engine(
frame_end=seq_length - 1,
frame_current=0,
resolution_x=level_scene.render.resolution_x,
resolution_y=level_scene.render.resolution_y
resolution_y=level_scene.render.resolution_y,
)
level_scene.frame_start = 0
level_scene.frame_end = seq_length - 1
Expand Down

0 comments on commit 1f7312b

Please sign in to comment.