I am working on making a custom menu that would allow access to things like Cycle Render, Blender Render, changing file formats for render outputs, etc.
I understand how to make menus using operators like
layout.operator("rigidbody.objects_add", text="Add as Active"). type = 'ACTIVE'
Is the process for creating menus for bpy.context.scene
similar or am I missing some basic understanding of python and how Blender works?
UPDATE....
In the info panel I am trying to execute this.
bpy.context.scene.render.engine = 'CYCLES'
I am using this template from cgcookie.
EXAMPLE
import bpy
# Creates a menu for global 3D View
class customMenu(bpy.types.Menu):
bl_label = "Sub"
bl_idname = "view3D.sub"
# Set the menu operators and draw functions
def draw(self, context):
layout = self.layout
layout.operator("rigidbody.objects_add", text="A Add Active").type = 'ACTIVE'
layout.operator("rigidbody.objects_add", text="B Add Passive").type = 'PASSIVE'
# here is were I would like to add a menu item to change to cycles.
def register():
bpy.utils.register_class(customMenu)
bpy.ops.wm.call_menu(name=customMenu.bl_idname)
def unregister():
bpy.utils.unregister_class(customMenu)
if __name__ == "__main__":
register()