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

Commit

Permalink
Merge pull request #4226 from pypeclub/bugifx/blender-create_camera_u…
Browse files Browse the repository at this point in the history
…se_selection

Blender: Fix Create Camera "Use selection"
  • Loading branch information
LiborBatek authored Dec 14, 2022
2 parents 6684852 + 7810d42 commit 476bb2d
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 476bb2d

Please sign in to comment.