I'm trying to create a multi-file package for my Blender addon. But when I click install addon, the addon doesn't show up in the user preferences.
I have two files:
- __init__.py
- QuickRenderAddon.py
They are put inside a folder called RenderAddon. When I'm installing the addon, I choose the __init__.py
. What am I doing wrong and how can I fix it?
EDIT: I have installed one self-made addon before. This addon shows up as it should. But that was only one script.
__init__.py
bl_info = {
"name" : "Quick rendering",
"author" : "Lambi",
"version" : (1, 0, 0),
"blender" : (2, 7, 1),
"location" : "View 3D > Edit Mode > Tool Shelf",
"description" :
"Allows for quick rendering",
"warning" : "",
"wiki_url" : "",
"tracker_url" : "",
"category" : "Add Mesh",
'support': 'COMMUNITY'
}
if "bpy" in locals():
import imp
imp.reload(QuickRenderAddon)
print("Reloaded multifiles")
else:
from . import QuickRenderAddon
print("Imported multifiles")
import bpy
import os
class LayoutDemoPanel(bpy.types.Panel):
"""Creates a Panel for quick rendering options"""
bl_label = "Quick rendering panel"
bl_idname = "RENDER_PT_layout"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
def draw(self, context):
layout = self.layout
scene = context.scene
# Create an row where the buttons are aligned to each other.
layout.label(text="Quick Rendering:")
row = layout.row()
row.scale_y = 2.0
row.operator("object.custom_rendering")
class CustomRenderOperator(bpy.types.Operator):
"""Render stuff, yee"""
bl_idname = "object.custom_rendering"
bl_label = "Preview render"
def execute(self, context):
QuickRenderAddon.set_settings()
return {'FINISHED'}
def register():
bpy.utils.register_module(__name__)
def unregister():
bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
register()
QuickRenderAddon.py
#Script to quickly access different render presets,
#by clicking only one button
import bpy
import os
############# ... a bunch of function def's here, but I've
############# removed them as to not overwhelm you with code...
def set_settings():
set_output_settings()
set_sampling_settings()
set_dimension_settings()
#################### Program: ####################
render_folder = "Render\\QuickRenderAddon"
project_folder = "F:\\06_MotionPath_Dev"
os.chdir(project_folder)
#set_settings()
#bpy.ops.render.render(animation=True)
print("Program complete 2")
bl_info
dict looks incomplete. Also, what support level is enabled? Your addon may be in Testing or not show at all until you add the support level tobl_info
. $\endgroup$__init__.py
enough? Do I have to manually copy the script folder somewhere? $\endgroup$__init__.py
and install via User Preferences > Addons > Install from File.... Or copy the entire folder with all files to a `scripts\addons` folder which Blender checks. $\endgroup$