UI:
* Converted scene buttons layout code to use python.
This commit is contained in:
parent
874c9e8c58
commit
8b1207d500
@ -11,7 +11,7 @@ class OBJECT_PT_transform(bpy.types.Panel):
|
|||||||
if not ob:
|
if not ob:
|
||||||
return
|
return
|
||||||
|
|
||||||
layout.template_column_flow(3)
|
layout.template_row()
|
||||||
layout.itemR(ob, "location")
|
layout.itemR(ob, "location")
|
||||||
layout.itemR(ob, "rotation")
|
layout.itemR(ob, "rotation")
|
||||||
layout.itemR(ob, "scale")
|
layout.itemR(ob, "scale")
|
||||||
@ -27,7 +27,7 @@ class OBJECT_PT_groups(bpy.types.Panel):
|
|||||||
if not ob:
|
if not ob:
|
||||||
return
|
return
|
||||||
|
|
||||||
layout.template_column_flow(2)
|
layout.template_row()
|
||||||
layout.itemR(ob, "pass_index")
|
layout.itemR(ob, "pass_index")
|
||||||
layout.itemR(ob, "parent")
|
layout.itemR(ob, "parent")
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ class OBJECT_PT_groups(bpy.types.Panel):
|
|||||||
sublayout.itemR(group, "name")
|
sublayout.itemR(group, "name")
|
||||||
# sublayout.itemO("OBJECT_OT_remove_group")
|
# sublayout.itemO("OBJECT_OT_remove_group")
|
||||||
|
|
||||||
sublayout.template_column_flow(2)
|
sublayout.template_row()
|
||||||
sublayout.itemR(group, "layer")
|
sublayout.itemR(group, "layer")
|
||||||
sublayout.itemR(group, "dupli_offset")
|
sublayout.itemR(group, "dupli_offset")
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ class OBJECT_PT_display(bpy.types.Panel):
|
|||||||
if not ob:
|
if not ob:
|
||||||
return
|
return
|
||||||
|
|
||||||
layout.template_column_flow(2)
|
layout.template_row()
|
||||||
layout.itemR(ob, "max_draw_type", text="Type")
|
layout.itemR(ob, "max_draw_type", text="Type")
|
||||||
layout.itemR(ob, "draw_bounds_type", text="Bounds")
|
layout.itemR(ob, "draw_bounds_type", text="Bounds")
|
||||||
|
|
||||||
@ -122,3 +122,4 @@ bpy.ui.addPanel(OBJECT_PT_groups, "BUTTONS_WINDOW", "WINDOW")
|
|||||||
bpy.ui.addPanel(OBJECT_PT_display, "BUTTONS_WINDOW", "WINDOW")
|
bpy.ui.addPanel(OBJECT_PT_display, "BUTTONS_WINDOW", "WINDOW")
|
||||||
bpy.ui.addPanel(OBJECT_PT_duplication, "BUTTONS_WINDOW", "WINDOW")
|
bpy.ui.addPanel(OBJECT_PT_duplication, "BUTTONS_WINDOW", "WINDOW")
|
||||||
bpy.ui.addPanel(OBJECT_PT_animation, "BUTTONS_WINDOW", "WINDOW")
|
bpy.ui.addPanel(OBJECT_PT_animation, "BUTTONS_WINDOW", "WINDOW")
|
||||||
|
|
||||||
|
125
release/ui/buttons_scene.py
Normal file
125
release/ui/buttons_scene.py
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
|
||||||
|
import bpy
|
||||||
|
|
||||||
|
class RENDER_PT_shading(bpy.types.Panel):
|
||||||
|
__label__ = "Shading"
|
||||||
|
__context__ = "render"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
scene = context.scene
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
if not scene:
|
||||||
|
return
|
||||||
|
|
||||||
|
rd = scene.render_data
|
||||||
|
|
||||||
|
layout.template_column_flow(2)
|
||||||
|
layout.itemR(rd, "render_shadows", text="Shadows")
|
||||||
|
layout.itemR(rd, "render_sss", text="SSS")
|
||||||
|
layout.itemR(rd, "render_envmaps", text="EnvMap")
|
||||||
|
layout.itemR(rd, "render_radiosity", text="Radio")
|
||||||
|
layout.itemR(rd, "render_raytracing", text="Ray Tracing")
|
||||||
|
layout.itemR(rd, "octree_resolution")
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemR(rd, "alpha_mode")
|
||||||
|
|
||||||
|
class RENDER_PT_image(bpy.types.Panel):
|
||||||
|
__label__ = "Image"
|
||||||
|
__context__ = "render"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
scene = context.scene
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
if not scene:
|
||||||
|
return
|
||||||
|
|
||||||
|
rd = scene.render_data
|
||||||
|
|
||||||
|
layout.template_column_flow(2)
|
||||||
|
layout.itemR(rd, "resolution_x", text="SizeX")
|
||||||
|
layout.itemR(rd, "resolution_x", text="SizeY")
|
||||||
|
layout.itemR(rd, "pixel_aspect_x", text="AspX")
|
||||||
|
layout.itemR(rd, "pixel_aspect_y", text="AspY")
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemR(rd, "crop_to_border")
|
||||||
|
|
||||||
|
class RENDER_PT_antialiasing(bpy.types.Panel):
|
||||||
|
__label__ = "Anti-Aliasing"
|
||||||
|
__context__ = "render"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
scene = context.scene
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
if not scene:
|
||||||
|
return
|
||||||
|
|
||||||
|
rd = scene.render_data
|
||||||
|
|
||||||
|
layout.template_column_flow(2)
|
||||||
|
layout.itemR(rd, "antialiasing", text="Enable")
|
||||||
|
layout.itemR(rd, "antialiasing_samples", text="Samples")
|
||||||
|
layout.itemR(rd, "pixel_filter")
|
||||||
|
layout.itemR(rd, "filter_size")
|
||||||
|
|
||||||
|
class RENDER_PT_render(bpy.types.Panel):
|
||||||
|
__label__ = "Render"
|
||||||
|
__context__ = "render"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
scene = context.scene
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
if not scene:
|
||||||
|
return
|
||||||
|
|
||||||
|
rd = scene.render_data
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemO("SCREEN_OT_render", text="RENDER", icon=0) # ICON_SCENE
|
||||||
|
#layout.itemO("SCREEN_OT_render", text="ANIM", icon=0) # "anim", 1
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemR(scene, "start_frame", text="Start")
|
||||||
|
layout.itemR(scene, "end_frame", text="End")
|
||||||
|
layout.itemR(scene, "current_frame", text="Frame")
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemR(rd, "do_composite")
|
||||||
|
layout.itemR(rd, "do_sequence")
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemL(text="General")
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemR(rd, "resolution_percentage", text="Size ")
|
||||||
|
layout.itemR(rd, "dither_intensity")
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemR(rd, "parts_x")
|
||||||
|
layout.itemR(rd, "parts_y")
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemR(rd, "threads")
|
||||||
|
layout.itemR(rd, "threads_mode")
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemR(rd, "fields", text="Fields")
|
||||||
|
layout.itemR(rd, "field_order", text="Order")
|
||||||
|
layout.itemR(rd, "fields_still", text="Still")
|
||||||
|
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemL(text="Extra:")
|
||||||
|
layout.template_row()
|
||||||
|
layout.itemR(rd, "border", text="Border Render")
|
||||||
|
layout.itemR(rd, "panorama")
|
||||||
|
|
||||||
|
bpy.ui.addPanel(RENDER_PT_shading, "BUTTONS_WINDOW", "WINDOW")
|
||||||
|
bpy.ui.addPanel(RENDER_PT_image, "BUTTONS_WINDOW", "WINDOW")
|
||||||
|
bpy.ui.addPanel(RENDER_PT_antialiasing, "BUTTONS_WINDOW", "WINDOW")
|
||||||
|
bpy.ui.addPanel(RENDER_PT_render, "BUTTONS_WINDOW", "WINDOW")
|
||||||
|
|
@ -59,6 +59,7 @@
|
|||||||
#define R_DISPLAYWIN 1
|
#define R_DISPLAYWIN 1
|
||||||
#define R_DISPLAYSCREEN 2
|
#define R_DISPLAYSCREEN 2
|
||||||
|
|
||||||
|
#if 0
|
||||||
#if 0
|
#if 0
|
||||||
static void render_panel_output(const bContext *C, ARegion *ar)
|
static void render_panel_output(const bContext *C, ARegion *ar)
|
||||||
{
|
{
|
||||||
@ -425,9 +426,11 @@ void render_panel_anim(const bContext *C, ARegion *ar)
|
|||||||
|
|
||||||
uiEndBlock(C, block);
|
uiEndBlock(C, block);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void buttons_scene_register(ARegionType *art)
|
void buttons_scene_register(ARegionType *art)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
PanelType *pt;
|
PanelType *pt;
|
||||||
|
|
||||||
/* panels: Render */
|
/* panels: Render */
|
||||||
@ -461,5 +464,6 @@ void buttons_scene_register(ARegionType *art)
|
|||||||
pt->context= "render";
|
pt->context= "render";
|
||||||
pt->draw= render_panel_shading;
|
pt->draw= render_panel_shading;
|
||||||
BLI_addtail(&art->paneltypes, pt);
|
BLI_addtail(&art->paneltypes, pt);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user