*Changed some userpref options to enums.
authorWilliam Reynish <william@reynish.com>
Sun, 13 Sep 2009 21:36:24 +0000 (21:36 +0000)
committerWilliam Reynish <william@reynish.com>
Sun, 13 Sep 2009 21:36:24 +0000 (21:36 +0000)
*Tweaked curve UI slightly.

release/ui/buttons_data_curve.py
release/ui/buttons_data_text.py
release/ui/space_userpref.py
source/blender/makesrna/intern/rna_userdef.c

index 94ad073d0bbba4271fca134bd0a0c491f4d33c93..70904239d8665e051ac655beb7933cb5d5af8541 100644 (file)
@@ -96,27 +96,29 @@ class DATA_PT_shape_curve(DataButtonsPanel):
 #              col.itemL(text="NORMALS")
 #              col.itemR(curve, "vertex_normal_flip")
 
-class DATA_PT_geometry_curve(DataButtonsPanelCurve):
-       __label__ = "Geometry "
+class DATA_PT_geometry_curve(DataButtonsPanel):
+       __label__ = "Geometry"
 
        def draw(self, context):
                layout = self.layout
                
                curve = context.curve
-               
+
                split = layout.split()
        
                col = split.column()
                col.itemL(text="Modification:")
                col.itemR(curve, "width")
                col.itemR(curve, "extrude")
-               col.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE')
+               col.itemL(text="Taper Object:")
+               col.itemR(curve, "taper_object", text="")
                
                col = split.column()
                col.itemL(text="Bevel:")
                col.itemR(curve, "bevel_depth", text="Depth")
                col.itemR(curve, "bevel_resolution", text="Resolution")
-               col.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE')
+               col.itemL(text="Bevel Object:")
+               col.itemR(curve, "bevel_object", text="")
 
        
 class DATA_PT_pathanim(DataButtonsPanelCurve):
index d0e7ea09a92e01359827b184274f8b5541d47331..2959f60a5f5bb0e8215bc6bf23865694b71091b1 100644 (file)
@@ -36,9 +36,7 @@ class DATA_PT_shape_text(DataButtonsPanel):
                
                ob = context.object
                curve = context.curve
-               space = context.space_data
-
-               layout.itemR(curve, "curve_2d")                 
+               space = context.space_data              
                                                        
                split = layout.split()
                
@@ -55,8 +53,8 @@ class DATA_PT_shape_text(DataButtonsPanel):
                col = split.column()    
                col.itemL(text="Resolution:")
                sub = col.column(align=True)
-               sub.itemR(curve, "resolution_u", text="Preview U")
-               sub.itemR(curve, "render_resolution_u", text="Render U")
+               sub.itemR(curve, "resolution_u", text="Preview")
+               sub.itemR(curve, "render_resolution_u", text="Render")
                
                # resolution_v is not used for text
                
index 1e7a9b581d423853e04c35543fcee50692314f77..cfdabadcee1825426e87962ab2d31d90cfb31b68 100644 (file)
@@ -156,15 +156,15 @@ class USERPREF_PT_edit(bpy.types.Panel):
                sub = col.split(percentage=0.85)
                
                sub1 = sub.column()
-               sub1.itemL(text="Materials:")
-               sub1.itemR(edit, "material_linked_object", text="Linked to Object")
-               sub1.itemR(edit, "material_linked_obdata", text="Linked to ObData")
+               sub1.itemL(text="Link Materials To:")
+               sub1.row().itemR(edit, "material_link", expand=True)
                sub1.itemS()
                sub1.itemS()
                sub1.itemS()
                sub1.itemL(text="New Objects:")
                sub1.itemR(edit, "enter_edit_mode")
-               sub1.itemR(edit, "align_to_view")
+               sub1.itemL(text="Align To:")
+               sub1.row().itemR(edit, "object_align", expand=True)
                sub1.itemS()
                sub1.itemS()
                sub1.itemS()
@@ -185,9 +185,9 @@ class USERPREF_PT_edit(bpy.types.Panel):
                sub1.itemL(text="Grease Pencil:")
                sub1.itemR(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
                sub1.itemR(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
-               sub1.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
                # sub1.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
                sub1.itemR(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
+               sub1.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
                
                col = split.column()
                sub = col.split(percentage=0.85)
index ffc3f1696fc6c7ee23036b690469d147b54fbd27..1a000525fdafdf47cdd722c9bebb495c0921bfdf 100644 (file)
@@ -1766,28 +1766,38 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
                {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""},
                {0, NULL, 0, NULL, NULL}};
 
+       static const EnumPropertyItem material_link_items[]= {
+               {0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block."},
+               {USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block."},
+               {0, NULL, 0, NULL, NULL}};
+               
+       static const EnumPropertyItem object_align_items[]= {
+               {0, "WORLD", 0, "World", "Align newly added objects facing the 3D View direction"},
+               {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects to the world coordinates"},
+               {0, NULL, 0, NULL, NULL}};
+
+
        srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
        RNA_def_struct_sdna(srna, "UserDef");
        RNA_def_struct_nested(brna, srna, "UserPreferences");
        RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data.");
        
        /* Edit Methods */
-       prop= RNA_def_property(srna, "material_linked_object", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_MAT_ON_OB);
-       RNA_def_property_ui_text(prop, "Material Linked Object", "Toggle whether the material is linked to object data or the object block.");
-
-       prop= RNA_def_property(srna, "material_linked_obdata", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_MAT_ON_OB);
-       RNA_def_property_ui_text(prop, "Material Linked ObData", "Toggle whether the material is linked to object data or the object block.");
+       
+       prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+       RNA_def_property_enum_items(prop, material_link_items);
+       RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block");
+       
+       prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+       RNA_def_property_enum_items(prop, object_align_items);
+       RNA_def_property_ui_text(prop, "Align Object To", "Align newly added objects facing the 3D View direction or the world coordinates");
 
        prop= RNA_def_property(srna, "enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE);
        RNA_def_property_ui_text(prop, "Enter Edit Mode", "Enter Edit Mode automatically after adding a new object.");
 
-       prop= RNA_def_property(srna, "align_to_view", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_VIEWALIGNED);
-       RNA_def_property_ui_text(prop, "Align To View", "Align newly added objects facing the 3D View direction.");
-
        prop= RNA_def_property(srna, "drag_immediately", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_DRAGIMMEDIATE);
        RNA_def_property_ui_text(prop, "Drag Immediately", "Moving things with a mouse drag doesn't require a click to confirm (Best for tablet users).");