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

Commit

Permalink
Camera is created only when the creator is not using the selection
Browse files Browse the repository at this point in the history
  • Loading branch information
simonebarbieri committed Dec 13, 2022
1 parent 9f15cd1 commit 7810d42
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions openpype/hosts/blender/plugins/create/create_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ def _process(self):
subset = self.data["subset"]
name = plugin.asset_name(asset, subset)

camera = bpy.data.cameras.new(subset)
camera_obj = bpy.data.objects.new(subset, camera)

instances.objects.link(camera_obj)

asset_group = bpy.data.objects.new(name=name, object_data=None)
asset_group.empty_display_type = 'SINGLE_ARROW'
instances.objects.link(asset_group)
Expand All @@ -53,6 +48,11 @@ def _process(self):
bpy.ops.object.parent_set(keep_transform=True)
else:
plugin.deselect_all()
camera = bpy.data.cameras.new(subset)
camera_obj = bpy.data.objects.new(subset, camera)

instances.objects.link(camera_obj)

camera_obj.select_set(True)
asset_group.select_set(True)
bpy.context.view_layer.objects.active = asset_group
Expand Down

0 comments on commit 7810d42

Please sign in to comment.