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
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-01-03 11:37:18 +0300
committerMatt Ebb <matt@mke3.net>2010-01-03 11:37:18 +0300
commit251ef0a47f34806b911ab18b59f604dd0ef3ea5b (patch)
tree23574564a0d36337c8d2338197c1527cc77e76ca /source/blender/makesrna/intern/rna_brush.c
parentca4a5f309eed9922eb7d5188173942f36a5adc0d (diff)
Changes to Brush texture workflow
This changes how textures are accessed from Brushes, with the intention of simplifying the workflow, and reducing the amount of clicking. Rather than the previous texture slots (which didn't work as a stack anyway), brushes now have a single texture linked. Rather than taking time having to set up your slots in advance, you can now select and change textures directly as you sculpt/paint on the fly. For complex brushes, node textures can be used, or for fast access, it's easy to make a duplicate of your brush with the texture you like and assign a hotkey. Brush textures can now be chosen from a new Textures panel in the brush tool properties - click on the thumbnail to open a texture selector. This is done using a new variation on the ID template - the number of rows and columns to display in the popup can be customised in the UI scripts.
Diffstat (limited to 'source/blender/makesrna/intern/rna_brush.c')
-rw-r--r--source/blender/makesrna/intern/rna_brush.c37
1 files changed, 12 insertions, 25 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 7f7126c659a..8f8dd4681ab 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -33,6 +33,7 @@
#include "DNA_texture_types.h"
#include "IMB_imbuf.h"
+#include "WM_types.h"
EnumPropertyItem brush_sculpt_tool_items[] = {
{SCULPT_TOOL_DRAW, "DRAW", 0, "Draw", ""},
@@ -52,29 +53,6 @@ EnumPropertyItem brush_sculpt_tool_items[] = {
#include "BKE_texture.h"
#include "WM_api.h"
-#include "WM_types.h"
-
-static void rna_Brush_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
-{
- Brush *brush= (Brush*)ptr->data;
- rna_iterator_array_begin(iter, (void*)brush->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
-}
-
-static PointerRNA rna_Brush_active_texture_get(PointerRNA *ptr)
-{
- Brush *br= (Brush*)ptr->data;
- Tex *tex;
-
- tex= give_current_brush_texture(br);
- return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
-}
-
-static void rna_Brush_active_texture_set(PointerRNA *ptr, PointerRNA value)
-{
- Brush *br= (Brush*)ptr->data;
-
- set_current_brush_texture(br, value.data);
-}
static void rna_Brush_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -291,8 +269,17 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Brush_update");
/* texture */
- rna_def_mtex_common(srna, "rna_Brush_mtex_begin", "rna_Brush_active_texture_get",
- "rna_Brush_active_texture_set", "BrushTextureSlot", "rna_Brush_update");
+ prop= RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "BrushTextureSlot");
+ RNA_def_property_pointer_sdna(prop, NULL, "mtex");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Texture Slot", "");
+
+ prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "mtex.tex");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Texture", "");
+ RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_update");
/* clone tool */
prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);