Disabled camera creation in Blender when loading layout from JSON

This commit is contained in:
Simone Barbieri 2021-11-11 10:33:11 +00:00
parent 578ab1c7f2
commit d2ae004b49

View file

@ -108,20 +108,22 @@ class JsonLayoutLoader(plugin.AssetLoader):
options=options options=options
) )
# Create the camera asset and the camera instance # Camera creation when loading a layout is not necessary for now,
creator_plugin = lib.get_creator_by_name("CreateCamera") # but the code is worth keeping in case we need it in the future.
if not creator_plugin: # # Create the camera asset and the camera instance
raise ValueError("Creator plugin \"CreateCamera\" was " # creator_plugin = lib.get_creator_by_name("CreateCamera")
"not found.") # if not creator_plugin:
# raise ValueError("Creator plugin \"CreateCamera\" was "
# "not found.")
api.create( # api.create(
creator_plugin, # creator_plugin,
name="camera", # name="camera",
# name=f"{unique_number}_{subset}_animation", # # name=f"{unique_number}_{subset}_animation",
asset=asset, # asset=asset,
options={"useSelection": False} # options={"useSelection": False}
# data={"dependencies": str(context["representation"]["_id"])} # # data={"dependencies": str(context["representation"]["_id"])}
) # )
def process_asset(self, def process_asset(self,
context: dict, context: dict,