From 119d0e91452588da5167257d1902b3dfa36817ea Mon Sep 17 00:00:00 2001 From: Michael Fox Date: Fri, 24 Apr 2009 01:17:54 +0000 Subject: [PATCH] Small comit, added the colour mode (BW,RGB,RGBA) and object type to rna, and added appropriate entries to the UI --- release/ui/buttons_objects.py | 3 +++ release/ui/buttons_scene.py | 1 + source/blender/makesrna/intern/rna_object.c | 20 ++++++++++++++++++++ source/blender/makesrna/intern/rna_scene.c | 11 +++++++++++ 4 files changed, 35 insertions(+) diff --git a/release/ui/buttons_objects.py b/release/ui/buttons_objects.py index 9c1efacf10a..f971d167f7f 100644 --- a/release/ui/buttons_objects.py +++ b/release/ui/buttons_objects.py @@ -62,6 +62,9 @@ class OBJECT_PT_display(ObjectButtonsPanel): if not ob: return + + layout.row() + layout.itemR(ob, "type", text="Object Type") layout.row() layout.itemR(ob, "max_draw_type", text="Type") diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index 3d52cfe2c28..89945c1e531 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -53,6 +53,7 @@ class RENDER_PT_image(RenderButtonsPanel): layout.row() layout.itemR(rd, "quality") + layout.itemR(rd, "color_mode") layout.row() layout.itemR(rd, "placeholders") diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 1df01e4cabf..15763070401 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -442,6 +442,20 @@ static StructRNA *rna_def_object(BlenderRNA *brna) {PARVERT3, "VERTEX_3", "3 Vertices", ""}, {PARBONE, "BONE", "Bone", ""}, {0, NULL, NULL, NULL}}; + + static EnumPropertyItem object_type_items[] = { + {OB_EMPTY, "EMPTY", "Empty", "An Empty/Null Object"}, + {OB_MESH, "MESH", "Mesh", "A Mesh Object"}, + {OB_CURVE, "CURVE", "Curve", "A Curve Object"}, + {OB_SURF, "SURFACE", "Surface", "A Surface Object"}, + {OB_FONT, "TEXT", "Text", "A Text Object"}, + {OB_MBALL, "META", "Meta", "A Meta Object"}, + {OB_LAMP, "LAMP", "Lamp", "A Lamp Object"}, + {OB_CAMERA, "CAMERA", "Camera", "A Camera Object"}, + {OB_WAVE, "WAVE", "Wave", "A Wave Object"}, + {OB_LATTICE, "LATTICE", "Lattice", "A Lattice Object"}, + {OB_ARMATURE, "ARMATURE", "Armature", "An Armature Object"}, + {0, NULL, NULL, NULL}}; static EnumPropertyItem empty_drawtype_items[] = { {OB_ARROWS, "ARROWS", "Arrows", ""}, @@ -519,6 +533,12 @@ static StructRNA *rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Parent", "Parent Object"); + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, object_type_items); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Type", "Type of Object."); + prop= RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "partype"); RNA_def_property_enum_items(prop, parent_type_items); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 5108bdabbc9..225d92a79a5 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -181,6 +181,12 @@ void rna_def_scene_render_data(BlenderRNA *brna) {R_ALPHAKEY, "STRAIGHT", "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"}, {0, NULL, NULL, NULL}}; + static EnumPropertyItem color_mode_items[] ={ + {R_PLANESBW, "BW", "BW", "Images are saved with BW (grayscale) data"}, + {R_PLANES24, "RGB", "RGB", "Images are saved with RGB (color) data"}, + {R_PLANES32, "RGBA", "RGBA", "Images are saved with RGB and Alpha data (if supported)"}, + {0, NULL, NULL, NULL}}; + static EnumPropertyItem octree_resolution_items[] = { {64, "OCTREE_RES_64", "64", ""}, {128, "OCTREE_RES_128", "128", ""}, @@ -210,6 +216,11 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_struct_nested(brna, srna, "Scene"); RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock."); + prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes"); + RNA_def_property_enum_items(prop, color_mode_items); + RNA_def_property_ui_text(prop, "Colour Mode", "What Colour Mode images are saved in (BW, RGB, RGBA)"); + prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "xsch"); RNA_def_property_range(prop, 4, 10000);