this panel should be located in the Scene Properties tab
Here's the updated code to make the panel located in the Scene Properties tab:
import bpy
class AssetCollectorPanel(bpy.types.Panel):
bl_label = "Asset Collector"
bl_idname = "OBJECT_PT_asset_collector"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
bl_category = "Asset Collector"
def draw(self, context):
layout = self.layout
row = layout.row()
row.label(text="Assets folder name")
row.prop(context.scene, "asset_folder_name", text="")
row = layout.row()
row.operator("asset.collect", text="Collect")
class AssetCollectOperator(bpy.types.Operator):
bl_idname = "asset.collect"
bl_label = "Collect Assets"
def execute(self, context):
print("Collected!")
return {'FINISHED'}
classes = [ AssetCollectorPanel, AssetCollectOperator]
def register():
bpy.types.Scene.asset_folder_name = bpy.props.StringProperty(
name="Assets folder name",
default="assets"
)
for cls in classes:
bpy.utils.register_class(cls)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)
del bpy.types.Scene.asset_folder_name
if __name__ == "__main__":
register()