diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-11-13 03:12:30 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-11-13 03:12:30 +0400 |
commit | 0ca96e1eb1da42268c11c286c74e79ed31da2c37 (patch) | |
tree | 52bcd0a8f871b8cb491a7604ed1c8001832e78fc /source/blender/makesrna | |
parent | 1ae159bff4c9c1d2e26df81744ab73c388b3bbe1 (diff) | |
parent | fc42a6185ddeb6a24ec92287dfa7b89beb059716 (diff) |
Merged changes in the trunk up to revision 41768.
Conflicts resolved:
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_enum_types.h
source/blender/render/intern/source/shadeinput.c
source/blenderplayer/bad_level_call_stubs/stubs.c
Additional changes:
* source/blender/makesrna/intern/rna_linestyle.c: Fixed white
space issues that generated a number of compiler errors. The
problem was that two string literals for enumerating MA_RAMP_SOFT
and MA_RAMP_LINEAR contained a space. The string literals are
supposed to represent a valid C identifier because of their use
for automatic code generation.
* Stroke transparency has been temporarily disabled due to a
functionality conflict with some merged changes. A fix of this
issue is planned.
Diffstat (limited to 'source/blender/makesrna')
28 files changed, 1353 insertions, 68 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 1e0231fd4a6..c34f319b0a1 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -197,6 +197,10 @@ extern StructRNA RNA_Driver; extern StructRNA RNA_DriverTarget; extern StructRNA RNA_DriverVariable; extern StructRNA RNA_DupliObject; +extern StructRNA RNA_DynamicPaintBrushSettings; +extern StructRNA RNA_DynamicPaintCanvasSettings; +extern StructRNA RNA_DynamicPaintModifier; +extern StructRNA RNA_DynamicPaintSurface; extern StructRNA RNA_EdgeSplitModifier; extern StructRNA RNA_EditBone; extern StructRNA RNA_EffectSequence; @@ -656,6 +660,8 @@ StructRNA *RNA_struct_base(StructRNA *type); int RNA_struct_is_ID(StructRNA *type); int RNA_struct_is_a(StructRNA *type, StructRNA *srna); +int RNA_struct_undo_check(StructRNA *type); + StructRegisterFunc RNA_struct_register(StructRNA *type); StructUnregisterFunc RNA_struct_unregister(StructRNA *type); void **RNA_struct_instance(PointerRNA *ptr); diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 41483213bd4..509db622b70 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -114,6 +114,8 @@ extern EnumPropertyItem node_filter_items[]; extern EnumPropertyItem ramp_blend_items[]; +extern EnumPropertyItem prop_dynamicpaint_type_items[]; + extern EnumPropertyItem linestyle_color_modifier_type_items[]; extern EnumPropertyItem linestyle_alpha_modifier_type_items[]; extern EnumPropertyItem linestyle_thickness_modifier_type_items[]; diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 418a41c72ba..1655665efe3 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -326,12 +326,13 @@ typedef enum StructFlag { /* indicates that this struct is an ID struct, and to use refcounting */ STRUCT_ID = 1, STRUCT_ID_REFCOUNT = 2, + STRUCT_UNDO = 4, /* defaults on, clear for user preferences and similar */ /* internal flags */ - STRUCT_RUNTIME = 4, - STRUCT_GENERATED = 8, - STRUCT_FREE_POINTERS = 16, - STRUCT_NO_IDPROPERTIES = 32 /* Menu's and Panels don't need properties */ + STRUCT_RUNTIME = 8, + STRUCT_GENERATED = 16, + STRUCT_FREE_POINTERS = 32, + STRUCT_NO_IDPROPERTIES = 64 /* Menu's and Panels don't need properties */ } StructFlag; typedef int (*StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_function); diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 9f248f973a1..c4b3f204b23 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -66,4 +66,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') -env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] ) +rnalib = env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] ) + +Return ('rnalib') diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 8038dc2b04a..f61db894263 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -46,6 +46,7 @@ set(DEFSRC rna_context.c rna_controller.c rna_curve.c + rna_dynamicpaint.c rna_fcurve.c rna_fluidsim.c rna_gpencil.c diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 9cb2706886a..b6ddfe39e9d 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -2440,6 +2440,7 @@ static RNAProcessItem PROCESS_ITEMS[]= { {"rna_context.c", NULL, RNA_def_context}, {"rna_controller.c", "rna_controller_api.c", RNA_def_controller}, {"rna_curve.c", NULL, RNA_def_curve}, + {"rna_dynamicpaint.c", NULL, RNA_def_dynamic_paint}, {"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve}, {"rna_fluidsim.c", NULL, RNA_def_fluidsim}, {"rna_gpencil.c", NULL, RNA_def_gpencil}, diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 793d0112af7..6f9c7a8f19b 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -549,6 +549,11 @@ int RNA_struct_is_ID(StructRNA *type) return (type->flag & STRUCT_ID) != 0; } +int RNA_struct_undo_check(StructRNA *type) +{ + return (type->flag & STRUCT_UNDO) != 0; +} + int RNA_struct_idprops_register_check(StructRNA *type) { return (type->flag & STRUCT_NO_IDPROPERTIES) == 0; diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c index e65b137e846..29133db8101 100644 --- a/source/blender/makesrna/intern/rna_animviz.c +++ b/source/blender/makesrna/intern/rna_animviz.c @@ -71,7 +71,7 @@ static void rna_AnimViz_path_start_frame_set(PointerRNA *ptr, int value) { bAnimVizSettings *data= (bAnimVizSettings*)ptr->data; - CLAMP(value, 1, data->path_ef); + CLAMP(value, 1, data->path_ef-1); data->path_sf= value; } @@ -79,7 +79,8 @@ static void rna_AnimViz_path_end_frame_set(PointerRNA *ptr, int value) { bAnimVizSettings *data= (bAnimVizSettings*)ptr->data; - CLAMP(value, data->path_sf, (int)(MAXFRAMEF/2)); + // XXX: watchit! Path Start > MAXFRAME/2 could be a problem... + CLAMP(value, data->path_sf+1, (int)(MAXFRAMEF/2)); data->path_ef= value; } diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 93fdc2b2136..95f44d86058 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1394,11 +1394,12 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Curve_update_data"); /* not supported yet - prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); - RNA_def_property_float(prop, NULL, "rot"); - RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); - RNA_def_property_editable_func(prop, texspace_editable); - RNA_def_property_update(prop, 0, "rna_Curve_update_data");*/ + prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); + RNA_def_property_float(prop, NULL, "rot"); + RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); + RNA_def_property_editable_func(prop, texspace_editable); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + */ prop= RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index ff1bfce2d2f..d4756ecfefa 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -654,6 +654,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char * srna->identifier= identifier; srna->name= identifier; /* may be overwritten later RNA_def_struct_ui_text */ srna->description= ""; + srna->flag |= STRUCT_UNDO; if(!srnafrom) srna->icon= ICON_DOT; diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c new file mode 100644 index 00000000000..00a73afb789 --- /dev/null +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -0,0 +1,911 @@ +/** + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * Contributor(s): Miika Hämäläinen + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include <stdlib.h> +#include <limits.h> + +#include "RNA_define.h" + +#include "rna_internal.h" + +#include "BKE_modifier.h" +#include "BKE_dynamicpaint.h" + +#include "DNA_dynamicpaint_types.h" +#include "DNA_modifier_types.h" +#include "DNA_object_force.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#include "WM_types.h" + +EnumPropertyItem prop_dynamicpaint_type_items[] = { + {MOD_DYNAMICPAINT_TYPE_CANVAS, "CANVAS", 0, "Canvas", ""}, + {MOD_DYNAMICPAINT_TYPE_BRUSH, "BRUSH", 0, "Brush", ""}, + {0, NULL, 0, NULL, NULL}}; + + +#ifdef RNA_RUNTIME + +#include "BKE_context.h" +#include "BKE_depsgraph.h" +#include "BKE_particle.h" + + +static char *rna_DynamicPaintCanvasSettings_path(PointerRNA *ptr) +{ + DynamicPaintCanvasSettings *settings = (DynamicPaintCanvasSettings*)ptr->data; + ModifierData *md= (ModifierData *)settings->pmd; + + return BLI_sprintfN("modifiers[\"%s\"].canvas_settings", md->name); +} + +static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr) +{ + DynamicPaintBrushSettings *settings = (DynamicPaintBrushSettings*)ptr->data; + ModifierData *md= (ModifierData *)settings->pmd; + + return BLI_sprintfN("modifiers[\"%s\"].brush_settings", md->name); +} + +static char *rna_DynamicPaintSurface_path(PointerRNA *ptr) +{ + DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data; + ModifierData *md= (ModifierData *)surface->canvas->pmd; + + return BLI_sprintfN("modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"]", md->name, surface->name); +} + + +/* +* Surfaces +*/ + +static void rna_DynamicPaint_redoModifier(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); +} + +static void rna_DynamicPaintSurfaces_updateFrames(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + dynamicPaint_cacheUpdateFrames((DynamicPaintSurface*)ptr->data); +} + +static void rna_DynamicPaintSurface_reset(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + dynamicPaint_resetSurface((DynamicPaintSurface*)ptr->data); + rna_DynamicPaint_redoModifier(bmain, scene, ptr); +} + +static void rna_DynamicPaintSurface_initialcolortype(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data; + + surface->init_layername[0] = '\0'; + dynamicPaint_clearSurface(surface); + rna_DynamicPaint_redoModifier(bmain, scene, ptr); +} + +static void rna_DynamicPaintSurface_changePreview(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + DynamicPaintSurface *act_surface = (DynamicPaintSurface*)ptr->data; + DynamicPaintSurface *surface = act_surface->canvas->surfaces.first; + + /* since only one color surface can show preview at time + * disable preview on other surfaces*/ + for(; surface; surface=surface->next) { + if(surface != act_surface) + surface->flags &= ~MOD_DPAINT_PREVIEW; + } + rna_DynamicPaint_redoModifier(bmain, scene, ptr); +} + +static void rna_DynamicPaintSurface_uniqueName(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + dynamicPaintSurface_setUniqueName((DynamicPaintSurface*)ptr->data, ((DynamicPaintSurface*)ptr->data)->name); +} + + +static void rna_DynamicPaintSurface_changeType(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + dynamicPaintSurface_updateType((DynamicPaintSurface*)ptr->data); + dynamicPaint_resetSurface((DynamicPaintSurface*)ptr->data); + rna_DynamicPaintSurface_reset(bmain, scene, ptr); +} + +static void rna_DynamicPaintSurfaces_changeFormat(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data; + + surface->type = MOD_DPAINT_SURFACE_T_PAINT; + dynamicPaintSurface_updateType((DynamicPaintSurface*)ptr->data); + rna_DynamicPaintSurface_reset(bmain, scene, ptr); +} + +static void rna_DynamicPaint_resetDependancy(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + rna_DynamicPaintSurface_reset(bmain, scene, ptr); + DAG_scene_sort(bmain, scene); +} + +static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr) +{ + DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data; + DynamicPaintSurface *surface = canvas->surfaces.first; + int id=0; + + for(; surface; surface=surface->next) { + if(id == canvas->active_sur) + return rna_pointer_inherit_refine(ptr, &RNA_DynamicPaintSurface, surface); + id++; + } + return rna_pointer_inherit_refine(ptr, &RNA_DynamicPaintSurface, NULL); +} + +static void rna_DynamicPaint_surfaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data; + //rna_iterator_array_begin(iter, (void*)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0); + rna_iterator_listbase_begin(iter, &canvas->surfaces, NULL); +} + +static int rna_Surface_active_point_index_get(PointerRNA *ptr) +{ + DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data; + return canvas->active_sur; +} + +static void rna_Surface_active_point_index_set(struct PointerRNA *ptr, int value) +{ + DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data; + canvas->active_sur = value; + return; +} + +static void rna_Surface_active_point_range(PointerRNA *ptr, int *min, int *max) +{ + DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data; + + *min= 0; + *max= BLI_countlist(&canvas->surfaces)-1; +} + +/* uvlayer */ +static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value) +{ + DynamicPaintCanvasSettings *canvas= ((DynamicPaintSurface*)ptr->data)->canvas; + DynamicPaintSurface *surface = canvas->surfaces.first; + int id=0; + + for(; surface; surface=surface->next) { + if(id == canvas->active_sur) { + rna_object_uvlayer_name_set(ptr, value, surface->uvlayer_name, sizeof(surface->uvlayer_name)); + return; + } + id++; + } +} + +/* is point cache used */ +static int rna_DynamicPaint_uses_cache_get(PointerRNA *ptr) +{ + DynamicPaintSurface *surface= (DynamicPaintSurface*)ptr->data; + + return (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) ? 1 : 0; +} + +static void rna_DynamicPaint_uses_cache_set(PointerRNA *ptr, int value) +{ +} + +/* does output layer exist*/ +static int rna_DynamicPaint_is_output_exists(DynamicPaintSurface *surface, Object *ob, int index) +{ + return dynamicPaint_outputLayerExists(surface, ob, index); +} + + +static EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) +{ + DynamicPaintSurface *surface= (DynamicPaintSurface*)ptr->data; + + EnumPropertyItem *item= NULL; + EnumPropertyItem tmp= {0, "", 0, "", ""}; + int totitem= 0; + + /* Paint type - available for all formats */ + tmp.value = MOD_DPAINT_SURFACE_T_PAINT; + tmp.identifier = "PAINT"; + tmp.name = "Paint"; + RNA_enum_item_add(&item, &totitem, &tmp); + + /* Displace */ + if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX || + surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) { + tmp.value = MOD_DPAINT_SURFACE_T_DISPLACE; + tmp.identifier = "DISPLACE"; + tmp.name = "Displace"; + RNA_enum_item_add(&item, &totitem, &tmp); + } + + /* Weight */ + if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) { + tmp.value = MOD_DPAINT_SURFACE_T_WEIGHT; + tmp.identifier = "WEIGHT"; + tmp.name = "Weight"; + RNA_enum_item_add(&item, &totitem, &tmp); + } + + /* Height waves */ + { + tmp.value = MOD_DPAINT_SURFACE_T_WAVE; + tmp.identifier = "WAVE"; + tmp.name = "Waves"; + RNA_enum_item_add(&item, &totitem, &tmp); + } + + RNA_enum_item_end(&item, &totitem); + *free = 1; + + return item; +} + +#else + +/* canvas.canvas_surfaces */ +static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + PropertyRNA *prop; + + RNA_def_property_srna(cprop, "DynamicPaintSurfaces"); + srna= RNA_def_struct(brna, "DynamicPaintSurfaces", NULL); + RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings"); + RNA_def_struct_ui_text(srna, "Canvas Surfaces", "Collection of Dynamic Paint Canvas surfaces"); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_funcs(prop, "rna_Surface_active_point_index_get", "rna_Surface_active_point_index_set", "rna_Surface_active_point_range"); + RNA_def_property_ui_text(prop, "Active Point Cache Index", ""); + + prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "DynamicPaintSurface"); + RNA_def_property_pointer_funcs(prop, "rna_PaintSurface_active_get", NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "Active Surface", "Active Dynamic Paint surface being displayed"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); +} + + +static void rna_def_canvas_surface(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + PropertyRNA *parm; + FunctionRNA *func; + + /* Surface format */ + static EnumPropertyItem prop_dynamicpaint_surface_format[] = { + //{MOD_DPAINT_SURFACE_F_PTEX, "PTEX", ICON_TEXTURE_SHADED, "Ptex", ""}, + {MOD_DPAINT_SURFACE_F_VERTEX, "VERTEX", ICON_OUTLINER_DATA_MESH, "Vertex", ""}, + {MOD_DPAINT_SURFACE_F_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""}, + {0, NULL, 0, NULL, NULL}}; + + /* Surface type - generated dynamically based on surface format */ + static EnumPropertyItem prop_dynamicpaint_surface_type[] = { + {MOD_DPAINT_SURFACE_T_PAINT, "PAINT", 0, "Paint", ""}, + {0, NULL, 0, NULL, NULL}}; + + /* Surface output preview. currently only paint has multiple outputs */ + static EnumPropertyItem prop_dynamicpaint_surface_preview[] = { + {MOD_DPAINT_SURFACE_PREV_PAINT, "PAINT", 0, "Paint", ""}, + {MOD_DPAINT_SURFACE_PREV_WETMAP, "WETMAP", 0, "Wetmap", ""}, + {0, NULL, 0, NULL, NULL}}; + + /* Initial color setting */ + static EnumPropertyItem prop_dynamicpaint_init_color_type[] = { + {MOD_DPAINT_INITIAL_NONE, "NONE", 0, "None", ""}, + {MOD_DPAINT_INITIAL_COLOR, "COLOR", ICON_COLOR, "Color", ""}, + {MOD_DPAINT_INITIAL_TEXTURE, "TEXTURE", ICON_TEXTURE, "UV Texture", ""}, + {MOD_DPAINT_INITIAL_VERTEXCOLOR, "VERTEX_COLOR", ICON_GROUP_VCOL, "Vertex Color", ""}, + {0, NULL, 0, NULL, NULL}}; + + /* Effect type + * Only used by ui to view per effect settings */ + static EnumPropertyItem prop_dynamicpaint_effecttype[] = { + {1, "SPREAD", 0, "Spread", ""}, + {2, "DRIP", 0, "Drip", ""}, + {3, "SHRINK", 0, "Shrink", ""}, + {0, NULL, 0, NULL, NULL}}; + + /* Displacemap file format */ + static EnumPropertyItem prop_dynamicpaint_image_fileformat[] = { + {MOD_DPAINT_IMGFORMAT_PNG, "PNG", 0, "PNG", ""}, +#ifdef WITH_OPENEXR + {MOD_DPAINT_IMGFORMAT_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, +#endif + {0, NULL, 0, NULL, NULL}}; + + /* Displacemap type */ + static EnumPropertyItem prop_dynamicpaint_displace_type[] = { + {MOD_DPAINT_DISP_DISPLACE, "DISPLACE", 0, "Displacement", ""}, + {MOD_DPAINT_DISP_DEPTH, "DEPTH", 0, "Depth", ""}, + {0, NULL, 0, NULL, NULL}}; + + + + /* Surface */ + srna= RNA_def_struct(brna, "DynamicPaintSurface", NULL); + RNA_def_struct_sdna(srna, "DynamicPaintSurface"); + RNA_def_struct_ui_text(srna, "Paint Surface", "A canvas surface layer"); + RNA_def_struct_path_func(srna, "rna_DynamicPaintSurface_path"); + + prop= RNA_def_property(srna, "surface_format", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_sdna(prop, NULL, "format"); + RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_format); + RNA_def_property_ui_text(prop, "Format", "Surface Format"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat"); + + prop= RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_DynamicPaint_surface_type_itemf"); + RNA_def_property_ui_text(prop, "Surface Type", "Surface Type"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changeType"); + + prop= RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ACTIVE); + RNA_def_property_ui_text(prop, "Is Active", "Toggle whether surface is processed or ignored"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "show_preview", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PREVIEW); + RNA_def_property_ui_text(prop, "Show Preview", "Display surface preview in 3D-views"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changePreview"); + + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_ui_text(prop, "Name", "Surface name"); + RNA_def_property_update(prop, NC_OBJECT, "rna_DynamicPaintSurface_uniqueName"); + RNA_def_struct_name_property(srna, prop); + + prop= RNA_def_property(srna, "brush_group", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Group"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Brush Group", "Only use brush objects from this group"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_resetDependancy"); + + + /* + * Paint, wet and displace + */ + + prop= RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE); + RNA_def_property_ui_text(prop, "Dissolve", "Enable to make surface changes disappear over time"); + + prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "diss_speed"); + RNA_def_property_range(prop, 1.0, 10000.0); + RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, 0); + RNA_def_property_ui_text(prop, "Dissolve Speed", "Approximately in how many frames should dissolve happen"); + + prop= RNA_def_property(srna, "dry_speed", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 1.0, 10000.0); + RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, 0); + RNA_def_property_ui_text(prop, "Dry Speed", "Approximately in how many frames should drying happen"); + + /* + * Simulation settings + */ + prop= RNA_def_property(srna, "image_resolution", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 16.0, 4096.0); + RNA_def_property_ui_range(prop, 16.0, 4096.0, 1, 0); + RNA_def_property_ui_text(prop, "Resolution", "Output image resolution"); + + prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); + RNA_def_property_ui_text(prop, "UV Layer", "UV layer name"); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DynamicPaint_uvlayer_set"); + + prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "start_frame"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 1.0, 9999.0); + RNA_def_property_ui_range(prop, 1.0, 9999, 1, 0); + RNA_def_property_ui_text(prop, "Start Frame", "Simulation start frame"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames"); + + prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "end_frame"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 1.0, 9999.0); + RNA_def_property_ui_range(prop, 1.0, 9999.0, 1, 0); + RNA_def_property_ui_text(prop, "End Frame", "Simulation end frame"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames"); + + prop= RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "substeps"); + RNA_def_property_range(prop, 0.0, 10.0); + RNA_def_property_ui_range(prop, 0.0, 10, 1, 0); + RNA_def_property_ui_text(prop, "Sub-Steps", "Do extra frames between scene frames to ensure smooth motion"); + + prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ANTIALIAS); + RNA_def_property_ui_text(prop, "Anti-aliasing", "Use 5x multisampling to smoothen paint edges"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + + /* + * Initial Color + */ + + prop= RNA_def_property(srna, "init_color_type", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, prop_dynamicpaint_init_color_type); + RNA_def_property_ui_text(prop, "Initial Color", ""); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_initialcolortype"); + + prop= RNA_def_property(srna, "init_color", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 4); + RNA_def_property_ui_text(prop, "Color", "Initial color of the surface"); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + + prop= RNA_def_property(srna, "init_texture", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Texture", ""); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + + prop= RNA_def_property(srna, "init_layername", PROP_STRING, PROP_NONE); + RNA_def_property_ui_text(prop, "Data Layer", ""); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + + /* + * Effect Settings + */ + prop= RNA_def_property(srna, "effect_ui", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, prop_dynamicpaint_effecttype); + RNA_def_property_ui_text(prop, "Effect Type", ""); + + prop= RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DRY_LOG); + RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying. Makes high values to fade faster than low values"); + + prop= RNA_def_property(srna, "use_dissolve_log", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE_LOG); + RNA_def_property_ui_text(prop, "Slow", "Use logarithmic dissolve. Makes high values to fade faster than low values"); + + prop= RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SPREAD); + RNA_def_property_ui_text(prop, "Use Spread", "Processes spread effect. Spreads wet paint around surface"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + + prop= RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "spread_speed"); + RNA_def_property_range(prop, 0.001, 10.0); + RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2); + RNA_def_property_ui_text(prop, "Spread Speed", "How fast spread effect moves on the canvas surface"); + + prop= RNA_def_property(srna, "color_spread_speed", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "color_spread_speed"); + RNA_def_property_range(prop, 0.0, 2.0); + RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2); + RNA_def_property_ui_text(prop, "Color Spread", "How fast colors get mixed within wet paint"); + + prop= RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_DRIP); + RNA_def_property_ui_text(prop, "Use Drip", "Processes drip effect. Drips wet paint to gravity direction"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + + prop= RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SHRINK); + RNA_def_property_ui_text(prop, "Use Shrink", "Processes shrink effect. Shrinks paint areas"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + + prop= RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "shrink_speed"); + RNA_def_property_range(prop, 0.001, 10.0); + RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2); + RNA_def_property_ui_text(prop, "Shrink Speed", "How fast shrink effect moves on the canvas surface"); + + prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "EffectorWeights"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Effector Weights", ""); + + prop= RNA_def_property(srna, "drip_velocity", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "drip_vel"); + RNA_def_property_range(prop, -200.0f, 200.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); + RNA_def_property_ui_text(prop, "Velocity", "Defines how much surface velocity affects dripping"); + + prop= RNA_def_property(srna, "drip_acceleration", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "drip_acc"); + RNA_def_property_range(prop, -200.0f, 200.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); + RNA_def_property_ui_text(prop, "Acceleration", "Defines how much surface acceleration affects dripping"); + + /* + * Output settings + */ + prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_MULALPHA); + RNA_def_property_ui_text(prop, "Premultiply alpha", "Multiplies color by alpha. (Recommended for Blender input)"); + + prop= RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH); + RNA_def_property_string_sdna(prop, NULL, "image_output_path"); + RNA_def_property_ui_text(prop, "Output Path", "Directory to save the textures"); + + /* output for primary surface data */ + prop= RNA_def_property(srna, "output_name", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "output_name"); + RNA_def_property_ui_text(prop, "Output name", ""); + + prop= RNA_def_property(srna, "do_output1", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT1); + RNA_def_property_ui_text(prop, "Save layer", "Output name"); + + /* output for secondary sufrace data */ + prop= RNA_def_property(srna, "output_name2", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "output_name2"); + RNA_def_property_ui_text(prop, "Output name", "Output name"); + + prop= RNA_def_property(srna, "do_output2", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT2); + RNA_def_property_ui_text(prop, "Save layer", ""); + + prop= RNA_def_property(srna, "preview_id", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_sdna(prop, NULL, "preview_id"); + RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_preview); + RNA_def_property_ui_text(prop, "Preview", ""); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + /* to check if output name exists */ + func = RNA_def_function(srna, "output_exists", "rna_DynamicPaint_is_output_exists"); + RNA_def_function_ui_description(func, "Checks if surface output layer of given name exists"); + parm= RNA_def_pointer(func, "object", "Object", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + parm= RNA_def_int(func, "index", 0, 0, 1, "Index", "", 0, 1); + RNA_def_property_flag(parm, PROP_REQUIRED); + /* return type */ + parm= RNA_def_boolean(func, "exists", 0, "", ""); + RNA_def_function_return(func, parm); + + prop= RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.00, 50.0); + RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2); + RNA_def_property_ui_text(prop, "Max Displace", "Maximum level of depth intersection in object space. Use 0.0 to disable"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "disp_factor"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, -50.0, 50.0); + RNA_def_property_ui_range(prop, -5.0, 5.0, 1, 2); + RNA_def_property_ui_text(prop, "Displace Factor", "Strength of displace when applied to the mesh"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, prop_dynamicpaint_image_fileformat); + RNA_def_property_ui_text(prop, "File Format", ""); + + prop= RNA_def_property(srna, "displace_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "disp_type"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, prop_dynamicpaint_displace_type); + RNA_def_property_ui_text(prop, "Data Type", ""); + + prop= RNA_def_property(srna, "use_incremental_displace", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISP_INCREMENTAL); + RNA_def_property_ui_text(prop, "Incremental", "New displace is added cumulatively on top of existing"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + + /* wave simulator settings */ + prop= RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.001, 1.0); + RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2); + RNA_def_property_ui_text(prop, "Damping", "Wave damping factor"); + + prop= RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.01, 3.0); + RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2); + RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed"); + + prop= RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.01, 3.0); + RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2); + RNA_def_property_ui_text(prop, "Timescale", "Wave time scaling factor"); + + prop= RNA_def_property(srna, "wave_spring", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.001, 1.0); + RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2); + RNA_def_property_ui_text(prop, "Spring", "Spring force that pulls water level back to zero"); + + prop= RNA_def_property(srna, "wave_open_borders", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_WAVE_OPEN_BORDERS); + RNA_def_property_ui_text(prop, "Open Borders", "Passes waves through mesh edges"); + + + /* cache */ + prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "pointcache"); + RNA_def_property_ui_text(prop, "Point Cache", ""); + + /* is cache used */ + prop= RNA_def_property(srna, "uses_cache", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_uses_cache_get", "rna_DynamicPaint_uses_cache_set"); + RNA_def_property_ui_text(prop, "Uses Cache", ""); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); +} + +static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "DynamicPaintCanvasSettings", NULL); + RNA_def_struct_ui_text(srna, "Canvas Settings", "Dynamic Paint canvas settings"); + RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings"); + RNA_def_struct_path_func(srna, "rna_DynamicPaintCanvasSettings_path"); + + /* + * Surface Slots + */ + prop= RNA_def_property(srna, "canvas_surfaces", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_funcs(prop, "rna_DynamicPaint_surfaces_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); + RNA_def_property_struct_type(prop, "DynamicPaintSurface"); + RNA_def_property_ui_text(prop, "Paint Surface List", "Paint surface list"); + rna_def_canvas_surfaces(brna, prop); +} + +static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + /* paint collision type */ + static EnumPropertyItem prop_dynamicpaint_collisiontype[] = { + {MOD_DPAINT_COL_PSYS, "PARTICLE_SYSTEM", ICON_PARTICLES, "Particle System", ""}, + {MOD_DPAINT_COL_POINT, "POINT", ICON_META_EMPTY, "Object Center", ""}, + {MOD_DPAINT_COL_DIST, "DISTANCE", ICON_META_EMPTY, "Proximity", ""}, + {MOD_DPAINT_COL_VOLDIST, "VOLUME_DISTANCE", ICON_META_CUBE, "Mesh Volume + Proximity", ""}, + {MOD_DPAINT_COL_VOLUME, "VOLUME", ICON_MESH_CUBE, "Mesh Volume", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem prop_dynamicpaint_prox_falloff[] = { + {MOD_DPAINT_PRFALL_SMOOTH, "SMOOTH", ICON_SPHERECURVE, "Smooth", ""}, + {MOD_DPAINT_PRFALL_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""}, + {MOD_DPAINT_PRFALL_RAMP, "RAMP", ICON_COLOR, "Color Ramp", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem prop_dynamicpaint_brush_wave_type[] = { + {MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""}, + {MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""}, + {MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem prop_dynamicpaint_brush_ray_dir[] = { + {MOD_DPAINT_RAY_CANVAS, "CANVAS", 0, "Canvas Normal", ""}, + {MOD_DPAINT_RAY_BRUSH_AVG, "BRUSH", 0, "Brush Normal", ""}, + {MOD_DPAINT_RAY_ZPLUS, "Z_AXIS", 0, "Z-Axis", ""}, + {0, NULL, 0, NULL, NULL}}; + + srna = RNA_def_struct(brna, "DynamicPaintBrushSettings", NULL); + RNA_def_struct_ui_text(srna, "Brush Settings", "Brush settings"); + RNA_def_struct_sdna(srna, "DynamicPaintBrushSettings"); + RNA_def_struct_path_func(srna, "rna_DynamicPaintBrushSettings_path"); + + /* + * Paint + */ + prop= RNA_def_property(srna, "paint_color", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "r"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Paint Color", "Color of the paint"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "paint_alpha", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "alpha"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); + RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_MATERIAL); + RNA_def_property_ui_text(prop, "Use object material", "Use object material to define color and influence"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "mat"); + RNA_def_property_ui_text(prop, "Material", "Material to use. If not defined, material linked to the mesh is used"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "absolute_alpha", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA); + RNA_def_property_ui_text(prop, "Absolute Alpha", "Only increase alpha value if paint alpha is higher than existing"); + + prop= RNA_def_property(srna, "paint_wetness", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "wetness"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); + RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness. Visible in wetmap. Some effects only affect wet paint"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "paint_erase", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ERASE); + RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_wave_type); + RNA_def_property_ui_text(prop, "Brush Effect", ""); + + prop= RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, -2.0, 2.0); + RNA_def_property_ui_range(prop, -1.0, 1.0, 5, 2); + RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave influence of this brush"); + + prop= RNA_def_property(srna, "wave_clamp", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.00, 50.0); + RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2); + RNA_def_property_ui_text(prop, "Clamp Waves", "Maximum level of surface intersection used to influence waves. Use 0.0 to disable"); + + prop= RNA_def_property(srna, "do_smudge", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DO_SMUDGE); + RNA_def_property_ui_text(prop, "Do Smudge", "Makes this brush to smudge existing paint as it moves"); + + prop= RNA_def_property(srna, "smudge_strength", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); + RNA_def_property_ui_text(prop, "Smudge Strength", "Smudge effect strength"); + + prop= RNA_def_property(srna, "max_velocity", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0001, 10.0); + RNA_def_property_ui_range(prop, 0.1, 2.0, 5, 2); + RNA_def_property_ui_text(prop, "Max Velocity", "Velocity considered as maximum influence. (Blender units per frame)"); + + prop= RNA_def_property(srna, "velocity_alpha", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_ALPHA); + RNA_def_property_ui_text(prop, "Multiply Alpha", "Multiply brush influence by velocity color ramp alpha"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "velocity_depth", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_DEPTH); + RNA_def_property_ui_text(prop, "Multiply Depth", "Multiply brush intersection depth (displace, waves) by velocity ramp alpha"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "velocity_color", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_COLOR); + RNA_def_property_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + /* + * Paint Area / Collision + */ + prop= RNA_def_property(srna, "paint_source", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_sdna(prop, NULL, "collision"); + RNA_def_property_enum_items(prop, prop_dynamicpaint_collisiontype); + RNA_def_property_ui_text(prop, "Paint Source", ""); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "paint_distance", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "paint_distance"); + RNA_def_property_range(prop, 0.0, 500.0); + RNA_def_property_ui_range(prop, 0.0, 500.0, 10, 3); + RNA_def_property_ui_text(prop, "Proximity Distance", "Maximum distance from brush to mesh surface to affect paint"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_RAMP_ALPHA); + RNA_def_property_ui_text(prop, "Only Use Alpha", "Only reads color ramp alpha"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff"); + RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff); + RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "proximity_project", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_PROJECT); + RNA_def_property_ui_text(prop, "Project", "Brush is projected to canvas from defined direction within brush proximity"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "ray_dir"); + RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_ray_dir); + RNA_def_property_ui_text(prop, "Ray Direction", "Defines ray direction to use for projection. If brush object is located in that direction it's painted"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "proximity_inverse", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_INVERSE_PROX); + RNA_def_property_ui_text(prop, "Inner Proximity", "Proximity falloff is applied inside the volume"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "negate_volume", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_NEGATE_VOLUME); + RNA_def_property_ui_text(prop, "Negate Volume", "Negate influence inside the volume"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + + /* + * Particle + */ + prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "psys"); + RNA_def_property_struct_type(prop, "ParticleSystem"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Particle Systems", "The particle system to paint with"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_resetDependancy"); + + + prop= RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PART_RAD); + RNA_def_property_ui_text(prop, "Use Particle Radius", "Uses radius from particle settings"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "particle_radius"); + RNA_def_property_range(prop, 0.01, 10.0); + RNA_def_property_ui_range(prop, 0.01, 2.0, 5, 3); + RNA_def_property_ui_text(prop, "Solid Radius", "Radius that will be painted solid"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "smooth_radius", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "particle_smooth"); + RNA_def_property_range(prop, 0.0, 10.0); + RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 0); + RNA_def_property_ui_text(prop, "Smooth Radius", "Smooth falloff added after solid radius"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + + /* + * Color ramps + */ + prop= RNA_def_property(srna, "paint_ramp", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "paint_ramp"); + RNA_def_property_struct_type(prop, "ColorRamp"); + RNA_def_property_ui_text(prop, "Paint Color Ramp", "Color ramp used to define proximity falloff"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + + prop= RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp"); + RNA_def_property_struct_type(prop, "ColorRamp"); + RNA_def_property_ui_text(prop, "Velocity Color Ramp", "Color ramp used to define brush velocity effect"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); +} + +void RNA_def_dynamic_paint(BlenderRNA *brna) +{ + rna_def_dynamic_paint_canvas_settings(brna); + rna_def_dynamic_paint_brush_settings(brna); + rna_def_canvas_surface(brna); +} + +#endif diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 35513e12872..809127258c5 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -136,6 +136,7 @@ void RNA_def_constraint(struct BlenderRNA *brna); void RNA_def_context(struct BlenderRNA *brna); void RNA_def_controller(struct BlenderRNA *brna); void RNA_def_curve(struct BlenderRNA *brna); +void RNA_def_dynamic_paint(struct BlenderRNA *brna); void RNA_def_fluidsim(struct BlenderRNA *brna); void RNA_def_fcurve(struct BlenderRNA *brna); void RNA_def_gameproperty(struct BlenderRNA *brna); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 629711fcf96..5b71df86f30 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -265,7 +265,7 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Sun Size", "Sun size"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); - prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Backscattered Light", "Backscattered light"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c index 58be8fc62c4..736bc67a6ab 100644 --- a/source/blender/makesrna/intern/rna_linestyle.c +++ b/source/blender/makesrna/intern/rna_linestyle.c @@ -207,8 +207,8 @@ static void rna_def_modifier_type_common(StructRNA *srna, EnumPropertyItem *modi {MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""}, {MA_RAMP_VAL, "VALUE", 0, "Value", ""}, {MA_RAMP_COLOR, "COLOR", 0, "Color", ""}, - {MA_RAMP_SOFT, "SOFT LIGHT", 0, "Soft Light", ""}, - {MA_RAMP_LINEAR, "LINEAR LIGHT", 0, "Linear Light", ""}, + {MA_RAMP_SOFT, "SOFT_LIGHT", 0, "Soft Light", ""}, + {MA_RAMP_LINEAR, "LINEAR_LIGHT", 0, "Linear Light", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem value_blend_items[] = { diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 462156d4acc..fe2cfbd3bc0 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1955,11 +1955,12 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); /* not supported yet - prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); - RNA_def_property_float(prop, NULL, "rot"); - RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); - RNA_def_property_editable_func(prop, texspace_editable); - RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/ + prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); + RNA_def_property_float(prop, NULL, "rot"); + RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); + RNA_def_property_editable_func(prop, texspace_editable); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); + */ /* materials */ prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 2b847084e10..323fb6780fb 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -317,11 +317,12 @@ static void rna_def_metaball(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); /* not supported yet - prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); - RNA_def_property_float(prop, NULL, "rot"); - RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); - RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable"); - RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");*/ + prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); + RNA_def_property_float(prop, NULL, "rot"); + RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); + RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable"); + RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); + */ /* materials */ prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 5eb317ede3e..32665bef065 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -46,6 +46,7 @@ #include "BKE_animsys.h" #include "BKE_bmesh.h" /* For BevelModifierData */ +#include "BKE_dynamicpaint.h" #include "BKE_multires.h" #include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */ @@ -94,6 +95,7 @@ EnumPropertyItem modifier_type_items[] ={ {eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""}, {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""}, + {eModifierType_DynamicPaint, "DYNAMIC_PAINT", ICON_MOD_DYNAMICPAINT, "Dynamic Paint", ""}, {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -192,6 +194,8 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) return &RNA_VertexWeightMixModifier; case eModifierType_WeightVGProximity: return &RNA_VertexWeightProximityModifier; + case eModifierType_DynamicPaint: + return &RNA_DynamicPaintModifier; default: return &RNA_Modifier; } @@ -2008,6 +2012,31 @@ static void rna_def_modifier_smoke(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Smoke_set_type"); } +static void rna_def_modifier_dynamic_paint(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "DynamicPaintModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "Dynamic Paint Modifier", "Dynamic Paint modifier"); + RNA_def_struct_sdna(srna, "DynamicPaintModifierData"); + RNA_def_struct_ui_icon(srna, ICON_MOD_DYNAMICPAINT); + + prop= RNA_def_property(srna, "canvas_settings", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "canvas"); + RNA_def_property_ui_text(prop, "Canvas Settings", ""); + + prop= RNA_def_property(srna, "brush_settings", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "brush"); + RNA_def_property_ui_text(prop, "Brush Settings", ""); + + prop= RNA_def_property(srna, "ui_type", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, prop_dynamicpaint_type_items); + RNA_def_property_ui_text(prop, "Type", ""); +} + static void rna_def_modifier_collision(BlenderRNA *brna) { StructRNA *srna; @@ -2880,6 +2909,7 @@ void RNA_def_modifier(BlenderRNA *brna) rna_def_modifier_weightvgedit(brna); rna_def_modifier_weightvgmix(brna); rna_def_modifier_weightvgproximity(brna); + rna_def_modifier_dynamic_paint(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index afdf3cd9c46..91e082cdeae 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -66,24 +66,6 @@ static void rna_MovieClip_size_get(PointerRNA *ptr, int *values) values[1]= clip->lastsize[1]; } -static void rna_MovieClip_resolution_get(PointerRNA *ptr, float *values) -{ - MovieClip *clip= (MovieClip*)ptr->id.data; - ImBuf *ibuf; - - ibuf= BKE_movieclip_get_ibuf(clip, NULL); - if (ibuf) { - values[0]= ibuf->ppm[0]; - values[1]= ibuf->ppm[1]; - - IMB_freeImBuf(ibuf); - } - else { - values[0]= 0; - values[1]= 0; - } -} - #else static void rna_def_movieclip_proxy(BlenderRNA *brna) @@ -93,9 +75,9 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna) static const EnumPropertyItem clip_tc_items[]= { {IMB_TC_NONE, "NONE", 0, "No TC in use", ""}, - {IMB_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", "use images in the order as they are recorded"}, - {IMB_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", "use global timestamp written by recording device"}, - {IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)", "interpolate a global timestamp using the record date and time written by recording device"}, + {IMB_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", "Use images in the order they are recorded"}, + {IMB_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", "Use global timestamp written by recording device"}, + {IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)", "Interpolate a global timestamp using the record date and time written by recording device"}, {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "MovieClipProxy", NULL); @@ -235,10 +217,6 @@ static void rna_def_movieclip(BlenderRNA *brna) RNA_def_property_int_funcs(prop, "rna_MovieClip_size_get" , NULL, NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - prop= RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0); - RNA_def_property_float_funcs(prop, "rna_MovieClip_resolution_get", NULL, NULL); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "aspx"); RNA_def_property_array(prop, 2); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 7e74c490e5c..55693f8e53f 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -108,6 +108,27 @@ EnumPropertyItem node_filter_items[] = { {6, "SHADOW", 0, "Shadow", ""}, {0, NULL, 0, NULL, NULL}}; +EnumPropertyItem prop_noise_basis_items[] = { + {SHD_NOISE_PERLIN, "PERLIN", 0, "Perlin", ""}, + {SHD_NOISE_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", ""}, + {SHD_NOISE_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", ""}, + {SHD_NOISE_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", ""}, + {SHD_NOISE_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", ""}, + {SHD_NOISE_VORONOI_F2_F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", ""}, + {SHD_NOISE_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", ""}, + {SHD_NOISE_CELL_NOISE, "CELL_NOISE", 0, "Cell Noise", ""}, + {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem prop_noise_type_items[] = { + {SHD_NOISE_SOFT, "SOFT", 0, "Soft", ""}, + {SHD_NOISE_HARD, "HARD", 0, "Hard", ""}, + {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem prop_wave_items[] = { + {SHD_WAVE_SINE, "SINE", 0, "Sine", "Uses a sine wave to produce bands"}, + {SHD_WAVE_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"}, + {SHD_WAVE_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"}, + {0, NULL, 0, NULL, NULL}}; /* Add any new socket value subtype here. * When adding a new subtype here, make sure you also add it @@ -762,6 +783,12 @@ static EnumPropertyItem node_ycc_items[] = { { 2, "JFIF", 0, "Jpeg", ""}, {0, NULL, 0, NULL, NULL}}; +static EnumPropertyItem node_glossy_items[] = { +{SHD_GLOSSY_SHARP, "SHARP", 0, "Sharp", ""}, +{SHD_GLOSSY_BECKMANN, "BECKMANN", 0, "Beckmann", ""}, +{SHD_GLOSSY_GGX, "GGX", 0, "GGX", ""}, +{0, NULL, 0, NULL, NULL}}; + #define MaxNodes 50000 enum @@ -1093,6 +1120,212 @@ static void def_sh_geometry(StructRNA *srna) RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } +static void def_sh_attribute(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeShaderAttribute", "storage"); + + prop = RNA_def_property(srna, "attribute_name", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_ui_text(prop, "Attribute Name", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} + +static void def_sh_tex(StructRNA *srna) +{ + PropertyRNA *prop; + + prop= RNA_def_property(srna, "texture_mapping", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "base.tex_mapping"); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_ui_text(prop, "Texture Mapping", "Texture coordinate mapping settings"); + + prop= RNA_def_property(srna, "color_mapping", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "base.color_mapping"); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_ui_text(prop, "Color Mapping", "Color mapping settings"); +} + +static void def_sh_tex_sky(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexSky", "storage"); + def_sh_tex(srna); + + prop = RNA_def_property(srna, "sun_direction", PROP_FLOAT, PROP_DIRECTION); + RNA_def_property_ui_text(prop, "Sun Direction", "Direction from where the sun is shining"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "turbidity", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Turbidity", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} + +static void def_sh_tex_environment(StructRNA *srna) +{ + static const EnumPropertyItem prop_color_space_items[]= { + {SHD_COLORSPACE_SRGB, "SRGB", 0, "sRGB", "Image is in sRGB color space"}, + {SHD_COLORSPACE_LINEAR, "LINEAR", 0, "Linear", "Image is in scene linear color space"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "id"); + RNA_def_property_struct_type(prop, "Image"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Image", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage"); + def_sh_tex(srna); + + prop= RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_color_space_items); + RNA_def_property_ui_text(prop, "Color Space", "Image file color space"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_image(StructRNA *srna) +{ + static const EnumPropertyItem prop_color_space_items[]= { + {SHD_COLORSPACE_LINEAR, "LINEAR", 0, "Linear", "Image is in scene linear color space"}, + {SHD_COLORSPACE_SRGB, "SRGB", 0, "sRGB", "Image is in sRGB color space"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "id"); + RNA_def_property_struct_type(prop, "Image"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Image", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage"); + def_sh_tex(srna); + + prop= RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_color_space_items); + RNA_def_property_ui_text(prop, "Color Space", "Image file color space"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_gradient(StructRNA *srna) +{ + static EnumPropertyItem prop_gradient_type[] = { + {SHD_BLEND_LINEAR, "LINEAR", 0, "Linear", "Creates a linear progression"}, + {SHD_BLEND_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Creates a quadratic progression"}, + {SHD_BLEND_EASING, "EASING", 0, "Easing", "Creates a progression easing from one step to the next"}, + {SHD_BLEND_DIAGONAL, "DIAGONAL", 0, "Diagonal", "Creates a diagonal progression"}, + {SHD_BLEND_SPHERICAL, "SPHERICAL", 0, "Spherical", "Creates a spherical progression"}, + {SHD_BLEND_QUADRATIC_SPHERE, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Creates a quadratic progression in the shape of a sphere"}, + {SHD_BLEND_RADIAL, "RADIAL", 0, "Radial", "Creates a radial progression"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexGradient", "storage"); + def_sh_tex(srna); + + prop= RNA_def_property(srna, "gradient_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_gradient_type); + RNA_def_property_ui_text(prop, "Gradient Type", "Sets the style of the color blending"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_noise(StructRNA *srna) +{ + RNA_def_struct_sdna_from(srna, "NodeTexNoise", "storage"); + def_sh_tex(srna); +} + +static void def_sh_tex_magic(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexMagic", "storage"); + def_sh_tex(srna); + + prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "depth"); + RNA_def_property_range(prop, 0, 10); + RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_musgrave(StructRNA *srna) +{ + static EnumPropertyItem prop_musgrave_type[] = { + {SHD_MUSGRAVE_MULTIFRACTAL, "MULTIFRACTAL", 0, "Multifractal", ""}, + {SHD_MUSGRAVE_RIDGED_MULTIFRACTAL, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", ""}, + {SHD_MUSGRAVE_HYBRID_MULTIFRACTAL, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", ""}, + {SHD_MUSGRAVE_FBM, "FBM", 0, "fBM", ""}, + {SHD_MUSGRAVE_HETERO_TERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", ""}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexMusgrave", "storage"); + def_sh_tex(srna); + + prop= RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "musgrave_type"); + RNA_def_property_enum_items(prop, prop_musgrave_type); + RNA_def_property_ui_text(prop, "Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_voronoi(StructRNA *srna) +{ + static EnumPropertyItem prop_coloring_items[] = { + {SHD_VORONOI_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity"}, + {SHD_VORONOI_CELLS, "CELLS", 0, "Cells", "Color cells by position"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexVoronoi", "storage"); + def_sh_tex(srna); + + prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "coloring"); + RNA_def_property_enum_items(prop, prop_coloring_items); + RNA_def_property_ui_text(prop, "Coloring", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_wave(StructRNA *srna) +{ + static EnumPropertyItem prop_wave_type_items[] = { + {SHD_WAVE_BANDS, "BANDS", 0, "Bands", "Uses standard wave texture in bands"}, + {SHD_WAVE_RINGS, "RINGS", 0, "Rings", "Uses wave texture in rings"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexWave", "storage"); + def_sh_tex(srna); + + prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "wave_type"); + RNA_def_property_enum_items(prop, prop_wave_type_items); + RNA_def_property_ui_text(prop, "Wave Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_glossy(StructRNA *srna) +{ + PropertyRNA *prop; + + prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, node_glossy_items); + RNA_def_property_ui_text(prop, "Distribution", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} /* -- Compositor Nodes ------------------------------------------------------ */ @@ -2707,6 +2940,16 @@ static void rna_def_node_socket(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Name", "Socket name"); RNA_def_struct_name_property(srna, prop); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_NodeGroupSocket_update"); + + prop = RNA_def_property(srna, "group_socket", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "groupsock"); + RNA_def_property_struct_type(prop, "NodeSocket"); + RNA_def_property_ui_text(prop, "Group Socket", "For group nodes, the group input or output socket this corresponds to"); + + prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SOCK_COLLAPSED); + RNA_def_property_ui_text(prop, "Expanded", "Socket links are expanded in the user interface"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, NULL); } static void rna_def_node_socket_subtype(BlenderRNA *brna, int type, int subtype, const char *name, const char *ui_name) @@ -2715,7 +2958,7 @@ static void rna_def_node_socket_subtype(BlenderRNA *brna, int type, int subtype, PropertyRNA *prop=NULL; PropertySubType propsubtype= PROP_NONE; - #define SUBTYPE(socktype, stypename, id, idname) { PROP_##id, #id, 0, #idname, ""}, + #define SUBTYPE(socktype, stypename, id, idname) { PROP_##id, #socktype "_" #id, 0, #idname, ""}, static EnumPropertyItem subtype_items[] = { NODE_DEFINE_SUBTYPES {0, NULL, 0, NULL, NULL} @@ -2842,6 +3085,11 @@ static void rna_def_node(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Node"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Parent", "Parent this node is attached to"); + + prop = RNA_def_property(srna, "show_texture", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_ACTIVE_TEXTURE); + RNA_def_property_ui_text(prop, "Show Texture", "Draw node in viewport textured draw mode"); + RNA_def_property_update(prop, 0, "rna_Node_update"); } static void rna_def_node_link(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h index 2545826cd46..78be14ebf7e 100644 --- a/source/blender/makesrna/intern/rna_nodetree_types.h +++ b/source/blender/makesrna/intern/rna_nodetree_types.h @@ -53,7 +53,39 @@ DefNode( ShaderNode, SH_NODE_INVERT, 0, "INVER DefNode( ShaderNode, SH_NODE_SEPRGB, 0, "SEPRGB", SeparateRGB, "Separate RGB", "" ) DefNode( ShaderNode, SH_NODE_COMBRGB, 0, "COMBRGB", CombineRGB, "Combine RGB", "" ) DefNode( ShaderNode, SH_NODE_HUE_SAT, 0, "HUE_SAT", HueSaturation, "Hue/Saturation", "" ) - + +DefNode( ShaderNode, SH_NODE_OUTPUT_MATERIAL, 0, "OUTPUT_MATERIAL", OutputMaterial, "Material Output", "" ) +DefNode( ShaderNode, SH_NODE_OUTPUT_LAMP, 0, "OUTPUT_LAMP", OutputLamp, "Lamp Output", "" ) +DefNode( ShaderNode, SH_NODE_OUTPUT_WORLD, 0, "OUTPUT_WORLD", OutputWorld, "World Output", "" ) +DefNode( ShaderNode, SH_NODE_FRESNEL, 0, "FRESNEL", Fresnel, "Fresnel", "" ) +DefNode( ShaderNode, SH_NODE_LAYER_WEIGHT, 0, "LAYER_WEIGHT", LayerWeight, "LayerWeight", "" ) +DefNode( ShaderNode, SH_NODE_MIX_SHADER, 0, "MIX_SHADER", MixShader, "Mix Shader", "" ) +DefNode( ShaderNode, SH_NODE_ADD_SHADER, 0, "ADD_SHADER", AddShader, "Add Shader", "" ) +DefNode( ShaderNode, SH_NODE_ATTRIBUTE, def_sh_attribute, "ATTRIBUTE", Attribute, "Attribute", "" ) +DefNode( ShaderNode, SH_NODE_BACKGROUND, 0, "BACKGROUND", Background, "Background", "" ) +DefNode( ShaderNode, SH_NODE_HOLDOUT, 0, "HOLDOUT", Holdout, "Holdout", "" ) +DefNode( ShaderNode, SH_NODE_BSDF_DIFFUSE, 0, "BSDF_DIFFUSE", BsdfDiffuse, "Diffuse Bsdf", "" ) +DefNode( ShaderNode, SH_NODE_BSDF_GLOSSY, def_glossy, "BSDF_GLOSSY", BsdfGlossy, "Glossy Bsdf", "" ) +DefNode( ShaderNode, SH_NODE_BSDF_GLASS, def_glossy, "BSDF_GLASS", BsdfGlass, "Glass Bsdf", "" ) +DefNode( ShaderNode, SH_NODE_BSDF_TRANSLUCENT, 0, "BSDF_TRANSLUCENT", BsdfTranslucent, "Translucent Bsdf", "" ) +DefNode( ShaderNode, SH_NODE_BSDF_TRANSPARENT, 0, "BSDF_TRANSPARENT", BsdfTransparent, "Transparent Bsdf", "" ) +DefNode( ShaderNode, SH_NODE_BSDF_VELVET, 0, "BSDF_VELVET", BsdfVelvet, "Velvet Bsdf", "" ) +DefNode( ShaderNode, SH_NODE_VOLUME_TRANSPARENT, 0, "VOLUME_TRANSPARENT", VolumeTransparent,"Transparent Volume","" ) +DefNode( ShaderNode, SH_NODE_VOLUME_ISOTROPIC, 0, "VOLUME_ISOTROPIC", VolumeIsotropic, "Isotropic Volume", "" ) +DefNode( ShaderNode, SH_NODE_EMISSION, 0, "EMISSION", Emission, "Emission", "" ) +DefNode( ShaderNode, SH_NODE_NEW_GEOMETRY, 0, "NEW_GEOMETRY", NewGeometry, "Geometry", "" ) +DefNode( ShaderNode, SH_NODE_LIGHT_PATH, 0, "LIGHT_PATH", Light_path, "Light_path", "" ) +DefNode( ShaderNode, SH_NODE_TEX_IMAGE, def_sh_tex_image, "TEX_IMAGE", TexImage, "Image Texture", "" ) +DefNode( ShaderNode, SH_NODE_TEX_ENVIRONMENT, def_sh_tex_environment, "TEX_ENVIRONMENT", TexEnvironment, "Environment Texture","" ) +DefNode( ShaderNode, SH_NODE_TEX_SKY, def_sh_tex_sky, "TEX_SKY", TexSky, "Sky Texture", "" ) +DefNode( ShaderNode, SH_NODE_TEX_GRADIENT, def_sh_tex_gradient, "TEX_GRADIENT", TexGradient, "Gradient Texture", "" ) +DefNode( ShaderNode, SH_NODE_TEX_NOISE, def_sh_tex_noise, "TEX_NOISE", TexNoise, "Noise Texture", "" ) +DefNode( ShaderNode, SH_NODE_TEX_MAGIC, def_sh_tex_magic, "TEX_MAGIC", TexMagic, "Magic Texture", "" ) +DefNode( ShaderNode, SH_NODE_TEX_WAVE, def_sh_tex_wave, "TEX_WAVE", TexWave, "Wave Texture", "" ) +DefNode( ShaderNode, SH_NODE_TEX_MUSGRAVE, def_sh_tex_musgrave, "TEX_MUSGRAVE", TexMusgrave, "Musgrave Texture", "" ) +DefNode( ShaderNode, SH_NODE_TEX_VORONOI, def_sh_tex_voronoi, "TEX_VORONOI", TexVoronoi, "Voronoi Texture", "" ) +DefNode( ShaderNode, SH_NODE_TEX_COORD, 0, "TEX_COORD", TexCoord, "Texture Coordinate","") + DefNode( CompositorNode, CMP_NODE_VIEWER, 0, "VIEWER", Viewer, "Viewer", "" ) DefNode( CompositorNode, CMP_NODE_RGB, 0, "RGB", RGB, "RGB", "" ) DefNode( CompositorNode, CMP_NODE_VALUE, 0, "VALUE", Value, "Value", "" ) diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 0acff2a5790..c4508c718e5 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -76,7 +76,7 @@ /* copied from Mesh_getFromObject and adapted to RNA interface */ /* settings: 0 - preview, 1 - render */ -static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_modifiers, int settings) +Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_modifiers, int settings) { Mesh *tmpmesh; Curve *tmpcu = NULL; @@ -284,7 +284,7 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e dupli_render_particle_set(scene, go->ob, level+1, enable); } /* When no longer needed, duplilist should be freed with Object.free_duplilist */ -static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce) +void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce) { if (!(ob->transflag & OB_DUPLI)) { BKE_report(reports, RPT_ERROR, "Object does not have duplis"); @@ -306,7 +306,7 @@ static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene * /* ob->duplilist should now be freed with Object.free_duplilist */ } -static void rna_Object_free_duplilist(Object *ob) +void rna_Object_free_duplilist(Object *ob) { if (ob->duplilist) { free_object_duplilist(ob->duplilist); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 44faefed27b..592c3baec46 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -640,6 +640,22 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr) if (smd->domain->effector_weights == ew) return BLI_sprintfN("modifiers[\"%s\"].settings.effector_weights", md->name); } + + /* check dynamic paint modifier */ + md = (ModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint); + if (md) { + DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md; + + if (pmd->canvas) { + DynamicPaintSurface *surface = pmd->canvas->surfaces.first; + + for(; surface; surface=surface->next) { + if (surface->effector_weights == ew) + return BLI_sprintfN("modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"].effector_weights", + md->name, surface->name); + } + } + } } return NULL; } diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 530d162b1fe..f00b97994d5 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -233,7 +233,7 @@ static void rna_RenderLayer_rect_get(PointerRNA *ptr, float *values) memcpy(values, rl->rectf, sizeof(float)*rl->rectx*rl->recty*4); } -static void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values) +void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values) { RenderLayer *rl= (RenderLayer*)ptr->data; memcpy(rl->rectf, values, sizeof(float)*rl->rectx*rl->recty*4); @@ -255,7 +255,7 @@ static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values) memcpy(values, rpass->rect, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels); } -static void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values) +void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values) { RenderPass *rpass= (RenderPass*)ptr->data; memcpy(rpass->rect, values, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 24b70446468..9c4a0984596 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -576,6 +576,7 @@ static int rna_SceneRender_file_ext_length(PointerRNA *ptr) static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str) { RenderData *rd= (RenderData*)ptr->data; + str[0]= '\0'; BKE_add_image_extension(str, rd->imtype); } @@ -3467,7 +3468,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE); - RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL); + RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL); RNA_def_property_ui_text(prop, "Full Sample", "Save for every anti-aliasing sample the entire RenderLayer results " "(this solves anti-aliasing issues with compositing)"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index bb07fa86f3a..31f3d59e643 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -102,7 +102,8 @@ EnumPropertyItem viewport_shade_items[] = { {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"}, {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"}, {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"}, - {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"}, + {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Texture", "Display the object solid, with a texture"}, + {OB_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Display objects solid, with GLSL material"}, {OB_RENDER, "RENDERED", ICON_SMOOTH, "Rendered", "Display render preview"}, {0, NULL, 0, NULL, NULL}}; @@ -114,13 +115,14 @@ EnumPropertyItem viewport_shade_items[] = { #include "BLI_math.h" -#include "BKE_screen.h" #include "BKE_animsys.h" #include "BKE_brush.h" #include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_paint.h" +#include "BKE_scene.h" +#include "BKE_screen.h" #include "ED_image.h" #include "ED_node.h" @@ -461,10 +463,12 @@ static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_WIRE); RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_SOLID); RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_TEXTURE); + + if(scene_use_new_shading_nodes(scene)) + RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_MATERIAL); - if(type->view_draw) { + if(type->view_draw) RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_RENDER); - } RNA_enum_item_end(&item, &totitem); *free= 1; @@ -510,7 +514,7 @@ static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value) SpaceImage *sima= (SpaceImage*)(ptr->data); bScreen *sc= (bScreen*)ptr->id.data; - ED_space_image_set(NULL, sima, sc->scene, sc->scene->obedit, (Image*)value.data); + ED_space_image_set(sima, sc->scene, sc->scene->obedit, (Image*)value.data); } static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUSED(C), PointerRNA *ptr, @@ -2385,6 +2389,11 @@ static void rna_def_space_time(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SMOKE); RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); + + prop= RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DYNAMICPAINT); + RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); } static void rna_def_console_line(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index 15ded001237..2c6384c75d8 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -242,7 +242,7 @@ static void rna_def_trackingSettings(BlenderRNA *brna) prop= RNA_def_property(srna, "frames_limit", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "frames_limit"); - RNA_def_property_range(prop, 0, INT_MAX); + RNA_def_property_range(prop, 0, SHRT_MAX); RNA_def_property_ui_text(prop, "Frames Limit", "Amount of frames to be tracked during single tracking operation"); /* adjust frames */ @@ -418,7 +418,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) static EnumPropertyItem tracker_items[] = { {TRACKER_SAD, "SAD", 0, "SAD", "Sum of Absolute Differences tracker"}, - {TRACKER_KLT, "KLT", 0, "KLT", "Kanade–Lucas–Tomasi racker"}, + {TRACKER_KLT, "KLT", 0, "KLT", "Kanade–Lucas–Tomasi tracker"}, {0, NULL, 0, NULL, NULL}}; rna_def_trackingMarker(brna); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 9ff56f1aeb0..366ba1daf85 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -465,6 +465,9 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_pointer(func, "socket", "NodeSocket", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); + func= RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + func= RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties"); parm= RNA_def_pointer(func, "item", "KeyMapItem", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 9dc125bbdcc..8406f232653 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -316,6 +316,7 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeFontStyle", NULL); RNA_def_struct_sdna(srna, "uiFontStyle"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font"); prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE); @@ -366,6 +367,7 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeStyle", NULL); RNA_def_struct_sdna(srna, "uiStyle"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets"); /* (not used yet) @@ -410,6 +412,7 @@ static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeWidgetColors", NULL); RNA_def_struct_sdna(srna, "uiWidgetColors"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets"); prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -465,6 +468,7 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeWidgetStateColors", NULL); RNA_def_struct_sdna(srna, "uiWidgetStateColors"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Widget State Color", "Theme settings for widget state colors"); prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -512,6 +516,7 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeUserInterface", NULL); RNA_def_struct_sdna(srna, "ThemeUI"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme User Interface", "Theme settings for user interface elements"); prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE); @@ -927,6 +932,7 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeView3D", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View"); rna_def_userdef_theme_spaces_main(srna, SPACE_VIEW3D); @@ -1064,6 +1070,7 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor"); rna_def_userdef_theme_spaces_main(srna, SPACE_IPO); @@ -1148,6 +1155,7 @@ static void rna_def_userdef_theme_space_file(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeFileBrowser", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser"); rna_def_userdef_theme_spaces_main(srna, SPACE_FILE); @@ -1197,6 +1205,7 @@ static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeOutliner", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner"); rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER); @@ -1210,6 +1219,7 @@ static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences"); rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF); @@ -1224,6 +1234,7 @@ static void rna_def_userdef_theme_space_console(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeConsole", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console"); rna_def_userdef_theme_spaces_main(srna, SPACE_CONSOLE); @@ -1267,6 +1278,7 @@ static void rna_def_userdef_theme_space_info(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeInfo", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info"); rna_def_userdef_theme_spaces_main(srna, SPACE_INFO); @@ -1282,6 +1294,7 @@ static void rna_def_userdef_theme_space_text(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeTextEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor"); rna_def_userdef_theme_spaces_main(srna, SPACE_TEXT); @@ -1350,6 +1363,7 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeNodeEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor"); rna_def_userdef_theme_spaces_main(srna, SPACE_NODE); @@ -1419,6 +1433,7 @@ static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeLogicEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor"); rna_def_userdef_theme_spaces_main(srna, SPACE_LOGIC); @@ -1439,6 +1454,7 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeProperties", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties"); rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS); @@ -1458,6 +1474,7 @@ static void rna_def_userdef_theme_space_time(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeTimeline", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline"); rna_def_userdef_theme_spaces_main(srna, SPACE_TIME); @@ -1483,6 +1500,7 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeImageEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor"); rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE); @@ -1510,6 +1528,7 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeSequenceEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor"); rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE); @@ -1601,6 +1620,7 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeDopeSheet", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme DopeSheet", "Theme settings for the DopeSheet"); rna_def_userdef_theme_spaces_main(srna, SPACE_ACTION); @@ -1686,6 +1706,7 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeNLAEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor"); rna_def_userdef_theme_spaces_main(srna, SPACE_NLA); @@ -1739,6 +1760,7 @@ static void rna_def_userdef_theme_colorset(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeBoneColorSet", NULL); RNA_def_struct_sdna(srna, "ThemeWireColor"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Bone Color Set", "Theme settings for bone color sets"); prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -1773,6 +1795,7 @@ static void rna_def_userdef_theme_space_clip(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeClipEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor"); rna_def_userdef_theme_spaces_main(srna, SPACE_CLIP); @@ -1881,6 +1904,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) srna= RNA_def_struct(brna, "Theme", NULL); RNA_def_struct_sdna(srna, "bTheme"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme", "Theme settings defining draw style and colors in the user interface"); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); @@ -2014,6 +2038,7 @@ static void rna_def_userdef_addon(BlenderRNA *brna) srna= RNA_def_struct(brna, "Addon", NULL); RNA_def_struct_sdna(srna, "bAddon"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Addon", "Python addons to be loaded automatically"); prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE); @@ -2057,6 +2082,7 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna) srna= RNA_def_struct(brna, "UserSolidLight", NULL); RNA_def_struct_sdna(srna, "SolidLight"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Solid Light", "Light used for OpenGL lighting in solid draw mode"); prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); @@ -2106,6 +2132,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) srna= RNA_def_struct(brna, "UserPreferencesView", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data"); /* View */ @@ -2321,6 +2348,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data"); /* Edit Methods */ @@ -2599,12 +2627,13 @@ static void rna_def_userdef_system(BlenderRNA *brna) {0, "DEFAULT", 0, "Default (Default)", ""}, {1, "ENGLISH", 0, "English (English)", "en_US"}, {8, "FRENCH", 0, "French (Français)", "fr_FR"}, - {9, "SPANISH", 0, "Spanish (Español)", "es_ES"}, + {4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"}, + {15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"}, {13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"}, + {9, "SPANISH", 0, "Spanish (Español)", "es_ES"}, {0, "", 0, "In progress", ""}, {2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"}, {3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"}, - {4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"}, {5, "GERMAN", 0, "German (Deutsch)", "de_DE"}, {6, "FINNISH", 0, "Finnish (Suomi)", "fi_FI"}, {7, "SWEDISH", 0, "Swedish (Svenska)", "sv_SE"}, @@ -2612,7 +2641,6 @@ static void rna_def_userdef_system(BlenderRNA *brna) {11, "CZECH", 0, "Czech (Český)", "cs_CZ"}, {12, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese (Português do Brasil)", "pt_BR"}, {14, "TRADITIONAL_CHINESE", 0, "Traditional Chinese (繁體中文)", "zh_TW"}, - {15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"}, {16, "CROATIAN", 0, "Croatian (Hrvatski)", "hr_HR"}, {17, "SERBIAN", 0, "Serbian (Српском језику)", "sr_RS"}, {18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"}, @@ -2632,6 +2660,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings"); /* Language */ @@ -2876,6 +2905,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) srna= RNA_def_struct(brna, "UserPreferencesInput", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Input", "Settings for input devices"); prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE); @@ -3031,6 +3061,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) srna= RNA_def_struct(brna, "UserPreferencesFilePaths", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files"); prop= RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE); @@ -3148,6 +3179,7 @@ void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "Addons"); srna= RNA_def_struct(brna, "Addons", NULL); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "User Addons", "Collection of addons"); func= RNA_def_function(srna, "new", "rna_userdef_addon_new"); @@ -3184,6 +3216,7 @@ void RNA_def_userdef(BlenderRNA *brna) srna= RNA_def_struct(brna, "UserPreferences", NULL); RNA_def_struct_sdna(srna, "UserDef"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "User Preferences", "Global user preferences"); prop= RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE); |