Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2009-07-19 05:55:21 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2009-07-19 05:55:21 +0400
commit036c0012e613d4874fd29fa9f16f76f4be2b9f9c (patch)
tree532c99b87bb28576705576386de46c19bb0731e3 /source
parentd7564761c03c560efd33591d47559f889d07bff1 (diff)
Sculpt/2.5:
* Added pointer RNA for the sculpt brush * Converted sculpt settings panel (in the NKEY area) from C to Python * For Python UI, needed context for whether sculpt is enabled or not; discussed this with Brecht and added sculpt_object to scene context
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/screen/screen_context.c9
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c39
-rw-r--r--source/blender/makesrna/intern/rna_scene.c4
3 files changed, 12 insertions, 40 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c
index e9a979aa134..5944ef5f507 100644
--- a/source/blender/editors/screen/screen_context.c
+++ b/source/blender/editors/screen/screen_context.c
@@ -33,6 +33,7 @@
#include "BKE_context.h"
#include "BKE_utildefines.h"
+#include "BKE_global.h"
#include "RNA_access.h"
@@ -47,7 +48,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
"scene", "selected_objects", "selected_bases",
"selected_editable_objects", "selected_editable_bases"
"active_base",
- "active_object", "edit_object", NULL};
+ "active_object", "edit_object", "sculpt_object", NULL};
CTX_data_dir_set(result, dir);
return 1;
@@ -107,6 +108,12 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
+ else if(CTX_data_equals(member, "sculpt_object")) {
+ if(G.f & G_SCULPTMODE && scene->basact)
+ CTX_data_id_pointer_set(result, &scene->basact->object->id);
+
+ return 1;
+ }
return 0;
}
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 3cf438bdd32..76f9699b3e7 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -1176,41 +1176,6 @@ static void view3d_panel_brush(const bContext *C, Panel *pa)
}
}
-static void sculptmode_draw_interface_tools(Scene *scene, uiBlock *block, unsigned short cx, unsigned short cy)
-{
- Sculpt *s = scene->toolsettings->sculpt;
-
- //XXX if(sd->brush_type != SMOOTH_BRUSH && sd->brush_type != GRAB_BRUSH && sd->brush_type != FLATTEN_BRUSH) {
- {
- /*uiDefButBitS(block,ROW,B_NOP,"Add",cx,cy,89,19,&br->dir,15.0,1.0,0, 0,"Add depth to model [Shift]");
- uiDefButBitS(block,ROW,B_NOP,"Sub",cx+89,cy,89,19,&br->dir,15.0,2.0,0, 0,"Subtract depth from model [Shift]");
- */}
- //XXX if(sd->brush_type!=GRAB_BRUSH)
-
- uiBlockBeginAlign(block);
- uiDefBut( block,LABEL,B_NOP,"Symmetry",cx,cy,90,19,NULL,0,0,0,0,"");
- cy-= 20;
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, SCULPT_SYMM_X, B_NOP, "X", cx,cy,40,19, &s->flags, 0,0,0,0, "Mirror brush across X axis");
- uiDefButBitI(block, TOG, SCULPT_SYMM_Y, B_NOP, "Y", cx+40,cy,40,19, &s->flags, 0,0,0,0, "Mirror brush across Y axis");
- uiDefButBitI(block, TOG, SCULPT_SYMM_Z, B_NOP, "Z", cx+80,cy,40,19, &s->flags, 0,0,0,0, "Mirror brush across Z axis");
- uiBlockEndAlign(block);
-
-
- cy+= 20;
- uiBlockBeginAlign(block);
- uiDefBut( block,LABEL,B_NOP,"LockAxis",cx+140,cy,90,19,NULL,0,0,0,0,"");
- cy-= 20;
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, SCULPT_LOCK_X, B_NOP, "X", cx+140,cy,40,19, &s->flags, 0,0,0,0, "Constrain X axis");
- uiDefButBitI(block, TOG, SCULPT_LOCK_Y, B_NOP, "Y", cx+180,cy,40,19, &s->flags, 0,0,0,0, "Constrain Y axis");
- uiDefButBitI(block, TOG, SCULPT_LOCK_Z, B_NOP, "Z", cx+220,cy,40,19, &s->flags, 0,0,0,0, "Constrain Z axis");
- uiBlockEndAlign(block);
-
- cx+= 210;
-}
-
-
static void view3d_panel_object(const bContext *C, Panel *pa)
{
uiBlock *block;
@@ -1278,10 +1243,6 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
/* 'f' is for floating panel */
uiBlockPickerButtons(block, (*br)->rgb, hsv, old, hexcol, 'f', B_REDR);
}
- else if(G.f & G_SCULPTMODE) {
- BLI_strncpy(pa->drawname, "Sculpt Properties", sizeof(pa->drawname));
- sculptmode_draw_interface_tools(scene, block, 10, 150);
- }
else if(G.f & G_PARTICLEEDIT){
BLI_strncpy(pa->drawname, "Particle Edit Properties", sizeof(pa->drawname));
// XXX particle_edit_buttons(block);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index f300ab1b26f..8d0fc4f6a8b 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -213,6 +213,10 @@ void rna_def_sculpt(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Sculpt", NULL);
RNA_def_struct_nested(brna, srna, "Scene");
RNA_def_struct_ui_text(srna, "Sculpt", "");
+
+ prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Brush");
+ RNA_def_property_ui_text(prop, "Brush", "");
prop= RNA_def_property(srna, "symmetry_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X);