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:
authorMiika Hamalainen <blender@miikah.org>2011-11-10 14:24:34 +0400
committerMiika Hamalainen <blender@miikah.org>2011-11-10 14:24:34 +0400
commitafeb0eeaf0e8caf5e46a5dd6fbea3786e9fb1354 (patch)
tree36ab74ff3fa36d27c0f35527d3b55e68e3d27fe5 /source/blender/editors/interface
parent1e035381d10068eb17345a88d42cebc0d579adf3 (diff)
parent1b4a54ad73c058baa59ffdc9e5f18b0b79030fb0 (diff)
Dynamic Paint merge:
Commit Dynamic Paint from "soc-2011-carrot" branch into trunk. End-user documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Modifiers/Simulation/Dynamic_Paint GSoC wiki page: http://wiki.blender.org/index.php/User:MiikaH/GSoC-2011-DynamicPaint
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_templates.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 6cd538112e6..795446e76ef 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -32,6 +32,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
+#include "DNA_dynamicpaint_types.h"
#include "DNA_key_types.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
@@ -45,6 +46,7 @@
#include "BKE_animsys.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
+#include "BKE_dynamicpaint.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
@@ -691,7 +693,7 @@ static int modifier_can_delete(ModifierData *md)
static int modifier_is_simulation(ModifierData *md)
{
// Physic Tab
- if(ELEM6(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke, eModifierType_Softbody, eModifierType_Surface)) {
+ if(ELEM7(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke, eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint)) {
return 1;
}
// Particle Tab
@@ -2054,6 +2056,13 @@ static int list_item_icon_get(bContext *C, PointerRNA *itemptr, int rnaicon, int
else if(RNA_struct_is_a(itemptr->type, &RNA_TextureSlot)) {
id= RNA_pointer_get(itemptr, "texture").data;
}
+ else if(RNA_struct_is_a(itemptr->type, &RNA_DynamicPaintSurface)) {
+ DynamicPaintSurface *surface= (DynamicPaintSurface*)itemptr->data;
+
+ if (surface->format == MOD_DPAINT_SURFACE_F_PTEX) return ICON_TEXTURE_SHADED;
+ else if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) return ICON_OUTLINER_DATA_MESH;
+ else if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) return ICON_FILE_IMAGE;
+ }
/* get icon from ID */
if(id) {
@@ -2171,6 +2180,25 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
/* nothing else special to do... */
uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
}
+ else if(itemptr->type == &RNA_DynamicPaintSurface) {
+ char name_final[96];
+ const char *enum_name;
+ PropertyRNA *prop = RNA_struct_find_property(itemptr, "surface_type");
+ DynamicPaintSurface *surface= (DynamicPaintSurface*)itemptr->data;
+
+ RNA_property_enum_name(C, itemptr, prop, RNA_property_enum_get(itemptr, prop), &enum_name);
+
+ BLI_snprintf(name_final, sizeof(name_final), "%s (%s)",name,enum_name);
+ uiItemL(sub, name_final, icon);
+ if (dynamicPaint_surfaceHasColorPreview(surface)) {
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ uiDefIconButR(block, OPTION, 0, (surface->flags & MOD_DPAINT_PREVIEW) ? ICON_RESTRICT_VIEW_OFF : ICON_RESTRICT_VIEW_ON,
+ 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "show_preview", 0, 0, 0, 0, 0, NULL);
+ uiBlockSetEmboss(block, UI_EMBOSS);
+ }
+ uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "is_active", i, 0, 0, 0, 0, NULL);
+ }
+
/* There is a last chance to display custom controls (in addition to the name/label):
* If the given item property group features a string property named as prop_list,
* this tries to add controls for all properties of the item listed in that string property.