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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt6
-rw-r--r--source/blender/makesrna/intern/Makefile1
-rw-r--r--source/blender/makesrna/intern/SConscript12
-rw-r--r--source/blender/makesrna/intern/makesrna.c11
-rw-r--r--source/blender/makesrna/intern/rna_ID.c21
-rw-r--r--source/blender/makesrna/intern/rna_access.c53
-rw-r--r--source/blender/makesrna/intern/rna_action.c6
-rw-r--r--source/blender/makesrna/intern/rna_action_api.c80
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c1
-rw-r--r--source/blender/makesrna/intern/rna_animation.c15
-rw-r--r--source/blender/makesrna/intern/rna_armature.c115
-rw-r--r--source/blender/makesrna/intern/rna_boid.c27
-rw-r--r--source/blender/makesrna/intern/rna_brush.c141
-rw-r--r--source/blender/makesrna/intern/rna_camera.c21
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c5
-rw-r--r--source/blender/makesrna/intern/rna_color.c6
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c126
-rw-r--r--source/blender/makesrna/intern/rna_curve.c34
-rw-r--r--source/blender/makesrna/intern/rna_define.c43
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c10
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c9
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c14
-rw-r--r--source/blender/makesrna/intern/rna_group.c2
-rw-r--r--source/blender/makesrna/intern/rna_image.c183
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c101
-rw-r--r--source/blender/makesrna/intern/rna_internal.h10
-rw-r--r--source/blender/makesrna/intern/rna_key.c12
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c187
-rw-r--r--source/blender/makesrna/intern/rna_main.c4
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c133
-rw-r--r--source/blender/makesrna/intern/rna_material.c611
-rw-r--r--source/blender/makesrna/intern/rna_material_api.c126
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c16
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c200
-rw-r--r--source/blender/makesrna/intern/rna_meta.c4
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c27
-rw-r--r--source/blender/makesrna/intern/rna_nla.c6
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c453
-rw-r--r--source/blender/makesrna/intern/rna_nodetree_types.h4
-rw-r--r--source/blender/makesrna/intern/rna_object.c197
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c400
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c430
-rw-r--r--source/blender/makesrna/intern/rna_particle.c258
-rw-r--r--source/blender/makesrna/intern/rna_pose.c471
-rw-r--r--source/blender/makesrna/intern/rna_pose_api.c56
-rw-r--r--source/blender/makesrna/intern/rna_rna.c82
-rw-r--r--source/blender/makesrna/intern/rna_scene.c212
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c78
-rw-r--r--source/blender/makesrna/intern/rna_screen.c6
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c68
-rw-r--r--source/blender/makesrna/intern/rna_sequence.c45
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c6
-rw-r--r--source/blender/makesrna/intern/rna_space.c102
-rw-r--r--source/blender/makesrna/intern/rna_text.c8
-rw-r--r--source/blender/makesrna/intern/rna_text_api.c49
-rw-r--r--source/blender/makesrna/intern/rna_texture.c430
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c45
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c381
-rw-r--r--source/blender/makesrna/intern/rna_wm.c10
-rw-r--r--source/blender/makesrna/intern/rna_world.c111
60 files changed, 4424 insertions, 1857 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 709c5d017ec..c9c02fbecde 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -39,9 +39,13 @@ SET(SRC
../../../../intern/guardedalloc/intern/mallocn.c
../../../../intern/guardedalloc/intern/mmap_win.c)
-INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .)
+INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../ikplugin ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .)
FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
+IF(WIN32)
+ SET(INC ${INC} ${PTHREADS_INC})
+ENDIF(WIN32)
+
IF(WITH_GAMEENGINE)
ADD_DEFINITIONS(-DGAMEBLENDER)
ENDIF(WITH_GAMEENGINE)
diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile
index 4a4e41edd15..7923ea1e7de 100644
--- a/source/blender/makesrna/intern/Makefile
+++ b/source/blender/makesrna/intern/Makefile
@@ -49,6 +49,7 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../ikplugin
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../windowmanager
CPPFLAGS += -I../../editors/include
diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript
index 569f0547731..c63b63ce5f7 100644
--- a/source/blender/makesrna/intern/SConscript
+++ b/source/blender/makesrna/intern/SConscript
@@ -30,7 +30,7 @@ makesrna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesrna/\\"" '
defs = []
incs = '#/intern/guardedalloc ../../blenlib ../../blenkernel'
-incs += ' ../../imbuf ../../makesdna ../../makesrna'
+incs += ' ../../imbuf ../../makesdna ../../makesrna ../../ikplugin'
incs += ' ../../windowmanager ../../editors/include'
incs += ' ../../render/extern/include'
@@ -74,6 +74,14 @@ if env['WITH_BF_JACK']:
if env['BF_UNIT_TEST']:
defs.append('UNIT_TEST')
+
+if env['OURPLATFORM'] == 'linux2':
+ cflags='-pthread'
+ incs += ' ../../../extern/binreloc/include'
+
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
+ incs += ' ' + env['BF_PTHREADS_INC']
+
makesrna_tool.Append(CPPDEFINES=defs)
makesrna_tool.Append (CPPPATH = Split(incs))
@@ -126,7 +134,7 @@ rna.Depends (generated_files, makesrna)
# this seems bad, how to retrieve it from scons?
build_dir = root_build_dir + os.sep +'source' + os.sep + 'blender' + os.sep + 'makesrna' + os.sep + 'intern' + os.sep
-
+
if env['OURPLATFORM'] != 'linuxcross':
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
rna.Command (generated_files, '', "\"" + root_build_dir+os.sep+"makesrna.exe\" \"" + build_dir )
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index d0c7824dc9d..63b58f27c53 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -1406,6 +1406,7 @@ static const char *rna_property_subtypename(PropertyType type)
case PROP_DIRPATH: return "PROP_DIRPATH";
case PROP_UNSIGNED: return "PROP_UNSIGNED";
case PROP_PERCENTAGE: return "PROP_PERCENTAGE";
+ case PROP_FACTOR: return "PROP_FACTOR";
case PROP_ANGLE: return "PROP_ANGLE";
case PROP_TIME: return "PROP_TIME";
case PROP_DISTANCE: return "PROP_DISTANCE";
@@ -1415,11 +1416,11 @@ static const char *rna_property_subtypename(PropertyType type)
case PROP_MATRIX: return "PROP_MATRIX";
case PROP_EULER: return "PROP_EULER";
case PROP_QUATERNION: return "PROP_QUATERNION";
+ case PROP_AXISANGLE: return "PROP_AXISANGLE";
case PROP_VELOCITY: return "PROP_VELOCITY";
case PROP_ACCELERATION: return "PROP_ACCELERATION";
case PROP_XYZ: return "PROP_XYZ";
case PROP_RGB: return "PROP_RGB";
- case PROP_NEVER_NULL: return "PROP_NEVER_NULL";
case PROP_LAYER: return "PROP_LAYER";
case PROP_LAYER_MEMBER: return "PROP_LAYER_MEMBER";
default: {
@@ -1969,7 +1970,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_rna.c", NULL, RNA_def_rna},
{"rna_ID.c", NULL, RNA_def_ID},
{"rna_texture.c", NULL, RNA_def_texture},
- {"rna_action.c", NULL, RNA_def_action},
+ {"rna_action.c", "rna_action_api.c", RNA_def_action},
{"rna_animation.c", "rna_animation_api.c", RNA_def_animation},
{"rna_actuator.c", NULL, RNA_def_actuator},
{"rna_armature.c", NULL, RNA_def_armature},
@@ -1986,12 +1987,12 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_fluidsim.c", NULL, RNA_def_fluidsim},
{"rna_gpencil.c", NULL, RNA_def_gpencil},
{"rna_group.c", NULL, RNA_def_group},
- {"rna_image.c", NULL, RNA_def_image},
+ {"rna_image.c", "rna_image_api.c", RNA_def_image},
{"rna_key.c", NULL, RNA_def_key},
{"rna_lamp.c", NULL, RNA_def_lamp},
{"rna_lattice.c", NULL, RNA_def_lattice},
{"rna_main.c", "rna_main_api.c", RNA_def_main},
- {"rna_material.c", NULL, RNA_def_material},
+ {"rna_material.c", "rna_material_api.c", RNA_def_material},
{"rna_mesh.c", "rna_mesh_api.c", RNA_def_mesh},
{"rna_meta.c", NULL, RNA_def_meta},
{"rna_modifier.c", NULL, RNA_def_modifier},
@@ -2001,7 +2002,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_object_force.c", NULL, RNA_def_object_force},
{"rna_packedfile.c", NULL, RNA_def_packedfile},
{"rna_particle.c", NULL, RNA_def_particle},
- {"rna_pose.c", NULL, RNA_def_pose},
+ {"rna_pose.c", "rna_pose_api.c", RNA_def_pose},
{"rna_property.c", NULL, RNA_def_gameproperty},
{"rna_render.c", NULL, RNA_def_render},
{"rna_scene.c", "rna_scene_api.c", RNA_def_scene},
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index f5c6063e892..8ab5a1442c7 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -178,6 +178,18 @@ StructRNA* rna_IDPropertyGroup_refine(PointerRNA *ptr)
return ptr->type;
}
+ID *rna_ID_copy(ID *id)
+{
+ ID *newid;
+
+ if(id_copy(id, &newid, 0)) {
+ if(newid) newid->us--;
+ return newid;
+ }
+
+ return NULL;
+}
+
#else
static void rna_def_ID_properties(BlenderRNA *brna)
@@ -243,7 +255,8 @@ static void rna_def_ID_properties(BlenderRNA *brna)
static void rna_def_ID(BlenderRNA *brna)
{
StructRNA *srna;
- PropertyRNA *prop;
+ FunctionRNA *func;
+ PropertyRNA *prop, *parm;
srna= RNA_def_struct(brna, "ID", NULL);
RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection.");
@@ -271,6 +284,12 @@ static void rna_def_ID(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "lib");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Library", "Library file the datablock is linked from.");
+
+ /* functions */
+ func= RNA_def_function(srna, "copy", "rna_ID_copy");
+ RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks).");
+ parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID.");
+ RNA_def_function_return(func, parm);
}
static void rna_def_library(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index e4bda24cf20..21fbc9fa66d 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -225,6 +225,18 @@ static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
}
}
+static int rna_ensure_property_array_check(PointerRNA *ptr, PropertyRNA *prop)
+{
+ if(prop->magic == RNA_MAGIC) {
+ return (prop->getlength || prop->totarraylength) ? 1:0;
+ }
+ else {
+ IDProperty *idprop= (IDProperty*)prop;
+
+ return idprop->type == IDP_ARRAY ? 1:0;
+ }
+}
+
static void rna_ensure_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int length[])
{
if(prop->magic == RNA_MAGIC) {
@@ -574,6 +586,11 @@ int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
return rna_ensure_property_array_length(ptr, prop);
}
+int RNA_property_array_check(PointerRNA *ptr, PropertyRNA *prop)
+{
+ return rna_ensure_property_array_check(ptr, prop);
+}
+
/* used by BPY to make an array from the python object */
int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[])
{
@@ -603,7 +620,7 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index)
PropertySubType subtype= rna_ensure_property(prop)->subtype;
/* get string to use for array index */
- if ((index < 4) && (subtype == PROP_QUATERNION))
+ if ((index < 4) && ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE))
return quatitem[index];
else if((index < 4) && ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
return vectoritem[index];
@@ -1392,10 +1409,17 @@ PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value)
{
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ IDProperty *idprop;
- if(pprop->set)
- pprop->set(ptr, ptr_value);
+ if((idprop=rna_idproperty_check(&prop, ptr))) {
+ /* not supported */
+ }
+ else {
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+
+ if(pprop->set && !((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL))
+ pprop->set(ptr, ptr_value);
+ }
}
void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
@@ -2363,12 +2387,11 @@ char *RNA_path_back(const char *path)
return result;
}
-char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
+char *RNA_path_from_ID_to_struct(PointerRNA *ptr)
{
- char *ptrpath=NULL, *path;
- const char *propname;
+ char *ptrpath=NULL;
- if(!ptr->id.data || !ptr->data || !prop)
+ if(!ptr->id.data || !ptr->data)
return NULL;
if(!RNA_struct_is_ID(ptr->type)) {
@@ -2394,6 +2417,20 @@ char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
else
return NULL;
}
+
+ return ptrpath;
+}
+
+char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
+{
+ const char *propname;
+ char *ptrpath, *path;
+
+ if(!ptr->id.data || !ptr->data || !prop)
+ return NULL;
+
+ /* path from ID to the struct holding this property */
+ ptrpath= RNA_path_from_ID_to_struct(ptr);
propname= RNA_property_identifier(prop);
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index e376d3125e3..eaa11b4ad38 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -38,7 +38,7 @@
#else
-void rna_def_action_group(BlenderRNA *brna)
+static void rna_def_action_group(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -76,7 +76,7 @@ void rna_def_action_group(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set.");
}
-void rna_def_action(BlenderRNA *brna)
+static void rna_def_action(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -100,6 +100,8 @@ void rna_def_action(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
RNA_def_property_struct_type(prop, "TimelineMarker");
RNA_def_property_ui_text(prop, "Pose Markers", "Markers specific to this Action, for labeling poses.");
+
+ RNA_api_action(srna);
}
/* --------- */
diff --git a/source/blender/makesrna/intern/rna_action_api.c b/source/blender/makesrna/intern/rna_action_api.c
new file mode 100644
index 00000000000..991a8251cc5
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_action_api.c
@@ -0,0 +1,80 @@
+/**
+ * ***** 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Arystanbek Dyussenov
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "DNA_action_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_action.h"
+
+#include "DNA_anim_types.h"
+#include "DNA_curve_types.h"
+
+/* XXX disabled until RNA allows returning arrays */
+#if 0
+/* return frame range of all curves (min, max) or (0, 1) if there are no keys */
+int *rna_Action_get_frame_range(bAction *act, int *ret_length)
+{
+ int *ret;
+ float start, end;
+
+ calc_action_range(act, &start, &end, 1);
+
+ *ret_length= 2;
+ ret= MEM_callocN(*ret_length * sizeof(int), "rna_Action_get_frame_range");
+
+ ret[0]= (int)start;
+ ret[1]= (int)end;
+
+ return ret;
+}
+#endif
+
+#else
+
+void RNA_api_action(StructRNA *srna)
+{
+#if 0
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "get_frame_range", "rna_Action_get_frame_range");
+ RNA_def_function_ui_description(func, "Get action frame range as a (min, max) tuple.");
+ parm= RNA_def_int_array(func, "frame_range", 1, NULL, 0, 0, "", "Action frame range.", 0, 0);
+ RNA_def_property_flag(parm, PROP_DYNAMIC_ARRAY);
+ RNA_def_function_return(func, parm);
+#endif
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 473e726db60..ce83d1c469b 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -58,6 +58,7 @@ void RNA_def_actuator(BlenderRNA *brna)
{ACT_PARENT, "PARENT", 0, "Parent", ""},
{ACT_SHAPEACTION, "SHAPE_ACTION", 0, "Shape Action", ""},
{ACT_STATE, "STATE", 0, "State", ""},
+ {ACT_ARMATURE, "ARMATURE", 0, "Armature", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Actuator", NULL);
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index e4bea893992..4b2c11c2e0d 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -57,6 +57,12 @@ static int rna_AnimData_action_editable(PointerRNA *ptr)
return 1;
}
+static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value)
+{
+ AnimData *adt= (AnimData*)(ptr->data);
+ adt->action= value.data;
+}
+
static void rna_ksPath_RnaPath_get(PointerRNA *ptr, char *value)
{
KS_Path *ksp= (KS_Path *)ptr->data;
@@ -93,7 +99,7 @@ static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value)
#else
-void rna_def_keyingset_path(BlenderRNA *brna)
+static void rna_def_keyingset_path(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -132,7 +138,7 @@ void rna_def_keyingset_path(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used.");
}
-void rna_def_keyingset(BlenderRNA *brna)
+static void rna_def_keyingset(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -202,8 +208,11 @@ void rna_def_animdata(BlenderRNA *brna)
/* Active Action */
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
- RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock.");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE); /* this flag as well as the dynamic test must be defined for this to be editable... */
RNA_def_property_editable_func(prop, "rna_AnimData_action_editable");
+ RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock.");
+
/* Active Action Settings */
prop= RNA_def_property(srna, "action_extrapolation", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 57eb3c1de4a..5dbfdd3e6f1 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -52,6 +52,7 @@ static void rna_Armature_update_data(bContext *C, PointerRNA *ptr)
DAG_id_flush_update(id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, id);
+ //WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
}
static void rna_Armature_redraw_data(bContext *C, PointerRNA *ptr)
@@ -61,6 +62,11 @@ static void rna_Armature_redraw_data(bContext *C, PointerRNA *ptr)
WM_event_add_notifier(C, NC_GEOM|ND_DATA, id);
}
+static char *rna_Bone_path(PointerRNA *ptr)
+{
+ return BLI_sprintfN("bones[\"%s\"]", ((Bone*)ptr->data)->name);
+}
+
static void rna_bone_layer_set(short *layer, const int *values)
{
int i, tot= 0;
@@ -430,6 +436,7 @@ static void rna_def_bone(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Bone", NULL);
RNA_def_struct_ui_text(srna, "Bone", "Bone in an Armature datablock.");
RNA_def_struct_ui_icon(srna, ICON_BONE_DATA);
+ RNA_def_struct_path_func(srna, "rna_Bone_path");
/* pointers/collections */
/* parent (pointer) */
@@ -457,6 +464,37 @@ static void rna_def_bone(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED);
RNA_def_property_ui_text(prop, "Selected", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
+
+ /* XXX better matrix descriptions possible (Arystan) */
+ prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "bone_mat");
+ RNA_def_property_array(prop, 9);
+ RNA_def_property_ui_text(prop, "Bone Matrix", "3x3 bone matrix.");
+
+ prop= RNA_def_property(srna, "armature_matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "arm_mat");
+ RNA_def_property_array(prop, 16);
+ RNA_def_property_ui_text(prop, "Bone Armature-Relative Matrix", "4x4 bone matrix relative to armature.");
+
+ prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "tail");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone.");
+
+ prop= RNA_def_property(srna, "armature_tail", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "arm_tail");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Armature-Relative Tail", "Location of tail end of the bone relative to armature.");
+
+ prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "head");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone.");
+
+ prop= RNA_def_property(srna, "armature_head", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "arm_head");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Armature-Relative Head", "Location of head end of the bone relative to armature.");
}
static void rna_def_edit_bone(BlenderRNA *brna)
@@ -520,29 +558,43 @@ static void rna_def_edit_bone(BlenderRNA *brna)
RNA_define_verify_sdna(1);
}
-void rna_def_armature(BlenderRNA *brna)
+static void rna_def_armature(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_drawtype_items[] = {
- {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Draw bones as octahedral shape (default)."},
- {ARM_LINE, "STICK", 0, "Stick", "Draw bones as simple 2D lines with dots."},
- {ARM_B_BONE, "BBONE", 0, "B-Bone", "Draw bones as boxes, showing subdivision and B-Splines"},
- {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Draw bones as extruded spheres, showing defomation influence volume."},
+ {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape (default)."},
+ {ARM_LINE, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots."},
+ {ARM_B_BONE, "BBONE", 0, "B-Bone", "Display bones as boxes, showing subdivision and B-Splines"},
+ {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Display bones as extruded spheres, showing defomation influence volume."},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_ghost_type_items[] = {
- {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Current Frame", "Draw Ghosts of poses within a fixed number of frames around the current frame."},
- {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Draw Ghosts of poses within specified range."},
- {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Draw Ghosts of poses on Keyframes."},
+ {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame."},
+ {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range."},
+ {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes."},
+ {0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_paths_type_items[]= {
+ {ARM_PATH_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display Paths of poses within a fixed number of frames around the current frame."},
+ {0, "RANGE", 0, "In Range", "Display Paths of poses within specified range."},
+ {0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_paths_location_items[]= {
+ {ARM_PATH_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"},
+ {0, "TAILS", 0, "Tails", "Calculate bone paths from tails"},
+ {0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_pose_position_items[]= {
+ {0, "POSE_POSITION", 0, "Pose Position", "Show armature in posed state."},
+ {ARM_RESTPOS, "REST_POSITION", 0, "Rest Position", "Show Armature in binding pose state. No posing possible."},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Armature", "ID");
RNA_def_struct_ui_text(srna, "Armature", "Armature datablock containing a hierarchy of bones, usually used for rigging characters.");
RNA_def_struct_ui_icon(srna, ICON_ARMATURE_DATA);
-
RNA_def_struct_sdna(srna, "bArmature");
+ /* Animation Data */
+ rna_def_animdata_common(srna);
+
/* Collections */
prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL);
@@ -556,6 +608,17 @@ void rna_def_armature(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Edit Bones", "");
/* Enum values */
+// prop= RNA_def_property(srna, "rest_position", PROP_BOOLEAN, PROP_NONE);
+// RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_RESTPOS);
+// RNA_def_property_ui_text(prop, "Rest Position", "Show Armature in Rest Position. No posing possible.");
+// RNA_def_property_update(prop, 0, "rna_Armature_update_data");
+
+ prop= RNA_def_property(srna, "pose_position", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_pose_position_items);
+ RNA_def_property_ui_text(prop, "Pose Position", "Show armature in binding pose or final posed state.");
+ RNA_def_property_update(prop, 0, "rna_Armature_update_data");
+
prop= RNA_def_property(srna, "drawtype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_drawtype_items);
RNA_def_property_ui_text(prop, "Draw Type", "");
@@ -564,7 +627,19 @@ void rna_def_armature(BlenderRNA *brna)
prop= RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ghosttype");
RNA_def_property_enum_items(prop, prop_ghost_type_items);
- RNA_def_property_ui_text(prop, "Ghost Drawing", "Method of Onion-skinning for active Action");
+ RNA_def_property_ui_text(prop, "Ghost Type", "Method of Onion-skinning for active Action");
+ RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
+
+ prop= RNA_def_property(srna, "paths_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "pathflag");
+ RNA_def_property_enum_items(prop, prop_paths_type_items);
+ RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Bone Paths");
+ RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
+
+ prop= RNA_def_property(srna, "paths_location", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "pathflag");
+ RNA_def_property_enum_items(prop, prop_paths_location_items);
+ RNA_def_property_ui_text(prop, "Paths Location", "When calculating Bone Paths, use Head or Tips");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* Boolean values */
@@ -574,7 +649,7 @@ void rna_def_armature(BlenderRNA *brna)
RNA_def_property_array(prop, 16);
RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility.");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
/* layer protection */
@@ -585,10 +660,7 @@ void rna_def_armature(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* flag */
- prop= RNA_def_property(srna, "rest_position", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_RESTPOS);
- RNA_def_property_ui_text(prop, "Rest Position", "Show Armature in Rest Position. No posing possible.");
- RNA_def_property_update(prop, 0, "rna_Armature_update_data");
+
prop= RNA_def_property(srna, "draw_axes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES);
@@ -626,8 +698,8 @@ void rna_def_armature(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
prop= RNA_def_property(srna, "ghost_only_selected", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_GHOST_ONLYSEL);
- RNA_def_property_ui_text(prop, "Draw Ghosts on Selected Keyframes Only", "");
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_GHOST_ONLYSEL);
+ RNA_def_property_ui_text(prop, "Draw Ghosts on Selected Bones Only", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* deformflag */
@@ -672,15 +744,6 @@ void rna_def_armature(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Paths Show Keyframe Numbers", "When drawing Armature in Pose Mode, show frame numbers of Keyframes on Bone Paths");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "paths_show_around_current_frame", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_ACFRA);
- RNA_def_property_ui_text(prop, "Paths Around Current Frame", "When drawing Armature in Pose Mode, only show section of Bone Paths that falls around current frame");
- RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
-
- prop= RNA_def_property(srna, "paths_calculate_head_positions", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_HEADS);
- RNA_def_property_ui_text(prop, "Paths Use Heads", "When calculating Bone Paths, use Head locations instead of Tips");
- RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* Number fields */
/* ghost/onionskining settings */
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index 8002aa89313..36a648c8a82 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -74,44 +74,33 @@ EnumPropertyItem boidruleset_type_items[] ={
static void rna_Boids_reset(bContext *C, PointerRNA *ptr)
{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
-
if(ptr->type==&RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
psys->recalc = PSYS_RECALC_RESET;
- if(ob)
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- else {
- part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET);
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
}
+ else
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
}
static void rna_Boids_reset_deps(bContext *C, PointerRNA *ptr)
{
Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
if(ptr->type==&RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
psys->recalc = PSYS_RECALC_RESET;
- if(ob)
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- else {
- part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET);
- DAG_scene_sort(scene);
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
}
+ else
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
+
+ DAG_scene_sort(scene);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 448a2046855..e87c8434a7d 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * Contributor(s): Blender Foundation (2008), Juho Vepsäläinen
+ * Contributor(s): Blender Foundation (2008), Juho Veps�l�inen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -51,6 +51,9 @@ EnumPropertyItem brush_sculpt_tool_items[] = {
#include "BKE_texture.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static void rna_Brush_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Brush *brush= (Brush*)ptr->data;
@@ -87,9 +90,58 @@ static void rna_Brush_active_texture_set(PointerRNA *ptr, PointerRNA value)
}
}
+static void rna_Brush_update(bContext *C, PointerRNA *ptr)
+{
+ Brush *br= (Brush*)ptr->data;
+ WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, br);
+}
+
+static float rna_BrushTextureSlot_angle_get(PointerRNA *ptr)
+{
+ MTex *tex= (MTex*)ptr->data;
+ const float conv = 57.295779506;
+ return tex->rot * conv;
+}
+
+static void rna_BrushTextureSlot_angle_set(PointerRNA *ptr, float v)
+{
+ MTex *tex= (MTex*)ptr->data;
+ const float conv = 0.017453293;
+ tex->rot = v * conv;
+}
+
#else
-void rna_def_brush(BlenderRNA *brna)
+static void rna_def_brush_texture_slot(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_map_mode_items[] = {
+ {MTEX_MAP_MODE_FIXED, "FIXED", 0, "Fixed", ""},
+ {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
+ {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
+ RNA_def_struct_sdna(srna, "MTex");
+ RNA_def_struct_ui_text(srna, "Brush Texture Slot", "Texture slot for textures in a Brush datablock.");
+
+ prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "rot");
+ RNA_def_property_range(prop, 0, 360);
+ RNA_def_property_float_funcs(prop, "rna_BrushTextureSlot_angle_get", "rna_BrushTextureSlot_angle_set", NULL);
+ RNA_def_property_ui_text(prop, "Angle", "Defines brush texture rotation.");
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
+
+ prop= RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
+ RNA_def_property_enum_items(prop, prop_map_mode_items);
+ RNA_def_property_ui_text(prop, "Mode", "");
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
+}
+
+static void rna_def_brush(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -104,6 +156,11 @@ void rna_def_brush(BlenderRNA *brna)
{IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting."},
{IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting."},
{0, NULL, 0, NULL, NULL}};
+
+ static const EnumPropertyItem prop_flip_direction_items[]= {
+ {0, "ADD", 0, "Add", "Add effect of brush"},
+ {BRUSH_DIR_IN, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Brush", "ID");
RNA_def_struct_ui_text(srna, "Brush", "Brush datablock for storing brush settings for painting and sculpting.");
@@ -113,128 +170,157 @@ void rna_def_brush(BlenderRNA *brna)
prop= RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_blend_items);
RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, brush_sculpt_tool_items);
RNA_def_property_ui_text(prop, "Sculpt Tool", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_flip_direction_items);
+ RNA_def_property_ui_text(prop, "Direction", "Mapping type to use for this image in the game engine.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* number values */
prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 200);
RNA_def_property_ui_text(prop, "Size", "Diameter of the brush.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "innerradius");
+ prop= RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "jitter");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Falloff", "Falloff radius of the brush.");
-
+ RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
prop= RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spacing");
RNA_def_property_range(prop, 1.0f, 100.0f);
RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush stamps.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 10, 200);
RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.5, 0.99);
RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rate");
RNA_def_property_range(prop, 0.010f, 1.0f);
RNA_def_property_ui_text(prop, "Rate", "Number of paints per second for Airbrush.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "rgb");
RNA_def_property_ui_text(prop, "Color", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Strength", "The amount of pressure on the brush.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* flag */
- prop= RNA_def_property(srna, "airbrush", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH);
RNA_def_property_ui_text(prop, "Airbrush", "Keep applying paint effect while holding mouse (spray).");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS);
RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "strength_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "size_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_size_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "falloff_pressure", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAD_PRESSURE);
+ prop= RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_JITTER_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
- RNA_def_property_ui_text(prop, "Falloff Pressure", "Enable tablet pressure sensitivity for falloff.");
-
- prop= RNA_def_property(srna, "spacing_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "use_spacing_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "rake", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAKE);
RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "anchored", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED);
RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "flip_direction", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_DIR_IN);
- RNA_def_property_ui_text(prop, "Flip Direction", "Move vertices in the opposite direction.");
-
- prop= RNA_def_property(srna, "space", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE);
RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "smooth_stroke", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE);
RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "persistent", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PERSISTENT);
RNA_def_property_ui_text(prop, "Persistent", "Sculpts on a persistent layer of the mesh.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* not exposed in the interface yet
prop= RNA_def_property(srna, "fixed_tex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX);
- RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");*/
+ RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update"); */
- prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* texture */
rna_def_mtex_common(srna, "rna_Brush_mtex_begin", "rna_Brush_active_texture_get",
- "rna_Brush_active_texture_set", "TextureSlot");
+ "rna_Brush_active_texture_set", "BrushTextureSlot", "rna_Brush_update");
/* clone tool */
prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "clone_opacity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clone.alpha");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clone Opacity", "Opacity of clone image display.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "clone.offset");
RNA_def_property_ui_text(prop, "Clone Offset", "");
RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3);
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
}
@@ -286,6 +372,7 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna)
void RNA_def_brush(BlenderRNA *brna)
{
rna_def_brush(brna);
+ rna_def_brush_texture_slot(brna);
rna_def_operator_stroke_element(brna);
}
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 9c33b0afb00..6254041c7ef 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -22,7 +22,9 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#define _USE_MATH_DEFINES
#include <stdlib.h>
+#include <math.h>
#include "RNA_define.h"
#include "RNA_types.h"
@@ -35,6 +37,19 @@
#ifdef RNA_RUNTIME
+static void rna_Camera_angle_update(bContext *C, PointerRNA *ptr)
+{
+ Camera *cam= (Camera*)ptr->id.data;
+ cam->lens = 16.0f / tan(M_PI*cam->angle/360.0f);
+}
+
+static void rna_Camera_lens_update(bContext *C, PointerRNA *ptr)
+{
+ Camera *cam= (Camera*)ptr->id.data;
+ cam->angle= 360.0f * atan(16.0f/cam->lens) / M_PI;
+}
+
+
#else
void RNA_def_camera(BlenderRNA *brna)
@@ -62,7 +77,7 @@ void RNA_def_camera(BlenderRNA *brna)
/* Number values */
- prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "passepartalpha");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view.");
@@ -72,7 +87,7 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lend field of view in degrees.");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_angle_update");
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
@@ -90,7 +105,7 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "lens");
RNA_def_property_range(prop, 1.0f, 250.0f);
RNA_def_property_ui_text(prop, "Lens", "Perspective Camera lens value in mm.");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_lens_update");
prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 22cc2e2c9c3..d64e2c7119b 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -306,6 +306,11 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness.");
RNA_def_property_update(prop, 0, "rna_cloth_update");
+ 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", "");
+
/* unused */
/* unused still
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 420add2622a..4cef6fa481f 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -216,13 +216,15 @@ static void rna_def_curvemapping(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "CurveMap");
RNA_def_property_ui_text(prop, "Curves", "");
- prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR);
+ prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_RGB);
RNA_def_property_float_sdna(prop, NULL, "black");
+ RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Black Level", "For RGB curves, the color that black is mapped to");
RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_black_level_set", NULL);
- prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR);
+ prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_RGB);
RNA_def_property_float_sdna(prop, NULL, "white");
+ RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "White Level", "For RGB curves, the color that white is mapped to");
RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_white_level_set", NULL);
}
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 815023ee315..b630e61a680 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -33,6 +33,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "ED_object.h"
#include "WM_types.h"
EnumPropertyItem constraint_type_items[] ={
@@ -80,6 +81,19 @@ EnumPropertyItem space_object_items[] = {
{1, "LOCAL", 0, "Local (Without Parent) Space", ""},
{0, NULL, 0, NULL, NULL}};
+EnumPropertyItem constraint_ik_type_items[] ={
+ {CONSTRAINT_IK_COPYPOSE, "COPY_POSE", 0, "Copy Pose", ""},
+ {CONSTRAINT_IK_DISTANCE, "DISTANCE", 0, "Distance", ""},
+ {0, NULL, 0, NULL, NULL},
+};
+
+static EnumPropertyItem constraint_distance_items[] = {
+ {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", ""},
+ {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", ""},
+ {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
#ifdef RNA_RUNTIME
#include "BKE_action.h"
@@ -89,7 +103,7 @@ EnumPropertyItem space_object_items[] = {
#include "ED_object.h"
-StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
+static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
{
bConstraint *con= (bConstraint*)ptr->data;
@@ -160,24 +174,12 @@ static char *rna_Constraint_path(PointerRNA *ptr)
static void rna_Constraint_update(bContext *C, PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
-
- if(ob->pose) update_pose_constraint_flags(ob->pose);
-
- object_test_constraints(ob);
-
- if(ob->type==OB_ARMATURE) DAG_id_flush_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
- else DAG_id_flush_update(&ob->id, OB_RECALC_OB);
+ ED_object_constraint_update(ptr->id.data);
}
static void rna_Constraint_dependency_update(bContext *C, PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
-
- rna_Constraint_update(C, ptr);
-
- if(ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
- DAG_scene_sort(CTX_data_scene(C));
+ ED_object_constraint_dependency_update(CTX_data_scene(C), ptr->id.data);
}
static void rna_Constraint_influence_update(bContext *C, PointerRNA *ptr)
@@ -190,6 +192,24 @@ static void rna_Constraint_influence_update(bContext *C, PointerRNA *ptr)
rna_Constraint_update(C, ptr);
}
+static void rna_Constraint_ik_type_set(struct PointerRNA *ptr, int value)
+{
+ bConstraint *con = ptr->data;
+ bKinematicConstraint *ikdata = con->data;
+
+ if (ikdata->type != value) {
+ // the type of IK constraint has changed, set suitable default values
+ // in case constraints reuse same fields incompatible
+ switch (value) {
+ case CONSTRAINT_IK_COPYPOSE:
+ break;
+ case CONSTRAINT_IK_DISTANCE:
+ break;
+ }
+ ikdata->type = value;
+ }
+}
+
static EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *C, PointerRNA *ptr, int *free)
{
Object *ob= (Object*)ptr->id.data;
@@ -253,6 +273,22 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *C, PointerR
return space_object_items;
}
+static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float *max)
+{
+ bConstraint *con= (bConstraint*)ptr->data;
+ bActionConstraint *acon = (bActionConstraint *)con->data;
+
+ /* 0, 1, 2 = magic numbers for rotX, rotY, rotZ */
+ if (ELEM3(acon->type, 0, 1, 2)) {
+ *min= -90.f;
+ *max= 90.f;
+ } else {
+ *min= -1000.f;
+ *max= 1000.f;
+ }
+}
+
+
#else
static void rna_def_constrainttarget(BlenderRNA *brna)
@@ -440,21 +476,40 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
prop= RNA_def_property(srna, "tail", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_TIP);
RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain.");
- RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_ROT);
RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target.");
- RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "targetless", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO);
RNA_def_property_ui_text(prop, "Targetless", "Use targetless IK.");
- RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_STRETCH);
RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "ik_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Constraint_ik_type_set", NULL);
+ RNA_def_property_enum_items(prop, constraint_ik_type_items);
+ RNA_def_property_ui_text(prop, "IK Type", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, constraint_distance_items);
+ RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dist");
+ RNA_def_property_range(prop, 0.0, 100.f);
+ RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
@@ -575,7 +630,7 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna)
srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target.");
- prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -781,15 +836,17 @@ static void rna_def_constraint_action(BlenderRNA *brna)
prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
- RNA_def_property_range(prop, 0.0, 1000.f);
+ RNA_def_property_range(prop, -1000.f, 1000.f);
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for target channel range.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
- RNA_def_property_range(prop, 0.0, 1000.f);
+ RNA_def_property_range(prop, -1000.f, 1000.f);
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
}
static void rna_def_constraint_locked_track(BlenderRNA *brna)
@@ -875,10 +932,10 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Offset", "Offset from the position corresponding to the time frame.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "offset_percentage", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "offset_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "offset"); // XXX we might be better with another var or some hackery?
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Offset Percentage", "Percentage value defining target position along length of bone.");
+ RNA_def_property_ui_text(prop, "Offset Factor", "Percentage value defining target position along length of bone.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "forward", PROP_ENUM, PROP_NONE);
@@ -1457,12 +1514,6 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem distance_items[] = {
- {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", ""},
- {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", ""},
- {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", ""},
- {0, NULL, 0, NULL, NULL}};
-
srna= RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limits the distance from target object.");
RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data");
@@ -1486,7 +1537,7 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna)
prop= RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
- RNA_def_property_enum_items(prop, distance_items);
+ RNA_def_property_enum_items(prop, constraint_distance_items);
RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
@@ -1599,12 +1650,23 @@ void RNA_def_constraint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Proxy Local", "Constraint was added in this proxy instance (i.e. did not belong to source Armature).");
/* values */
- prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "enforce");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Amount of influence constraint will have on the final solution.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_influence_update");
-
+
+ /* readonly values */
+ prop= RNA_def_property(srna, "lin_error", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "lin_error");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Lin error", "Amount of residual error in Blender space unit for constraints that work on position.");
+
+ prop= RNA_def_property(srna, "rot_error", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "rot_error");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Rot error", "Amount of residual error in radiant for constraints that work on orientation.");
+
/* pointers */
rna_def_constrainttarget(brna);
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index da4abe81f24..3b6bd2255f2 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -54,6 +54,7 @@ EnumPropertyItem beztriple_interpolation_mode_items[] = {
EnumPropertyItem beztriple_keyframe_type_items[] = {
{BEZT_KEYTYPE_KEYFRAME, "KEYFRAME", 0, "Keyframe", ""},
{BEZT_KEYTYPE_BREAKDOWN, "BREAKDOWN", 0, "Breakdown", ""},
+ {BEZT_KEYTYPE_EXTREME, "EXTREME", 0, "Extreme", ""},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
@@ -66,7 +67,7 @@ EnumPropertyItem beztriple_keyframe_type_items[] = {
#include "WM_api.h"
-StructRNA *rna_Curve_refine(PointerRNA *ptr)
+static StructRNA *rna_Curve_refine(PointerRNA *ptr)
{
Curve *cu= (Curve*)ptr->data;
short obtype= curve_type(cu);
@@ -167,12 +168,18 @@ static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int
}
-static void rna_Curve_2d_set(PointerRNA *ptr, int value)
+static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
{
Curve *cu= (Curve*)ptr->id.data;
Nurb *nu= cu->editnurb ? cu->editnurb->first : cu->nurb.first;
- if(value) {
+ if(value==CU_3D) {
+ cu->flag |= CU_3D;
+ for( ; nu; nu= nu->next) {
+ nu->flag &= ~CU_2D;
+ }
+ }
+ else {
cu->flag &= ~CU_3D;
for( ; nu; nu= nu->next) {
nu->flag |= CU_2D;
@@ -183,12 +190,6 @@ static void rna_Curve_2d_set(PointerRNA *ptr, int value)
calchandlesNurb(nu);
}
}
- else {
- cu->flag |= CU_3D;
- for( ; nu; nu= nu->next) {
- nu->flag &= ~CU_2D;
- }
- }
}
@@ -675,6 +676,11 @@ static void rna_def_curve(BlenderRNA *brna)
{CU_TWIST_TANGENT, "TANGENT", 0, "Tangent", "Use the tangent to calculate twist"},
{0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem curve_axis_items[]= {
+ {0, "2D", 0, "2D", "Clamp the Z axis of of the curve"},
+ {CU_3D, "3D", 0, "3D", "Allow editing on the Z axis of this curve, also alows tilt and curve radius to be used."},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "Curve", "ID");
RNA_def_struct_ui_text(srna, "Curve", "Curve datablock storing curves, splines and NURBS.");
RNA_def_struct_ui_icon(srna, ICON_CURVE_DATA);
@@ -778,10 +784,12 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Flags */
- prop= RNA_def_property(srna, "curve_2d", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CU_3D);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_Curve_2d_set");
- RNA_def_property_ui_text(prop, "2D Curve", "Define curve in two dimensions only. Note that fill only works when this is enabled.");
+
+ prop= RNA_def_property(srna, "dimensions", PROP_ENUM, PROP_NONE); /* as an enum */
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, curve_axis_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Curve_dimension_set", NULL);
+ RNA_def_property_ui_text(prop, "Dimensions", "Select 2D or 3D curve type.");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "front", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 8d05cbde74c..cc86da18a0b 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -66,7 +66,7 @@ void rna_addtail(ListBase *listbase, void *vlink)
listbase->last = link;
}
-void rna_remlink(ListBase *listbase, void *vlink)
+static void rna_remlink(ListBase *listbase, void *vlink)
{
Link *link= vlink;
@@ -134,7 +134,7 @@ PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop)
if(!DefRNA.preprocess) {
/* we should never get here */
- fprintf(stderr, "rna_find_property_def: only at preprocess time.\n");
+ fprintf(stderr, "rna_find_struct_property_def: only at preprocess time.\n");
return NULL;
}
@@ -155,7 +155,8 @@ PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop)
return NULL;
}
-PropertyDefRNA *rna_find_property_def(PropertyRNA *prop)
+#if 0
+static PropertyDefRNA *rna_find_property_def(PropertyRNA *prop)
{
PropertyDefRNA *dprop;
@@ -175,6 +176,7 @@ PropertyDefRNA *rna_find_property_def(PropertyRNA *prop)
return NULL;
}
+#endif
FunctionDefRNA *rna_find_function_def(FunctionRNA *func)
{
@@ -239,7 +241,7 @@ PropertyDefRNA *rna_find_parameter_def(PropertyRNA *parm)
return NULL;
}
-ContainerDefRNA *rna_find_container_def(ContainerRNA *cont)
+static ContainerDefRNA *rna_find_container_def(ContainerRNA *cont)
{
StructDefRNA *ds;
FunctionDefRNA *dfunc;
@@ -888,7 +890,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
fprop->softmin= 0.0f;
fprop->softmax= 1.0f;
}
- else if(subtype == PROP_PERCENTAGE) {
+ else if(subtype == PROP_FACTOR) {
fprop->softmin= fprop->hardmin= 0.0f;
fprop->softmax= fprop->hardmax= 1.0f;
}
@@ -1528,7 +1530,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const
iprop->softmax= 10000;
}
- if(prop->subtype == PROP_UNSIGNED || prop->subtype == PROP_PERCENTAGE)
+ if(prop->subtype == PROP_UNSIGNED || prop->subtype == PROP_PERCENTAGE || prop->subtype == PROP_FACTOR)
iprop->hardmin= iprop->softmin= 0;
}
}
@@ -2113,6 +2115,20 @@ PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont_, const char *ide
return prop;
}
+PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen,
+ const char *ui_name, const char *ui_description)
+{
+ ContainerRNA *cont= cont_;
+ PropertyRNA *prop;
+
+ prop= RNA_def_property(cont, identifier, PROP_STRING, PROP_FILENAME);
+ if(maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
+ if(default_value) RNA_def_property_string_default(prop, default_value);
+ RNA_def_property_ui_text(prop, ui_name, ui_description);
+
+ return prop;
+}
+
PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value,
const char *ui_name, const char *ui_description)
{
@@ -2245,6 +2261,21 @@ PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont_, const char *id
return prop;
}
+PropertyRNA *RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, float default_value,
+ float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
+{
+ ContainerRNA *cont= cont_;
+ PropertyRNA *prop;
+
+ prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, default_value);
+ if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ RNA_def_property_ui_text(prop, ui_name, ui_description);
+ RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
+
+ return prop;
+}
+
PropertyRNA *RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type,
const char *ui_name, const char *ui_description)
{
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index bafe83f1812..2802665c639 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -52,7 +52,7 @@ EnumPropertyItem fmodifier_type_items[] = {
/* --------- */
-StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr)
+static StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr)
{
FModifier *fcm= (FModifier *)ptr->data;
@@ -460,7 +460,7 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna)
/* --------- */
-void rna_def_fmodifier(BlenderRNA *brna)
+static void rna_def_fmodifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -510,7 +510,7 @@ void rna_def_fmodifier(BlenderRNA *brna)
/* *********************** */
-void rna_def_drivertarget(BlenderRNA *brna)
+static void rna_def_drivertarget(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -536,7 +536,7 @@ void rna_def_drivertarget(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific property used (if applicable)");
}
-void rna_def_channeldriver(BlenderRNA *brna)
+static void rna_def_channeldriver(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -590,7 +590,7 @@ static void rna_def_fpoint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
}
-void rna_def_fcurve(BlenderRNA *brna)
+static void rna_def_fcurve(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index a62002365c9..c415b3d716a 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -151,6 +151,14 @@ static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *ptr)
return 32;
}
+static char *rna_FluidSettings_path(PointerRNA *ptr)
+{
+ FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
+ ModifierData *md= (ModifierData *)fss->fmd;
+
+ return BLI_sprintfN("modifiers[%s].settings", md->name);
+}
+
#else
static void rna_def_fluidsim_slip(StructRNA *srna)
@@ -509,6 +517,7 @@ void RNA_def_fluidsim(BlenderRNA *brna)
srna= RNA_def_struct(brna, "FluidSettings", NULL);
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_refine_func(srna, "rna_FluidSettings_refine");
+ RNA_def_struct_path_func(srna, "rna_FluidSettings_path");
RNA_def_struct_ui_text(srna, "Fluid Simulation Settings", "Fluid simulation settings for an object taking part in the simulation.");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 72e77e93607..2a4ff112c3c 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -48,7 +48,7 @@ static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr)
return 1;
}
-void rna_GPencilLayer_active_set(PointerRNA *ptr, int value)
+static void rna_GPencilLayer_active_set(PointerRNA *ptr, int value)
{
bGPdata *gpd= ptr->id.data;
bGPDlayer *gpl= ptr->data;
@@ -68,7 +68,7 @@ void rna_GPencilLayer_active_set(PointerRNA *ptr, int value)
#else
-void rna_def_gpencil_stroke_point(BlenderRNA *brna)
+static void rna_def_gpencil_stroke_point(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -88,7 +88,7 @@ void rna_def_gpencil_stroke_point(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it.");
}
-void rna_def_gpencil_stroke(BlenderRNA *brna)
+static void rna_def_gpencil_stroke(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -107,7 +107,7 @@ void rna_def_gpencil_stroke(BlenderRNA *brna)
// TODO...
}
-void rna_def_gpencil_frame(BlenderRNA *brna)
+static void rna_def_gpencil_frame(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -138,7 +138,7 @@ void rna_def_gpencil_frame(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Selected", "Frame is selected for editing in the DopeSheet.");
}
-void rna_def_gpencil_layer(BlenderRNA *brna)
+static void rna_def_gpencil_layer(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -215,7 +215,7 @@ void rna_def_gpencil_layer(BlenderRNA *brna)
}
-void rna_def_gpencil_data(BlenderRNA *brna)
+static void rna_def_gpencil_data(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -233,7 +233,7 @@ void rna_def_gpencil_data(BlenderRNA *brna)
/* Flags */
prop= RNA_def_property(srna, "view_space_draw", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_VIEWALIGN);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_DATA_VIEWALIGN);
RNA_def_property_ui_text(prop, "Stick to View", "Newly drawn strokes get added in view space (i.e. sketches stick to data when view is manipulated).");
}
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c
index 31bc6ccc74b..dddc2062f07 100644
--- a/source/blender/makesrna/intern/rna_group.c
+++ b/source/blender/makesrna/intern/rna_group.c
@@ -33,7 +33,7 @@
#ifdef RNA_RUNTIME
-PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter)
+static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal= iter->internal;
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index 4d04f4ee1f3..521756b8539 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -37,6 +37,14 @@
#include "WM_types.h"
+static EnumPropertyItem image_source_items[]= {
+ {IMA_SRC_FILE, "FILE", 0, "File", "Single image file"},
+ {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Sequence", "Multiple image files, as a sequence"},
+ {IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"},
+ {IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"},
+ {IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "IMB_imbuf_types.h"
@@ -66,6 +74,110 @@ static int rna_Image_dirty_get(PointerRNA *ptr)
return 0;
}
+static void rna_Image_source_update(bContext *C, PointerRNA *ptr)
+{
+ Image *ima= ptr->id.data;
+ BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE);
+}
+
+static void rna_Image_fields_update(bContext *C, PointerRNA *ptr)
+{
+ Image *ima= ptr->id.data;
+ ImBuf *ibuf;
+ void *lock;
+
+ ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
+
+ if(ibuf) {
+ short nr= 0;
+
+ if(!(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields)) nr= 1;
+ if((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr= 1;
+
+ if(nr)
+ BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
+ }
+
+ BKE_image_release_ibuf(ima, lock);
+}
+
+static void rna_Image_reload_update(bContext *C, PointerRNA *ptr)
+{
+ Image *ima= ptr->id.data;
+ BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
+ printf("reload %p\n", ima);
+}
+
+static void rna_Image_generated_update(bContext *C, PointerRNA *ptr)
+{
+ Image *ima= ptr->id.data;
+ BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
+}
+
+static void rna_ImageUser_update(bContext *C, PointerRNA *ptr)
+{
+ Scene *scene= CTX_data_scene(C);
+ ImageUser *iuser= ptr->data;
+
+ BKE_image_user_calc_imanr(iuser, scene->r.cfra, 0);
+}
+
+static EnumPropertyItem *rna_Image_source_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ Image *ima= (Image*)ptr->data;
+ EnumPropertyItem *item= NULL;
+ int totitem= 0;
+
+ if(C==NULL) /* needed for doc generation */
+ return image_source_items;
+
+ if(ima->source == IMA_SRC_VIEWER) {
+ RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_VIEWER);
+ }
+ else {
+ RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_FILE);
+ RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_SEQUENCE);
+ RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_MOVIE);
+ RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_GENERATED);
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+ *free= 1;
+
+ return item;
+}
+
+static int rna_Image_has_data_get(PointerRNA *ptr)
+{
+ Image *im= (Image*)ptr->data;
+
+ if (im->ibufs.first)
+ return 1;
+
+ return 0;
+}
+
+static int rna_Image_depth_get(PointerRNA *ptr)
+{
+ Image *im= (Image*)ptr->data;
+ ImBuf *ibuf;
+ void *lock;
+ int depth;
+
+ ibuf= BKE_image_acquire_ibuf(im, NULL, &lock);
+
+ if(!ibuf)
+ depth= 0;
+ else if(ibuf->rect_float)
+ depth= 128;
+ else
+ depth= ibuf->depth;
+
+ BKE_image_release_ibuf(im, lock);
+
+ return depth;
+}
+
#else
static void rna_def_imageuser(BlenderRNA *brna)
@@ -79,29 +191,35 @@ static void rna_def_imageuser(BlenderRNA *brna)
prop= RNA_def_property(srna, "auto_refresh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS);
RNA_def_property_ui_text(prop, "Auto Refresh", "Always refresh image on frame changes.");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
/* animation */
prop= RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cycl", 0);
RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie.");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "frames", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use.");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation.");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, 1.0f, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie.");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "fie_ima");
RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Fields per Frame", "The number of fields per rendered frame (2 fields is 1 image).");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "layer");
@@ -121,25 +239,22 @@ static void rna_def_image(BlenderRNA *brna)
static const EnumPropertyItem prop_type_items[]= {
{IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
{IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""},
- {IMA_TYPE_UV_TEST, "UVTEST", 0, "UV Test", ""},
- {IMA_TYPE_R_RESULT, "RENDERRESULT", 0, "Render Result", ""},
+ {IMA_TYPE_UV_TEST, "UV_TEST", 0, "UV Test", ""},
+ {IMA_TYPE_R_RESULT, "RENDER_RESULT", 0, "Render Result", ""},
{IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_source_items[]= {
- {IMA_SRC_FILE, "FILE", 0, "File", "Single image file"},
- {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Sequence", "Multiple image files, as a sequence"},
- {IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"},
- {IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"},
- {IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"},
- {0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_generated_type_items[]= {
{0, "BLANK", 0, "Blank", "Generate a blank image"},
- {1, "UVTESTGRID", 0, "UV Test Grid", "Generated grid to test UV mappings"},
+ {1, "UVGRID", 0, "UV Grid", "Generated grid to test UV mappings"},
{0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_mapping_items[]= {
{0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"},
{IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"},
{0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_field_order_items[]= {
+ {0, "EVEN", 0, "Even", "Even Fields first"},
+ {IMA_STD_FIELD, "ODD", 0, "Odd", "Odd Fields first"},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Image", "ID");
RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image.");
@@ -147,36 +262,36 @@ static void rna_def_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* imagechanged */
RNA_def_property_ui_text(prop, "Filename", "Image/Movie file name.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_source_items);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* imagechanged */
+ RNA_def_property_enum_items(prop, image_source_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Image_source_itemf");
RNA_def_property_ui_text(prop, "Source", "Where the image comes from.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_source_update");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* imagechanged */
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Type", "How to generate the image.");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
RNA_def_property_ui_text(prop, "Packed File", "");
-
+
+ prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_field_order_items);
+ RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines are displayed first.");
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+
/* booleans */
prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS);
RNA_def_property_ui_text(prop, "Fields", "Use fields of the image.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
-
- prop= RNA_def_property(srna, "odd_fields", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_STD_FIELD);
- RNA_def_property_ui_text(prop, "Odd Fields", "Standard field toggle.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_fields_update");
prop= RNA_def_property(srna, "antialias", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANTIALI);
@@ -198,19 +313,19 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "gen_type");
RNA_def_property_enum_items(prop, prop_generated_type_items);
RNA_def_property_ui_text(prop, "Generated Type", "Generated image type.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
prop= RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gen_x");
RNA_def_property_range(prop, 1, 16384);
RNA_def_property_ui_text(prop, "Generated Width", "Generated image width.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
prop= RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gen_y");
RNA_def_property_range(prop, 1, 16384);
RNA_def_property_ui_text(prop, "Generated Height", "Generated image height.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
/* realtime properties */
prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
@@ -275,6 +390,22 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V);
RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically.");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+
+ /*
+ Image.has_data and Image.depth are temporary,
+ Update import_obj.py when they are replaced (Arystan)
+ */
+ prop= RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_Image_has_data_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Has data", "True if this image has data.");
+
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
+ RNA_def_property_int_funcs(prop, "rna_Image_depth_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Depth", "Image bit depth.");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
+ RNA_api_image(srna);
}
void RNA_def_image(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
new file mode 100644
index 00000000000..2bb7905fc03
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -0,0 +1,101 @@
+/**
+ * $Id$
+ *
+ * ***** 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Arystanbek Dyussenov
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_image.h"
+#include "BKE_main.h"
+#include "BKE_utildefines.h"
+
+#include "DNA_image_types.h"
+#include "DNA_scene_types.h"
+
+#include "MEM_guardedalloc.h"
+
+/*
+ User should check if returned path exists before copying a file there.
+
+ TODO: it would be better to return a (abs, rel) tuple.
+*/
+static char *rna_Image_get_export_path(Image *image, char *dest_dir, int rel)
+{
+ int length = FILE_MAX;
+ char *path= MEM_callocN(length, "image file path");
+
+ if (!BKE_get_image_export_path(image, dest_dir, rel ? NULL : path, length, rel ? path : NULL, length )) {
+ MEM_freeN(path);
+ return NULL;
+ }
+
+ return path;
+}
+
+char *rna_Image_get_abs_filename(Image *image, bContext *C)
+{
+ char *filename= MEM_callocN(FILE_MAX, "Image.get_abs_filename()");
+
+ BLI_strncpy(filename, image->name, FILE_MAXDIR + FILE_MAXFILE);
+ BLI_convertstringcode(filename, CTX_data_main(C)->name);
+ BLI_convertstringframe(filename, CTX_data_scene(C)->r.cfra);
+
+ return filename;
+}
+
+#else
+
+void RNA_api_image(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "get_export_path", "rna_Image_get_export_path");
+ RNA_def_function_ui_description(func, "Produce image export path.");
+ parm= RNA_def_string(func, "dest_dir", "", 0, "", "Destination directory.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_boolean(func, "get_rel_path", 1, "", "Return relative path if True.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_string(func, "path", "", 0, "", "Absolute export path.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "get_abs_filename", "rna_Image_get_abs_filename");
+ RNA_def_function_ui_description(func, "Get absolute filename.");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ parm= RNA_def_string_file_path(func, "abs_filename", NULL, 0, "", "Image/movie absolute filename.");
+ RNA_def_function_return(func, parm);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 7de80843f27..1ebf03425d4 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -173,7 +173,7 @@ void RNA_def_world(struct BlenderRNA *brna);
void rna_def_animdata_common(struct StructRNA *srna);
void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
-void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname);
+void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *update);
void rna_def_render_layer_common(struct StructRNA *srna, int scene);
void rna_ID_name_get(struct PointerRNA *ptr, char *value);
@@ -197,17 +197,23 @@ void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, ch
void rna_Object_update(struct bContext *C, struct PointerRNA *ptr);
void rna_Object_update_data(struct bContext *C, struct PointerRNA *ptr);
void rna_Mesh_update_draw(struct bContext *C, struct PointerRNA *ptr);
+void rna_TextureSlot_update(struct bContext *C, struct PointerRNA *ptr);
/* API functions */
+void RNA_api_action(StructRNA *srna);
+void RNA_api_image(struct StructRNA *srna);
void RNA_api_keyingset(struct StructRNA *srna);
void RNA_api_main(struct StructRNA *srna);
+void RNA_api_material(StructRNA *srna);
void RNA_api_mesh(struct StructRNA *srna);
void RNA_api_object(struct StructRNA *srna);
-void RNA_api_scene(struct StructRNA *srna);
+void RNA_api_scene(struct StructRNA *srna);
+void RNA_api_text(struct StructRNA *srna);
void RNA_api_ui_layout(struct StructRNA *srna);
void RNA_api_wm(struct StructRNA *srna);
+
/* ID Properties */
extern StringPropertyRNA rna_IDProperty_string;
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index fbe339fe7f3..e1551404438 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -257,6 +257,11 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter)
return rna_pointer_inherit_refine(&iter->parent, type, rna_iterator_array_get(iter));
}
+static char *rna_ShapeKey_path(PointerRNA *ptr)
+{
+ return BLI_sprintfN("keys[\"%s\"]", ((KeyBlock*)ptr->data)->name);
+}
+
static void rna_Key_update_data(bContext *C, PointerRNA *ptr)
{
Main *bmain= CTX_data_main(C);
@@ -343,6 +348,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
srna= RNA_def_struct(brna, "ShapeKey", NULL);
RNA_def_struct_ui_text(srna, "Shape Key", "Shape key in a shape keys datablock.");
RNA_def_struct_sdna(srna, "KeyBlock");
+ RNA_def_struct_path_func(srna, "rna_ShapeKey_path");
RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA);
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
@@ -414,7 +420,8 @@ static void rna_def_key(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Key", "Shape keys datablock containing different shapes of geometric datablocks.");
RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA);
- prop= RNA_def_property(srna, "reference_key", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "reference_key", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "refkey");
RNA_def_property_ui_text(prop, "Reference Key", "");
@@ -426,7 +433,8 @@ static void rna_def_key(BlenderRNA *brna)
rna_def_animdata_common(srna);
- prop= RNA_def_property(srna, "user", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "user", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "from");
RNA_def_property_ui_text(prop, "User", "Datablock using these shape keys.");
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index 57aa1ba2736..4315a118c84 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -33,14 +33,17 @@
#include "DNA_material_types.h"
#include "DNA_texture_types.h"
-#include "WM_types.h"
-
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_texture.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value)
{
Lamp *la= (Lamp*)ptr->data;
@@ -99,7 +102,7 @@ static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
switch(la->type) {
case LA_LOCAL:
- return &RNA_LocalLamp;
+ return &RNA_PointLamp;
case LA_SUN:
return &RNA_SunLamp;
case LA_SPOT:
@@ -113,6 +116,30 @@ static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
}
}
+static void rna_Lamp_update(bContext *C, PointerRNA *ptr)
+{
+ Lamp *la= ptr->id.data;
+
+ DAG_id_flush_update(&la->id, 0);
+ WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING, la);
+}
+
+static void rna_Lamp_draw_update(bContext *C, PointerRNA *ptr)
+{
+ Lamp *la= ptr->id.data;
+
+ DAG_id_flush_update(&la->id, 0);
+ WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING_DRAW, la);
+}
+
+static void rna_Lamp_sky_update(bContext *C, PointerRNA *ptr)
+{
+ Lamp *la= ptr->id.data;
+
+ DAG_id_flush_update(&la->id, 0);
+ WM_event_add_notifier(C, NC_LAMP|ND_SKY, la);
+}
+
#else
static void rna_def_lamp_mtex(BlenderRNA *brna)
@@ -144,24 +171,24 @@ static void rna_def_lamp_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "map_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_COL);
RNA_def_property_ui_text(prop, "Color", "Lets the texture affect the basic color of the lamp.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "map_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_SHAD);
RNA_def_property_ui_text(prop, "Shadow", "Lets the texture affect the shadow color of the lamp.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Amount texture affects color values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "shadowfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Shadow Factor", "Amount texture affects shadow.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
static void rna_def_lamp_sky_settings(BlenderRNA *brna)
@@ -203,92 +230,92 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "sky_colorspace");
RNA_def_property_enum_items(prop, prop_skycolorspace_items);
RNA_def_property_ui_text(prop, "Sky Color Space", "Color space to use for internal XYZ->RGB color conversion.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "skyblendtype");
RNA_def_property_enum_items(prop, prop_blendmode_items);
RNA_def_property_ui_text(prop, "Sky Blend Mode", "Blend mode for combining sun sky with world sky.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
/* Number values */
prop= RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Horizon Brightness", "Horizon brightness.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Horizon Spread", "Horizon Spread.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Brightness", "Sun brightness.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Size", "Sun size.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
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, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Intensity", "Sun intensity.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_turbidity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_turbidity");
RNA_def_property_range(prop, 1.0f, 30.0f);
RNA_def_property_ui_text(prop, "Atmosphere Turbidity", "Sky turbidity.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_inscattering", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_inscattering_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Atmosphere Inscatter", "Scatter contribution factor.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_extinction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_extinction_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Atmosphere Extinction", "Extinction scattering contribution factor.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_distance_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_distance_factor");
RNA_def_property_range(prop, 0.0f, 500.0f);
RNA_def_property_ui_text(prop, "Atmosphere Distance Factor", "Multiplier to convert blender units to physical distance.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "skyblendfac");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Sky Blend", "Blend factor with sky.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Sky Exposure", "Strength of sky shading exponential exposure correction.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
/* boolean */
prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY);
RNA_def_property_ui_text(prop, "Sky", "Apply sun effect on sky.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_AP);
RNA_def_property_ui_text(prop, "Atmosphere", "Apply sun effect on atmosphere.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
}
static void rna_def_lamp(BlenderRNA *brna)
@@ -312,48 +339,48 @@ static void rna_def_lamp(BlenderRNA *brna)
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of Lamp.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_ui_range(prop, 0, 1000, 1.0, 2);
RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 10.0, 0.1, 2);
RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Light color.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER);
RNA_def_property_ui_text(prop, "Layer", "Illuminates objects only on the same layer the lamp is on.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG);
RNA_def_property_ui_text(prop, "Negative", "Lamp casts negative light.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Lamp creates specular highlights.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF);
RNA_def_property_ui_text(prop, "Diffuse", "Lamp does diffuse shading.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
/* textures */
rna_def_mtex_common(srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get",
- "rna_Lamp_active_texture_set", "LampTextureSlot");
+ "rna_Lamp_active_texture_set", "LampTextureSlot", "rna_Lamp_update");
}
static void rna_def_lamp_falloff(StructRNA *srna)
@@ -371,29 +398,29 @@ static void rna_def_lamp_falloff(StructRNA *srna)
prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_fallofftype_items);
RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "sphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE);
RNA_def_property_ui_text(prop, "Sphere", "Sets light intensity to zero beyond lamp distance.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attentuation.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attentuation.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
@@ -426,64 +453,65 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, (spot)? prop_spot_shadow_items: prop_shadow_items);
RNA_def_property_ui_text(prop, "Shadow Method", "Method to compute lamp shadow with.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "shdwr");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows casted by the lamp.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp.");
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow", "Causes light to cast shadows only without illuminating objects.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_ray_sampling_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ray_samp_method");
RNA_def_property_enum_items(prop, (area)? prop_spot_ray_sampling_method_items: prop_ray_sampling_method_items);
RNA_def_property_ui_text(prop, "Shadow Ray Sampling Method", "Method for generating shadow samples: Adaptive QMC is fastest, Constant QMC is less noisy but slower.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, (area)? "shadow_ray_samples_x": "shadow_ray_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_samp");
RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X","Amount of samples taken extra (samples x samples).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
if(area) {
prop= RNA_def_property(srna, "shadow_ray_samples_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_sampy");
RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_text(prop, "Shadow Ray Samples Y", "Amount of samples taken extra (samples x samples).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
prop= RNA_def_property(srna, "shadow_adaptive_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shadow Adaptive Threshold", "Threshold for Adaptive Sampling (Raytraced shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "soft");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER_SHADOW);
RNA_def_property_ui_text(prop, "Shadow Layer", "Causes only objects on the same layer to cast shadows.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
-static void rna_def_local_lamp(BlenderRNA *brna)
+static void rna_def_point_lamp(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "LocalLamp", "Lamp");
+ srna= RNA_def_struct(brna, "PointLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
- RNA_def_struct_ui_text(srna, "Local Lamp", "Omnidirectional point lamp.");
+ RNA_def_struct_ui_text(srna, "Point Lamp", "Omnidirectional point lamp.");
+ RNA_def_struct_ui_icon(srna, ICON_LAMP_POINT);
rna_def_lamp_falloff(srna);
rna_def_lamp_shadow(srna, 0, 0);
@@ -502,47 +530,48 @@ static void rna_def_area_lamp(BlenderRNA *brna)
srna= RNA_def_struct(brna, "AreaLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Area Lamp", "Directional area lamp.");
+ RNA_def_struct_ui_icon(srna, ICON_LAMP_AREA);
rna_def_lamp_shadow(srna, 0, 1);
prop= RNA_def_property(srna, "umbra", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_UMBRA);
RNA_def_property_ui_text(prop, "Umbra", "Emphasize parts that are fully shadowed (Constant Jittered sampling).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "dither", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_DITHER);
RNA_def_property_ui_text(prop, "Dither", "Use 2x2 dithering for sampling (Constant Jittered sampling).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "jitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_JITTER);
RNA_def_property_ui_text(prop, "Jitter", "Use noise for sampling (Constant Jittered sampling).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "area_shape");
RNA_def_property_enum_items(prop, prop_areashape_items);
RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_size");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_sizey");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size Y", "Size of the area of the area Lamp in the Y direction for Rectangle shapes.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "k");
RNA_def_property_ui_range(prop, 0.001, 2.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Gamma", "Light gamma correction value.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
}
static void rna_def_spot_lamp(BlenderRNA *brna)
@@ -571,6 +600,7 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
srna= RNA_def_struct(brna, "SpotLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Spot Lamp", "Directional cone lamp.");
+ RNA_def_struct_ui_icon(srna, ICON_LAMP_SPOT);
rna_def_lamp_falloff(srna);
rna_def_lamp_shadow(srna, 1, 0);
@@ -578,101 +608,101 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
prop= RNA_def_property(srna, "square", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE);
RNA_def_property_ui_text(prop, "Square", "Casts a square spot light shape.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO);
RNA_def_property_ui_text(prop, "Halo", "Renders spotlight with a volumetric halo (Buffer Shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "haint");
RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone (Buffer Shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "shadhalostep");
RNA_def_property_range(prop, 0, 12);
RNA_def_property_ui_text(prop, "Halo Step", "Volumetric halo sampling frequency.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bufsize");
RNA_def_property_range(prop, 512, 10240);
RNA_def_property_ui_text(prop, "Shadow Buffer Size", "Resolution of the shadow buffer, higher values give crisper shadows but use more memory");
RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL);
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filtertype");
RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items);
RNA_def_property_ui_text(prop, "Shadow Filter Type", "Type of shadow filter (Buffer Shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_sample_buffers", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buffers");
RNA_def_property_enum_items(prop, prop_numbuffer_items);
RNA_def_property_ui_text(prop, "Shadow Sample Buffers", "Number of shadow buffers to render for better AA, this increases memory usage.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotblend");
RNA_def_property_range(prop, 0.0f ,1.0f);
RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotsize");
RNA_def_property_range(prop, 1.0f ,180.0f);
RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam in degrees.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start", "Shadow map clip start: objects closer will not generate shadows");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", "Shadow map clip end beyond which objects will not generate shadows.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bias");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Shadow buffer sampling bias.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "soft");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Soft", "Size of shadow buffer sampling area.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp");
RNA_def_property_range(prop, 1, 16);
RNA_def_property_ui_text(prop, "Samples", "Number of shadow buffer samples.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buftype");
RNA_def_property_enum_items(prop, prop_shadbuftype_items);
RNA_def_property_ui_text(prop, "Shadow Buffer Type", "Type of shadow buffer.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "auto_clip_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_START);
RNA_def_property_ui_text(prop, "Autoclip Start", "Automatic calculation of clipping-start, based on visible vertices.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "auto_clip_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_END);
RNA_def_property_ui_text(prop, "Autoclip End", "Automatic calculation of clipping-end, based on visible vertices.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
}
static void rna_def_sun_lamp(BlenderRNA *brna)
@@ -683,11 +713,13 @@ static void rna_def_sun_lamp(BlenderRNA *brna)
srna= RNA_def_struct(brna, "SunLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp.");
+ RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN);
rna_def_lamp_shadow(srna, 0, 0);
/* sky */
- prop= RNA_def_property(srna, "sky", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "sky", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "LampSkySettings");
RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Sky Settings", "Sky related settings for sun lamps.");
@@ -702,12 +734,13 @@ static void rna_def_hemi_lamp(BlenderRNA *brna)
srna= RNA_def_struct(brna, "HemiLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Hemi Lamp", "180 degree constant lamp.");
+ RNA_def_struct_ui_icon(srna, ICON_LAMP_HEMI);
}
void RNA_def_lamp(BlenderRNA *brna)
{
rna_def_lamp(brna);
- rna_def_local_lamp(brna);
+ rna_def_point_lamp(brna);
rna_def_area_lamp(brna);
rna_def_spot_lamp(brna);
rna_def_sun_lamp(brna);
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index 344135acaff..910a15890cb 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -259,9 +259,9 @@ void RNA_def_main(BlenderRNA *brna)
{"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", NULL, NULL},
{"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", NULL, NULL},
{"keys", "Key", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL, NULL},
- {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks.", NULL, NULL},
+ {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED).", NULL, NULL},
{"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", NULL, NULL},
- {"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", NULL, NULL},
+ {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", NULL, NULL},
{"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", NULL, NULL},
{"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", NULL, NULL},
{"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", NULL, NULL},
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 6d56b2b00f9..379cf75d450 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -31,23 +31,32 @@
#include "RNA_define.h"
#include "RNA_types.h"
+#include "RNA_enum_types.h"
+
+#include "DNA_object_types.h"
+#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
#ifdef RNA_RUNTIME
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_library.h"
+#include "BKE_object.h"
+#include "BKE_material.h"
+#include "BKE_image.h"
+#include "BKE_texture.h"
-#include "DNA_mesh_types.h"
+#include "DNA_lamp_types.h"
-Mesh *rna_Main_add_mesh(Main *main, char *name)
+static Mesh *rna_Main_add_mesh(Main *main, char *name)
{
Mesh *me= add_mesh(name);
me->id.us--;
return me;
}
-void rna_Main_remove_mesh(Main *main, ReportList *reports, Mesh *me)
+static void rna_Main_remove_mesh(Main *main, ReportList *reports, Mesh *me)
{
if(me->id.us == 0)
free_libblock(&main->mesh, me);
@@ -57,24 +66,130 @@ void rna_Main_remove_mesh(Main *main, ReportList *reports, Mesh *me)
/* XXX python now has invalid pointer? */
}
+static Lamp *rna_Main_add_lamp(Main *main, char *name)
+{
+ Lamp *la= add_lamp(name);
+ la->id.us--;
+ return la;
+}
+
+/*
+static void rna_Main_remove_lamp(Main *main, ReportList *reports, Lamp *la)
+{
+ if(la->id.us == 0)
+ free_libblock(&main->lamp, la);
+ else
+ BKE_report(reports, RPT_ERROR, "Lamp must have zero users to be removed.");
+}
+*/
+
+static Object* rna_Main_add_object(Main *main, int type, char *name)
+{
+ Object *ob= add_only_object(type, name);
+ ob->id.us--;
+ return ob;
+}
+
+/*
+ NOTE: the following example shows when this function should _not_ be called
+
+ ob = bpy.data.add_object()
+ scene.add_object(ob)
+
+ # ob is freed here
+ scene.remove_object(ob)
+
+ # don't do this since ob is already freed!
+ bpy.data.remove_object(ob)
+*/
+static void rna_Main_remove_object(Main *main, ReportList *reports, Object *ob)
+{
+ if(ob->id.us == 0)
+ free_libblock(&main->object, ob);
+ else
+ BKE_report(reports, RPT_ERROR, "Object must have zero users to be removed.");
+}
+
+static Material *rna_Main_add_material(Main *main, char *name)
+{
+ return add_material(name);
+}
+
+/* TODO: remove material? */
+
+struct Tex *rna_Main_add_texture(Main *main, char *name)
+{
+ return add_texture(name);
+}
+
+/* TODO: remove texture? */
+
+struct Image *rna_Main_add_image(Main *main, char *filename)
+{
+ return BKE_add_image_file(filename, 0);
+}
+
#else
void RNA_api_main(StructRNA *srna)
{
FunctionRNA *func;
- PropertyRNA *prop;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "add_object", "rna_Main_add_object");
+ RNA_def_function_ui_description(func, "Add a new object.");
+ parm= RNA_def_enum(func, "type", object_type_items, 0, "", "Type of Object.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "object", "Object", "", "New object.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove_object", "rna_Main_remove_object");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove an object if it has zero users.");
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "add_mesh", "rna_Main_add_mesh");
RNA_def_function_ui_description(func, "Add a new mesh.");
- prop= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock.");
- prop= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh.");
- RNA_def_function_return(func, prop);
+ parm= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh.");
+ RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove_mesh", "rna_Main_remove_mesh");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a mesh if it has zero users.");
- prop= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove.");
- RNA_def_property_flag(prop, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "add_lamp", "rna_Main_add_lamp");
+ RNA_def_function_ui_description(func, "Add a new lamp.");
+ parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "mesh", "Lamp", "", "New lamp.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "add_material", "rna_Main_add_material");
+ RNA_def_function_ui_description(func, "Add a new material.");
+ parm= RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock."); /* optional */
+ parm= RNA_def_pointer(func, "material", "Material", "", "New material.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "add_texture", "rna_Main_add_texture");
+ RNA_def_function_ui_description(func, "Add a new texture.");
+ parm= RNA_def_string(func, "name", "Tex", 0, "", "New name for the datablock."); /* optional */
+ parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "add_image", "rna_Main_add_image");
+ RNA_def_function_ui_description(func, "Add a new image.");
+ parm= RNA_def_string(func, "filename", "", 0, "", "Filename to load image from.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "image", "Image", "", "New image.");
+ RNA_def_function_return(func, parm);
+
}
#endif
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index cd1159bc138..661b1c5e1c3 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -33,6 +33,7 @@
#include "DNA_material_types.h"
#include "DNA_texture_types.h"
+#include "WM_api.h"
#include "WM_types.h"
static EnumPropertyItem prop_texture_coordinates_items[] = {
@@ -53,10 +54,28 @@ static EnumPropertyItem prop_texture_coordinates_items[] = {
#include "MEM_guardedalloc.h"
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_texture.h"
#include "ED_node.h"
+static void rna_Material_update(bContext *C, PointerRNA *ptr)
+{
+ Material *ma= ptr->id.data;
+
+ DAG_id_flush_update(&ma->id, 0);
+ WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, ma);
+}
+
+static void rna_Material_draw_update(bContext *C, PointerRNA *ptr)
+{
+ Material *ma= ptr->id.data;
+
+ DAG_id_flush_update(&ma->id, 0);
+ WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING_DRAW, ma);
+}
+
static PointerRNA rna_Material_mirror_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_MaterialRaytraceMirror, ptr->id.data);
@@ -212,7 +231,7 @@ static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value)
ma->ramp_spec= add_colorband(0);
}
-void rna_Material_use_nodes_set(PointerRNA *ptr, int value)
+static void rna_Material_use_nodes_set(PointerRNA *ptr, int value)
{
Material *ma= (Material*)ptr->data;
@@ -308,291 +327,302 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Material_texture_coordinates_itemf");
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvname");
RNA_def_property_ui_text(prop, "UV Layer", "UV layer to use for mapping with UV texture coordinates.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "from_dupli", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_DUPLI_MAPTO);
RNA_def_property_ui_text(prop, "From Dupli", "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "from_original", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_OB_DUPLI_ORIG);
RNA_def_property_ui_text(prop, "From Original", "Dupli's derive their object coordinates from the original objects transformation.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_colordiff", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COL);
RNA_def_property_ui_text(prop, "Diffuse Color", "Causes the texture to affect basic color of the material");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_NORM);
RNA_def_property_ui_text(prop, "Normal", "Causes the texture to affect the rendered normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_colorspec", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLSPEC);
RNA_def_property_ui_text(prop, "Specular Color", "Causes the texture to affect the specularity color");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_mirror", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLMIR);
RNA_def_property_ui_text(prop, "Mirror", "Causes the texture to affect the mirror color");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REF);
RNA_def_property_ui_text(prop, "Diffuse", "Causes the texture to affect the value of the materials diffuse reflectivity");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Causes the texture to affect the value of specular reflectivity");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_ambient", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_AMB);
RNA_def_property_ui_text(prop, "Ambient", "Causes the texture to affect the value of ambient");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_hardness", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_HAR);
RNA_def_property_ui_text(prop, "Hardness", "Causes the texture to affect the hardness value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_raymir", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_RAYMIRR);
RNA_def_property_ui_text(prop, "Ray-Mirror", "Causes the texture to affect the ray-mirror value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ALPHA);
RNA_def_property_ui_text(prop, "Alpha", "Causes the texture to affect the alpha value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_emit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMIT);
RNA_def_property_ui_text(prop, "Emit", "Causes the texture to affect the emit value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_translucency", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSLU);
RNA_def_property_ui_text(prop, "Translucency", "Causes the texture to affect the translucency value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_displacement", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DISPLACE);
RNA_def_property_ui_text(prop, "Displacement", "Let the texture displace the surface");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_warp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_WARP);
RNA_def_property_ui_text(prop, "Warp", "Let the texture warp texture coordinates of next channels");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "x_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projx");
RNA_def_property_enum_items(prop, prop_x_mapping_items);
RNA_def_property_ui_text(prop, "X Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "y_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projy");
RNA_def_property_enum_items(prop, prop_y_mapping_items);
RNA_def_property_ui_text(prop, "Y Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "z_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projz");
RNA_def_property_enum_items(prop, prop_z_mapping_items);
RNA_def_property_ui_text(prop, "Z Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mapping_items);
RNA_def_property_ui_text(prop, "Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- /* XXX: pmapto, pmaptoneg */
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "normal_map_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "normapspace");
RNA_def_property_enum_items(prop, prop_normal_map_space_items);
RNA_def_property_ui_text(prop, "Normal Map Space", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- /* XXX: MTex.which_output */
-
- /* XXX: MTex.k */
+ prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "norfac");
+ RNA_def_property_ui_range(prop, 0, 5, 10, 3);
+ RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "displacement_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dispfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Displacement Factor", "Amount texture displaces the surface.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "warp_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "warpfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Warp Factor", "Amount texture affects texture coordinates of next channels.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "colorspec_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "colspecfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Specular Color Factor", "Amount texture affects specular color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "colordiff_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Diffuse Color Factor", "Amount texture affects diffuse color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "mirror_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "mirrfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Mirror Factor", "Amount texture affects mirror color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "alpha_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "alphafac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Alpha Factor", "Amount texture affects alpha.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "difffac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Diffuse Factor", "Amount texture affects diffuse reflectivity.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "specfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Specular Factor", "Amount texture affects specular reflectivity.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emit_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "emitfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emit Factor", "Amount texture affects emission.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "hardness_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "hardfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Hardness Factor", "Amount texture affects hardness.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "raymir_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "raymirrfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Ray Mirror Factor", "Amount texture affects ray mirror.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "translucency_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "translfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Translucency Factor", "Amount texture affects translucency.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ambient_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "ambfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Ambient Factor", "Amount texture affects ambient.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* volume material */
prop= RNA_def_property(srna, "map_coloremission", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION_COL);
- RNA_def_property_ui_text(prop, "Emission Color", "Causes the texture to affect the colour of emission");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_ui_text(prop, "Emission Color", "Causes the texture to affect the color of emission");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_colorabsorption", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION_COL);
- RNA_def_property_ui_text(prop, "Absorption Color", "Causes the texture to affect the result colour after absorption");
+ prop= RNA_def_property(srna, "map_colorreflection", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REFLECTION_COL);
+ RNA_def_property_ui_text(prop, "Reflection Color", "Causes the texture to affect the color of scattered light");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "map_colortransmission", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSMISSION_COL);
+ RNA_def_property_ui_text(prop, "Transmission Color", "Causes the texture to affect the result color after other light has been scattered/absorbed");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "map_density", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DENSITY);
RNA_def_property_ui_text(prop, "Density", "Causes the texture to affect the volume's density");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_emission", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION);
RNA_def_property_ui_text(prop, "Emission", "Causes the texture to affect the volume's emission");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "map_absorption", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION);
- RNA_def_property_ui_text(prop, "Absorption", "Causes the texture to affect the volume's absorption");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_scattering", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SCATTERING);
RNA_def_property_ui_text(prop, "Scattering", "Causes the texture to affect the volume's scattering");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "map_reflection", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REFLECTION);
+ RNA_def_property_ui_text(prop, "Reflection", "Causes the texture to affect the reflected light's brightness");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "coloremission_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "colemitfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emission Color Factor", "Amount texture affects emission color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "colorabsorption_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ prop= RNA_def_property(srna, "colorreflection_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "colreflfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
- RNA_def_property_ui_text(prop, "Absorpion Color Factor", "Amount texture affects diffuse color.");
+ RNA_def_property_ui_text(prop, "Reflection Color Factor", "Amount texture affects color of out-scattered light");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "colortransmission_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "coltransfac");
+ RNA_def_property_ui_range(prop, 0, 1, 10, 3);
+ RNA_def_property_ui_text(prop, "Transmission Color Factor", "Amount texture affects result color after light has been scattered/absorbed.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "densfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Density Factor", "Amount texture affects density.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emission_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "emitfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emission Factor", "Amount texture affects emission.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "absorption_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
- RNA_def_property_ui_range(prop, 0, 1, 10, 3);
- RNA_def_property_ui_text(prop, "Absorption Factor", "Amount texture affects absorption.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "scattering_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "scatterfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Scattering Factor", "Amount texture affects scattering.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "reflection_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "reflfac");
+ RNA_def_property_ui_range(prop, 0, 1, 10, 3);
+ RNA_def_property_ui_text(prop, "Reflection Factor", "Amount texture affects brightness of out-scattered light.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* end volume material */
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MaterialTextureSlot_enabled_get", "rna_MaterialTextureSlot_enabled_set");
RNA_def_property_ui_text(prop, "Enabled", "Enable this material texture slot.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "new_bump", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEW_BUMP);
RNA_def_property_ui_text(prop, "New Bump", "Use new, corrected bump mapping code (backwards compatibility option).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_colors(StructRNA *srna)
@@ -631,77 +661,79 @@ static void rna_def_material_colors(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Diffuse Color", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "specr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Specular Color", "Specular color of the material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "mirror_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "mirr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Mirror Color", "Mirror color of the material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Alpha", "Alpha transparency of the material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "specular_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "specular_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "spectra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Specular Alpha", "Alpha transparency for specular areas.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* Color bands */
prop= RNA_def_property(srna, "use_diffuse_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_COL);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_diffuse_ramp_set");
RNA_def_property_ui_text(prop, "Use Diffuse Ramp", "Toggle diffuse ramp operations.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ramp_col");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Diffuse Ramp", "Color ramp used to affect diffuse shading.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_specular_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_SPEC);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_specular_ramp_set");
RNA_def_property_ui_text(prop, "Use Specular Ramp", "Toggle specular ramp operations.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ramp_spec");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Specular Ramp", "Color ramp used to affect specular shading.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampblend_col");
RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec");
RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampin_col");
RNA_def_property_enum_items(prop, prop_ramp_input_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Input", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampin_spec");
RNA_def_property_enum_items(prop, prop_ramp_input_items);
RNA_def_property_ui_text(prop, "Specular Ramp Input", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
@@ -721,47 +753,47 @@ static void rna_def_material_diffuse(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "diff_shader");
RNA_def_property_enum_items(prop, prop_diff_shader_items);
RNA_def_property_ui_text(prop, "Diffuse Shader Model", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ref");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Diffuse Intensity", "Amount of diffuse reflection.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 3.14f);
RNA_def_property_ui_text(prop, "Roughness", "Oren-Nayar Roughness");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_toon_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[0]");
RNA_def_property_range(prop, 0.0f, 3.14f);
RNA_def_property_ui_text(prop, "Diffuse Toon Size", "Size of diffuse toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_toon_smooth", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "diffuse_toon_smooth", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "param[1]");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Diffuse Toon Smooth", "Smoothness of diffuse toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[1]");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Diffuse Fresnel", "Power of Fresnel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_fresnel_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[0]");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Diffuse Fresnel Factor", "Blending factor of Frensel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "darkness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Darkness", "Minnaert darkness.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_raymirror(BlenderRNA *brna)
@@ -782,67 +814,67 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYMIRROR); /* use bitflags */
RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ray_mirror");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Reflectivity", "Sets the amount mirror reflection for raytrace.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fresnel_mir");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for mirror reflection.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "fresnel_mir_i");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "aniso_gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Anisotropy", "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp_gloss_mir");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_depth");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist_mir");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fade_to", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir");
RNA_def_property_enum_items(prop, prop_fadeto_mir_items);
RNA_def_property_ui_text(prop, "Fade-out Color", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_raytra(BlenderRNA *brna)
@@ -859,61 +891,61 @@ static void rna_def_material_raytra(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "ang");
RNA_def_property_range(prop, 1.0f, 3.0f);
RNA_def_property_ui_text(prop, "IOR", "Sets angular index of refraction for raytraced refraction.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fresnel_tra");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for transparency (Ray or ZTransp).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "fresnel_tra_i");
RNA_def_property_range(prop, 1.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gloss_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp_gloss_tra");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry refractions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_depth_tra");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-refractions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "filter");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Filter", "Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "limit", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "tx_limit");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Limit", "Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "tx_falloff");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Falloff", "Falloff power for transmissivity filter effect (1.0 is linear).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_volume(BlenderRNA *brna)
@@ -934,15 +966,6 @@ static void rna_def_material_volume(BlenderRNA *brna)
//{MA_VOL_STEP_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_phasefunction_items[] = {
- {MA_VOL_PH_ISOTROPIC, "ISOTROPIC", 0, "Isotropic", ""},
- {MA_VOL_PH_MIEHAZY, "MIE_HAZY", 0, "Mie Hazy", ""},
- {MA_VOL_PH_MIEMURKY, "MIE_MURKY", 0, "Mie Murky", ""},
- {MA_VOL_PH_RAYLEIGH, "RAYLEIGH", 0, "Rayleigh", ""},
- {MA_VOL_PH_HG, "HENYEY-GREENSTEIN", 0, "Henyey-Greenstein", ""},
- {MA_VOL_PH_SCHLICK, "SCHLICK", 0, "Schlick", ""},
- {0, NULL, 0, NULL, NULL}};
-
srna= RNA_def_struct(brna, "MaterialVolume", NULL);
RNA_def_struct_sdna(srna, "VolumeSettings");
RNA_def_struct_nested(brna, srna, "Material");
@@ -952,120 +975,113 @@ static void rna_def_material_volume(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "stepsize_type");
RNA_def_property_enum_items(prop, prop_stepsize_items);
RNA_def_property_ui_text(prop, "Step Calculation", "Method of calculating the steps through the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stepsize");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
RNA_def_property_ui_text(prop, "Step Size", "Distance between subsequent volume depth samples.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-
- prop= RNA_def_property(srna, "shading_step_size", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "shade_stepsize");
- RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
- RNA_def_property_ui_text(prop, "Shading Step Size", "Distance between subsequent volume shading samples.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "scattering_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shade_type");
RNA_def_property_enum_items(prop, prop_scattering_items);
RNA_def_property_ui_text(prop, "Scattering Mode", "Method of shading, attenuating, and scattering light through the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "light_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_PRECACHESHADING); /* use bitflags */
RNA_def_property_ui_text(prop, "Light Cache", "Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "precache_resolution");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ms_diff");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Diffusion", "Diffusion factor, the strength of the blurring effect");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ms_spread", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ms_steps");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Spread", "Simulation steps, the effective distance over which the light is diffused");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ms_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ms_intensity");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Intensity", "Multiplier for multiple scattered light energy");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth_cutoff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "depth_cutoff");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Depth Cutoff", "Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "density");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Density", "The base density of the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "density_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "density_scale");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Density Scale", "Multiplier for the material's density");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-
- prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "absorption");
- RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
- RNA_def_property_ui_text(prop, "Absorption", "Amount of light that gets absorbed by the volume - higher values mean light travels less distance");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-
- prop= RNA_def_property(srna, "absorption_color", PROP_FLOAT, PROP_COLOR);
- RNA_def_property_float_sdna(prop, NULL, "absorption_col");
- RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Absorption Color", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scattering");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3);
- RNA_def_property_ui_text(prop, "Scattering", "Amount of light that gets scattered by the volume - values > 1.0 are non-physical");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_ui_text(prop, "Scattering", "Amount of light that gets scattered out by the volume - the more out-scattering, the shallower the light will penetrate ");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "emission");
+ prop= RNA_def_property(srna, "transmission_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "transmission_col");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Transmission Color", "Result color of the volume, after other light has been scattered/absorbed");
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
+
+ prop= RNA_def_property(srna, "reflection_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "reflection_col");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Reflection Color", "Colour of light scattered out of the volume (does not affect transmission)");
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
+
+ prop= RNA_def_property(srna, "reflection", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "reflection");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
- RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1 ,3);
+ RNA_def_property_ui_text(prop, "Reflection", "Multiplier to make out-scattered light brighter or darker (non-physically correct)");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "emission_col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Emission Color", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
-
- prop= RNA_def_property(srna, "phase_function", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "phasefunc_type");
- RNA_def_property_enum_items(prop, prop_phasefunction_items);
- RNA_def_property_ui_text(prop, "Phase Function", "Isotropic/Anisotropic scattering");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
+ prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "emission");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+ RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
prop= RNA_def_property(srna, "asymmetry", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "phasefunc_g");
+ RNA_def_property_float_sdna(prop, NULL, "asymmetry");
RNA_def_property_range(prop, -1.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Asymmetry", "Continuum between forward scattering and back scattering");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_ui_text(prop, "Asymmetry", "Back scattering (-1.0) to Forward scattering (1.0) and the range in between.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
@@ -1083,118 +1099,118 @@ static void rna_def_material_halo(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "hasize");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Size", "Sets the dimension of the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "hardness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "har");
RNA_def_property_range(prop, 0, 127);
RNA_def_property_ui_text(prop, "Hardness", "Sets the hardness of the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "add", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "add", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "add");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Add", "Sets the strength of the add effect.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "rings", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ringc");
RNA_def_property_range(prop, 0, 24);
RNA_def_property_ui_text(prop, "Rings", "Sets the number of rings rendered over the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "line_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "linec");
RNA_def_property_range(prop, 0, 250);
RNA_def_property_ui_text(prop, "Line Number", "Sets the number of star shaped lines rendered over the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "star_tips", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "starc");
RNA_def_property_range(prop, 3, 50);
RNA_def_property_ui_text(prop, "Star Tips", "Sets the number of points on the star shaped halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed1");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Seed", "Randomizes ring dimension and line location.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_FLARE); /* use bitflags */
RNA_def_property_ui_text(prop, "Flare", "Renders halo as a lensflare.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "flaresize");
RNA_def_property_range(prop, 0.1f, 25.0f);
RNA_def_property_ui_text(prop, "Flare Size", "Sets the factor by which the flare is larger than the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_subsize", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "subsize");
RNA_def_property_range(prop, 0.1f, 25.0f);
RNA_def_property_ui_text(prop, "Flare Subsize", "Sets the dimension of the subflares, dots and circles.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_boost", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "flareboost");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Flare Boost", "Gives the flare extra strength.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed2");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Flare Seed", "Specifies an offset in the flare seed table.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flares_sub", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "flarec");
RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "Flares Sub", "Sets the number of subflares.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ring", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_RINGS);
RNA_def_property_ui_text(prop, "Rings", "Renders rings over halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "lines", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_LINES);
RNA_def_property_ui_text(prop, "Lines", "Renders star shaped lines over halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "star", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STAR);
RNA_def_property_ui_text(prop, "Star", "Renders halo as a star.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX);
RNA_def_property_ui_text(prop, "Texture", "Gives halo a texture.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "vertex_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO);
RNA_def_property_ui_text(prop, "Vertex Normal", "Uses the vertex normal to specify the dimension of the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "xalpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_XALPHA);
RNA_def_property_ui_text(prop, "Extreme Alpha", "Uses extreme alpha.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SHADE);
RNA_def_property_ui_text(prop, "Shaded", "Lets halo receive light and shadows from external objects.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "soft", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SOFT);
RNA_def_property_ui_text(prop, "Soft", "Softens the edges of halos at intersections with other geometry.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_sss(BlenderRNA *brna)
@@ -1212,62 +1228,62 @@ static void rna_def_material_sss(BlenderRNA *brna)
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 10000, 1, 3);
RNA_def_property_ui_text(prop, "Radius", "Mean red/green/blue scattering path length.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "sss_col");
RNA_def_property_ui_text(prop, "Color", "Scattering color.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "error_tolerance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_error");
RNA_def_property_ui_range(prop, 0.0001, 10, 1, 3);
RNA_def_property_ui_text(prop, "Error Tolerance", "Error tolerance (low values are slower and higher quality).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_scale");
RNA_def_property_ui_range(prop, 0.001, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Scale", "Object scale factor.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_ior");
RNA_def_property_ui_range(prop, 0.1, 2, 1, 3);
RNA_def_property_ui_text(prop, "IOR", "Index of refraction (higher values are denser).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "sss_colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Blend factor for SSS colors.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "sss_texfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Texture Factor", "Texture scatting blend factor.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "front", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_front");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Front", "Front scattering weight.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_back");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Back", "Back scattering weight.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sss_flag", MA_DIFF_SSS);
RNA_def_property_ui_text(prop, "Enabled", "Enable diffuse subsurface scatting effects in a material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
-void rna_def_material_specularity(StructRNA *srna)
+static void rna_def_material_specularity(StructRNA *srna)
{
PropertyRNA *prop;
@@ -1283,13 +1299,13 @@ void rna_def_material_specularity(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "spec_shader");
RNA_def_property_enum_items(prop, prop_specular_shader_items);
RNA_def_property_ui_text(prop, "Specular Shader Model", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "spec");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Specular Intensity", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* NOTE: "har", "param", etc are used for multiple purposes depending on
* settings. This should be fixed in DNA once, for RNA we just expose them
@@ -1300,34 +1316,34 @@ void rna_def_material_specularity(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "har");
RNA_def_property_range(prop, 1, 511);
RNA_def_property_ui_text(prop, "Specular Hardness", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "refrac");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Specular IOR", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_toon_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[2]");
RNA_def_property_range(prop, 0.0f, 1.53f);
RNA_def_property_ui_text(prop, "Specular Toon Size", "Size of specular toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_toon_smooth", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "specular_toon_smooth", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "param[3]");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Specular Toon Smooth", "Ssmoothness of specular toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_slope", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rms");
RNA_def_property_range(prop, 0, 0.4);
RNA_def_property_ui_text(prop, "Specular Slope", "The standard deviation of surface slope.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
-void rna_def_material_strand(BlenderRNA *brna)
+static void rna_def_material_strand(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -1340,61 +1356,61 @@ void rna_def_material_strand(BlenderRNA *brna)
prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_STR);
RNA_def_property_ui_text(prop, "Tangent Shading", "Uses direction of strands as normal for tangent-shading.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "surface_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_SURFDIFF);
RNA_def_property_ui_text(prop, "Surface Diffuse", "Make diffuse shading more similar to shading the surface.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "blend_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "strand_surfnor");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Blend Distance", "Worldspace distance over which to blend in the surface normal.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "blender_units", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_B_UNITS);
RNA_def_property_ui_text(prop, "Blender Units", "Use Blender units for widths instead of pixels.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "root_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_sta");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_start_size_range");
RNA_def_property_ui_text(prop, "Root Size", "Start size of strands in pixels Blender units.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "tip_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_end");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_end_size_range");
RNA_def_property_ui_text(prop, "Tip Size", "Start size of strands in pixels or Blender units.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "min_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_min");
RNA_def_property_range(prop, 0.001, 10);
RNA_def_property_ui_text(prop, "Minimum Size", "Minimum size of strands in pixels.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strand_ease");
RNA_def_property_range(prop, -0.9, 0.9);
RNA_def_property_ui_text(prop, "Shape", "Positive values make strands rounder, negative makes strands spiky.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "width_fade", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strand_widthfade");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Width Fade", "Transparency along the width of the strand.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "strand_uvname");
RNA_def_property_ui_text(prop, "UV Layer", "Name of UV layer to override.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
-void rna_def_material_physics(BlenderRNA *brna)
+static void rna_def_material_physics(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -1459,45 +1475,45 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Material type defining how the object is rendered.");
RNA_def_property_enum_funcs(prop, NULL, "rna_Material_type_set", NULL);
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "transparency", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRANSP);
RNA_def_property_ui_text(prop, "Transparency", "Render material as transparent.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "transparency_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, transparency_items);
RNA_def_property_ui_text(prop, "Transparency Method", "Method to use for rendering transparency.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "amb");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Ambient", "Amount of global ambient color the material receives.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emit", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 2.0f, 10, 2);
RNA_def_property_ui_text(prop, "Emit", "Amount of light to emit.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "translucency", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "translucency", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Translucency", "Amount of diffuse shading on the back side.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cubic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_CUBIC);
RNA_def_property_ui_text(prop, "Cubic Interpolation", "Use cubic interpolation for diffuse values, for smoother transitions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "object_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_OBCOLOR);
RNA_def_property_ui_text(prop, "Object Color", "Modulate the result with a per-object color.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shadow_ray_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sbias");
@@ -1509,143 +1525,150 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Factor to multiply shadow buffer bias with (0 is ignore.)");
- prop= RNA_def_property(srna, "shadow_casting_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "shadow_casting_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "shad_alpha");
RNA_def_property_range(prop, 0.001, 1);
RNA_def_property_ui_text(prop, "Shadow Casting Alpha", "Shadow casting alpha, only in use for Irregular Shadowbuffer.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "light_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Light Group", "Limit lighting to lamps in this Group.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* flags */
prop= RNA_def_property(srna, "light_group_exclusive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_GROUP_NOLAY);
RNA_def_property_ui_text(prop, "Light Group Exclusive", "Material uses the light group exclusively - these lamps are excluded from other scene lighting.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "traceable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRACEBLE);
RNA_def_property_ui_text(prop, "Traceable", "Include this material and geometry that uses it in ray tracing calculations.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW);
RNA_def_property_ui_text(prop, "Shadows", "Allows this material to receive shadows.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shadeless", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHLESS);
RNA_def_property_ui_text(prop, "Shadeless", "Makes this material insensitive to light or shadow.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "vertex_color_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOL);
RNA_def_property_ui_text(prop, "Vertex Color Light", "Add vertex colors as additional lighting.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "vertex_color_paint", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOLP);
RNA_def_property_ui_text(prop, "Vertex Color Paint", "Replaces object base color with vertex colors (multiplies with 'texture face' face assigned textures).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ZINV);
RNA_def_property_ui_text(prop, "Invert Z Depth", "Renders material's faces with an inverted Z buffer (scanline only).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ENV);
RNA_def_property_ui_text(prop, "Sky", "Renders this material with zero alpha, with sky background in place (scanline only).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow", "Renders shadows as the material's alpha value, making materials transparent except for shadowed areas.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "face_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE);
RNA_def_property_ui_text(prop, "Face Textures", "Replaces the object's base color with color from face assigned image textures");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "face_texture_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE_ALPHA);
RNA_def_property_ui_text(prop, "Face Textures Alpha", "Replaces the object's base alpha value with alpha from face assigned image textures");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cast_shadows_only", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYCAST);
RNA_def_property_ui_text(prop, "Cast Shadows Only", "Makes objects with this material appear invisible, only casting shadows (not rendered).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "exclude_mist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_NOMIST);
RNA_def_property_ui_text(prop, "Exclude Mist", "Excludes this material from mist effects (in world settings)");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "receive_transparent_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA);
RNA_def_property_ui_text(prop, "Receive Transparent Shadows", "Allow this object to receive transparent shadows casted through other objects");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ray_shadow_bias", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYBIAS);
RNA_def_property_ui_text(prop, "Ray Shadow Bias", "Prevents raytraced shadow errors on surfaces with smooth shaded normals (terminator problem)");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "full_oversampling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FULL_OSA);
RNA_def_property_ui_text(prop, "Full Oversampling", "Force this material to render full shading/textures for all anti-aliasing samples");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cast_buffer_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADBUF);
RNA_def_property_ui_text(prop, "Cast Buffer Shadows", "Allow this material to cast shadows from shadow buffer lamps");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_V);
RNA_def_property_ui_text(prop, "Tangent Shading", "Use the material's tangent vector instead of the normal for shading - for anisotropic shading effects");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* nested structs */
- prop= RNA_def_property(srna, "raytrace_mirror", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "raytrace_mirror", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialRaytraceMirror");
RNA_def_property_pointer_funcs(prop, "rna_Material_mirror_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Raytrace Mirror", "Raytraced reflection settings for the material.");
- prop= RNA_def_property(srna, "raytrace_transparency", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "raytrace_transparency", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialRaytraceTransparency");
RNA_def_property_pointer_funcs(prop, "rna_Material_transp_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Raytrace Transparency", "Raytraced reflection settings for the material.");
- prop= RNA_def_property(srna, "volume", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "volume", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "vol");
RNA_def_property_struct_type(prop, "MaterialVolume");
RNA_def_property_ui_text(prop, "Volume", "Volume settings for the material.");
- prop= RNA_def_property(srna, "halo", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "halo", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialHalo");
RNA_def_property_pointer_funcs(prop, "rna_Material_halo_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Halo", "Halo settings for the material.");
- prop= RNA_def_property(srna, "subsurface_scattering", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "subsurface_scattering", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialSubsurfaceScattering");
RNA_def_property_pointer_funcs(prop, "rna_Material_sss_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Subsurface Scattering", "Subsurface scattering settings for the material.");
- prop= RNA_def_property(srna, "strand", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "strand", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialStrand");
RNA_def_property_pointer_funcs(prop, "rna_Material_strand_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Strand", "Strand settings for the material.");
- prop= RNA_def_property(srna, "physics", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "physics", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialPhysics");
RNA_def_property_pointer_funcs(prop, "rna_Material_physics_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Physics", "Game physics settings.");
@@ -1664,7 +1687,7 @@ void RNA_def_material(BlenderRNA *brna)
/* common */
rna_def_animdata_common(srna);
rna_def_mtex_common(srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get",
- "rna_Material_active_texture_set", "MaterialTextureSlot");
+ "rna_Material_active_texture_set", "MaterialTextureSlot", "rna_Material_update");
rna_def_material_colors(srna);
rna_def_material_diffuse(srna);
@@ -1679,9 +1702,11 @@ void RNA_def_material(BlenderRNA *brna)
rna_def_material_mtex(brna);
rna_def_material_strand(brna);
rna_def_material_physics(brna);
+
+ RNA_api_material(srna);
}
-void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname)
+void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *update)
{
PropertyRNA *prop;
@@ -1696,13 +1721,13 @@ void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeg
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL);
RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed.");
- RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, update);
prop= RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "texact");
RNA_def_property_range(prop, 0, MAX_MTEX-1);
RNA_def_property_ui_text(prop, "Active Texture Index", "Index of active texture slot.");
- RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, update);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_material_api.c b/source/blender/makesrna/intern/rna_material_api.c
new file mode 100644
index 00000000000..aa28b6b923c
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_material_api.c
@@ -0,0 +1,126 @@
+/**
+ *
+ *
+ * ***** 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "DNA_material_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_material.h"
+#include "BKE_texture.h"
+
+/*
+ Adds material to the first free texture slot.
+ If all slots are busy, replaces the first.
+*/
+static void rna_Material_add_texture(Material *ma, Tex *tex, int mapto, int texco)
+{
+ int i;
+ MTex *mtex;
+ int slot= -1;
+
+ for (i= 0; i < MAX_MTEX; i++) {
+ if (!ma->mtex[i]) {
+ slot= i;
+ break;
+ }
+ }
+
+ if (slot == -1)
+ slot= 0;
+
+ if (ma->mtex[slot]) {
+ ma->mtex[slot]->tex->id.us--;
+ }
+ else {
+ ma->mtex[slot]= add_mtex();
+ }
+
+ mtex= ma->mtex[slot];
+
+ mtex->tex= tex;
+ id_us_plus(&tex->id);
+
+ mtex->texco= mapto;
+ mtex->mapto= texco;
+}
+
+#else
+
+void RNA_api_material(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ /* copied from rna_def_material_mtex (rna_material.c) */
+ static EnumPropertyItem prop_texture_coordinates_items[] = {
+ {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates."},
+ {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates."},
+ {TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates."},
+ {TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object."},
+ {TEXCO_STRAND, "STRAND", 0, "Strand", "Uses normalized strand texture coordinate (1D)."},
+ {TEXCO_STICKY, "STICKY", 0, "Sticky", "Uses mesh's sticky coordinates for the texture coordinates."},
+ {TEXCO_WINDOW, "WINDOW", 0, "Window", "Uses screen coordinates as texture coordinates."},
+ {TEXCO_NORM, "NORMAL", 0, "Normal", "Uses normal vector as texture coordinates."},
+ {TEXCO_REFL, "REFLECTION", 0, "Reflection", "Uses reflection vector as texture coordinates."},
+ {TEXCO_STRESS, "STRESS", 0, "Stress", "Uses the difference of edge lengths compared to original coordinates of the mesh."},
+ {TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Uses the optional tangent vector as texture coordinates."},
+
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_texture_mapto_items[] = {
+ {MAP_COL, "COLOR", 0, "Color", "Causes the texture to affect basic color of the material"},
+ {MAP_NORM, "NORMAL", 0, "Normal", "Causes the texture to affect the rendered normal"},
+ {MAP_COLSPEC, "SPECULAR_COLOR", 0, "Specularity Color", "Causes the texture to affect the specularity color"},
+ {MAP_COLMIR, "MIRROR", 0, "Mirror", "Causes the texture to affect the mirror color"},
+ {MAP_REF, "REFLECTION", 0, "Reflection", "Causes the texture to affect the value of the materials reflectivity"},
+ {MAP_SPEC, "SPECULARITY", 0, "Specularity", "Causes the texture to affect the value of specularity"},
+ {MAP_EMIT, "EMIT", 0, "Emit", "Causes the texture to affect the emit value"},
+ {MAP_ALPHA, "ALPHA", 0, "Alpha", "Causes the texture to affect the alpha value"},
+ {MAP_HAR, "HARDNESS", 0, "Hardness", "Causes the texture to affect the hardness value"},
+ {MAP_RAYMIRR, "RAY_MIRROR", 0, "Ray-Mirror", "Causes the texture to affect the ray-mirror value"},
+ {MAP_TRANSLU, "TRANSLUCENCY", 0, "Translucency", "Causes the texture to affect the translucency value"},
+ {MAP_AMB, "AMBIENT", 0, "Ambient", "Causes the texture to affect the value of ambient"},
+ {MAP_DISPLACE, "DISPLACEMENT", 0, "Displacement", "Let the texture displace the surface"},
+ {MAP_WARP, "WARP", 0, "Warp", "Let the texture warp texture coordinates of next channels"},
+ {0, NULL, 0, NULL, NULL}};
+
+ func= RNA_def_function(srna, "add_texture", "rna_Material_add_texture");
+ RNA_def_function_ui_description(func, "Add a texture to material's free texture slot.");
+ parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to add.");
+ parm= RNA_def_enum(func, "texture_coordinates", prop_texture_coordinates_items, TEXCO_UV, "", "Source of texture coordinate information."); /* optional */
+ parm= RNA_def_enum(func, "map_to", prop_texture_mapto_items, MAP_COL, "", "Controls which material property the texture affects."); /* optional */
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 78fb8ede3ee..124fd80ce5a 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -953,6 +953,16 @@ static void rna_def_medge(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SHARP);
RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "loose", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_LOOSEEDGE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Loose", "Loose edge");
+
+ prop= RNA_def_property(srna, "fgon", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FGON);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Fgon", "Fgon edge");
}
static void rna_def_mface(BlenderRNA *brna)
@@ -974,6 +984,12 @@ static void rna_def_mface(BlenderRNA *brna)
RNA_def_property_int_funcs(prop, "rna_MeshFace_verts_get", "rna_MeshFace_verts_set", NULL);
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
+ /* leaving this fixed size array for foreach_set used in import scripts */
+ prop= RNA_def_property(srna, "verts_raw", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "v1");
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_ui_text(prop, "Vertices", "Fixed size vertex indices array");
+
prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "mat_nr");
RNA_def_property_ui_text(prop, "Material Index", "");
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index 686d91e4fe2..3da0e1e6fd4 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -32,183 +32,15 @@
#include "RNA_define.h"
#include "RNA_types.h"
-#ifdef RNA_RUNTIME
-
-#include "DNA_mesh_types.h"
-#include "DNA_scene_types.h"
-
-#include "BKE_customdata.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-
-#include "BLI_edgehash.h"
-
-#include "WM_api.h"
-#include "WM_types.h"
-
-static void rna_Mesh_calc_edges(Mesh *mesh)
-{
- CustomData edata;
- EdgeHashIterator *ehi;
- MFace *mf = mesh->mface;
- MEdge *med;
- EdgeHash *eh = BLI_edgehash_new();
- int i, *index, totedge, totface = mesh->totface;
-
- for (i = 0; i < totface; i++, mf++) {
- if (!BLI_edgehash_haskey(eh, mf->v1, mf->v2))
- BLI_edgehash_insert(eh, mf->v1, mf->v2, NULL);
- if (!BLI_edgehash_haskey(eh, mf->v2, mf->v3))
- BLI_edgehash_insert(eh, mf->v2, mf->v3, NULL);
-
- if (mf->v4) {
- if (!BLI_edgehash_haskey(eh, mf->v3, mf->v4))
- BLI_edgehash_insert(eh, mf->v3, mf->v4, NULL);
- if (!BLI_edgehash_haskey(eh, mf->v4, mf->v1))
- BLI_edgehash_insert(eh, mf->v4, mf->v1, NULL);
- } else {
- if (!BLI_edgehash_haskey(eh, mf->v3, mf->v1))
- BLI_edgehash_insert(eh, mf->v3, mf->v1, NULL);
- }
- }
-
- totedge = BLI_edgehash_size(eh);
-
- /* write new edges into a temporary CustomData */
- memset(&edata, 0, sizeof(edata));
- CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
-
- ehi = BLI_edgehashIterator_new(eh);
- med = CustomData_get_layer(&edata, CD_MEDGE);
- for(i = 0; !BLI_edgehashIterator_isDone(ehi);
- BLI_edgehashIterator_step(ehi), ++i, ++med, ++index) {
- BLI_edgehashIterator_getKey(ehi, (int*)&med->v1, (int*)&med->v2);
-
- med->flag = ME_EDGEDRAW|ME_EDGERENDER;
- }
- BLI_edgehashIterator_free(ehi);
-
- /* free old CustomData and assign new one */
- CustomData_free(&mesh->edata, mesh->totedge);
- mesh->edata = edata;
- mesh->totedge = totedge;
-
- mesh->medge = CustomData_get_layer(&mesh->edata, CD_MEDGE);
-
- BLI_edgehash_free(eh, NULL);
-}
-
-static void rna_Mesh_update(Mesh *mesh, bContext *C)
-{
- if(mesh->totface && mesh->totedge == 0)
- rna_Mesh_calc_edges(mesh);
-
- mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mface, mesh->totface, NULL);
-
- DAG_id_flush_update(&mesh->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, mesh);
-}
-
-static void rna_Mesh_add_verts(Mesh *mesh, int len)
-{
- CustomData vdata;
- MVert *mvert;
- int i, totvert;
-
- if(len == 0)
- return;
-
- totvert= mesh->totvert + len;
- CustomData_copy(&mesh->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, totvert);
- CustomData_copy_data(&mesh->vdata, &vdata, 0, 0, mesh->totvert);
-
- if(!CustomData_has_layer(&vdata, CD_MVERT))
- CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
-
- CustomData_free(&mesh->vdata, mesh->totvert);
- mesh->vdata= vdata;
- mesh_update_customdata_pointers(mesh);
-
- /* scan the input list and insert the new vertices */
-
- mvert= &mesh->mvert[mesh->totvert];
- for(i=0; i<len; i++, mvert++)
- mvert->flag |= SELECT;
-
- /* set final vertex list size */
- mesh->totvert= totvert;
-}
-
-static void rna_Mesh_add_edges(Mesh *mesh, int len)
-{
- CustomData edata;
- MEdge *medge;
- int i, totedge;
+#include "BLO_sys_types.h"
- if(len == 0)
- return;
+#include "ED_mesh.h"
- totedge= mesh->totedge+len;
-
- /* update customdata */
- CustomData_copy(&mesh->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge);
- CustomData_copy_data(&mesh->edata, &edata, 0, 0, mesh->totedge);
-
- if(!CustomData_has_layer(&edata, CD_MEDGE))
- CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
-
- CustomData_free(&mesh->edata, mesh->totedge);
- mesh->edata= edata;
- mesh_update_customdata_pointers(mesh);
-
- /* set default flags */
- medge= &mesh->medge[mesh->totedge];
- for(i=0; i<len; i++, medge++)
- medge->flag= ME_EDGEDRAW|ME_EDGERENDER|SELECT;
-
- mesh->totedge= totedge;
-}
-
-static void rna_Mesh_add_faces(Mesh *mesh, int len)
-{
- CustomData fdata;
- MFace *mface;
- int i, totface;
-
- if(len == 0)
- return;
-
- totface= mesh->totface + len; /* new face count */
-
- /* update customdata */
- CustomData_copy(&mesh->fdata, &fdata, CD_MASK_MESH, CD_DEFAULT, totface);
- CustomData_copy_data(&mesh->fdata, &fdata, 0, 0, mesh->totface);
-
- if(!CustomData_has_layer(&fdata, CD_MFACE))
- CustomData_add_layer(&fdata, CD_MFACE, CD_CALLOC, NULL, totface);
-
- CustomData_free(&mesh->fdata, mesh->totface);
- mesh->fdata= fdata;
- mesh_update_customdata_pointers(mesh);
-
- /* set default flags */
- mface= &mesh->mface[mesh->totface];
- for(i=0; i<len; i++, mface++)
- mface->flag= SELECT;
-
- mesh->totface= totface;
-}
+#ifdef RNA_RUNTIME
-static void rna_Mesh_add_geometry(Mesh *mesh, int verts, int edges, int faces)
+static void rna_Mesh_uv_texture_add(struct Mesh *me, struct bContext *C)
{
- if(verts)
- rna_Mesh_add_verts(mesh, verts);
- if(edges)
- rna_Mesh_add_edges(mesh, edges);
- if(faces)
- rna_Mesh_add_faces(mesh, faces);
+ ED_mesh_uv_texture_add(C, NULL, NULL, me);
}
#else
@@ -218,7 +50,13 @@ void RNA_api_mesh(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "add_geometry", "rna_Mesh_add_geometry");
+ func= RNA_def_function(srna, "transform", "ED_mesh_transform");
+ RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix.");
+ parm= RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix.", 0.0f, 0.0f);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "add_geometry", "ED_mesh_geometry_add");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_int(func, "verts", 0, 0, INT_MAX, "Number", "Number of vertices to add.", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_int(func, "edges", 0, 0, INT_MAX, "Number", "Number of edges to add.", 0, INT_MAX);
@@ -226,8 +64,20 @@ void RNA_api_mesh(StructRNA *srna)
parm= RNA_def_int(func, "faces", 0, 0, INT_MAX, "Number", "Number of faces to add.", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "update", "rna_Mesh_update");
+ func= RNA_def_function(srna, "add_uv_texture", "rna_Mesh_uv_texture_add");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_function_ui_description(func, "Add a UV texture layer to Mesh.");
+
+ func= RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
+ RNA_def_function_ui_description(func, "Calculate vertex normals.");
+
+ func= RNA_def_function(srna, "update", "ED_mesh_update");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+
+ func= RNA_def_function(srna, "add_material", "ED_mesh_material_add");
+ RNA_def_function_ui_description(func, "Add a new material to Mesh.");
+ parm= RNA_def_pointer(func, "material", "Material", "", "Material to add.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index f3160a7bb18..1a4e4da886b 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -67,7 +67,7 @@ static void rna_MetaBall_update_data(bContext *C, PointerRNA *ptr)
#else
-void rna_def_metaelement(BlenderRNA *brna)
+static void rna_def_metaelement(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -143,7 +143,7 @@ void rna_def_metaelement(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
}
-void rna_def_metaball(BlenderRNA *brna)
+static void rna_def_metaball(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 32e34559f1f..480abff19cb 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -930,12 +930,14 @@ static void rna_def_modifier_softbody(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SoftbodyModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SOFT);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "SoftBodySettings");
RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_settings_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Soft Body Settings", "");
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_point_cache_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Soft Body Point Cache", "");
@@ -1551,15 +1553,18 @@ static void rna_def_modifier_cloth(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "ClothModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_CLOTH);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "sim_parms");
RNA_def_property_ui_text(prop, "Cloth Settings", "");
- prop= RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coll_parms");
RNA_def_property_ui_text(prop, "Cloth Collision Settings", "");
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Point Cache", "");
}
@@ -1609,16 +1614,11 @@ static void rna_def_modifier_collision(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "CollisionModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "CollisionSettings");
RNA_def_property_pointer_funcs(prop, "rna_CollisionModifier_settings_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Settings", "");
-
- prop= RNA_def_property(srna, "absorption", PROP_INT, PROP_PERCENTAGE);
- RNA_def_property_int_sdna(prop, NULL, "absorption");
- RNA_def_property_ui_range(prop, 0, 100, 1, 2);
- RNA_def_property_ui_text(prop, "Absorption %", "How much of effector force gets lost during collision with this object (in percent).");
- RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_bevel(BlenderRNA *brna)
@@ -1780,7 +1780,8 @@ static void rna_def_modifier_fluidsim(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "FluidsimModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_FLUIDSIM);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "fss");
RNA_def_property_ui_text(prop, "Settings", "Settings for how this object is used in the fluid simulation.");
}
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index 690a198f12c..20d1a898303 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -47,7 +47,7 @@
/* temp constant defined for these funcs only... */
#define NLASTRIP_MIN_LEN_THRESH 0.1f
-void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value)
+static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value)
{
NlaStrip *data= (NlaStrip *)ptr->data;
@@ -280,7 +280,7 @@ EnumPropertyItem nla_mode_extend_items[] = {
{NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", 0, "Hold Forward", "Only hold last frame."},
{0, NULL, 0, NULL, NULL}};
-void rna_def_nlastrip(BlenderRNA *brna)
+static void rna_def_nlastrip(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -433,7 +433,7 @@ void rna_def_nlastrip(BlenderRNA *brna)
// - sync length
}
-void rna_def_nlatrack(BlenderRNA *brna)
+static void rna_def_nlatrack(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 3fd358a1c16..ebd032bb0b1 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
+#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_types.h"
@@ -37,9 +38,82 @@
#include "BKE_node.h"
#include "BKE_image.h"
+static EnumPropertyItem node_blend_type_items[] = {
+ { 0, "MIX", 0, "Mix", ""},
+ { 1, "ADD", 0, "Add", ""},
+ { 3, "SUBTRACT", 0, "Subtract", ""},
+ { 2, "MULTIPLY", 0, "Multiply", ""},
+ { 4, "SCREEN", 0, "Screen", ""},
+ { 9, "OVERLAY", 0, "Overlay", ""},
+ { 5, "DIVIDE", 0, "Divide", ""},
+ { 6, "DIFFERENCE", 0, "Difference", ""},
+ { 7, "DARKEN", 0, "Darken", ""},
+ { 8, "LIGHTEN", 0, "Lighten", ""},
+ {10, "DODGE", 0, "Dodge", ""},
+ {11, "BURN", 0, "Burn", ""},
+ {15, "COLOR", 0, "Color", ""},
+ {14, "VALUE", 0, "Value", ""},
+ {13, "SATURATION", 0, "Saturation", ""},
+ {12, "HUE", 0, "Hue", ""},
+ {16, "SOFT_LIGHT", 0, "Soft Light", ""},
+ {17, "LINEAR_LIGHT", 0, "Linear Light",""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+static EnumPropertyItem node_flip_items[] = {
+ {0, "X", 0, "Flip X", ""},
+ {1, "Y", 0, "Flip Y", ""},
+ {2, "XY", 0, "Flip X & Y", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+static EnumPropertyItem node_math_items[] = {
+ { 0, "ADD", 0, "Add", ""},
+ { 1, "SUBTRACT", 0, "Subtract", ""},
+ { 2, "MULTIPLY", 0, "Multiply", ""},
+ { 3, "DIVIDE", 0, "Divide", ""},
+ { 4, "SINE", 0, "Sine", ""},
+ { 5, "COSINE", 0, "Cosine", ""},
+ { 6, "TANGENT", 0, "Tangent", ""},
+ { 7, "ARCSINE", 0, "Arcsine", ""},
+ { 8, "ARCCOSINE", 0, "Arccosine", ""},
+ { 9, "ARCTANGENT", 0, "Arctangent", ""},
+ {10, "POWER", 0, "Power", ""},
+ {11, "LOGARITHM", 0, "Logarithm", ""},
+ {12, "MINIMUM", 0, "Minimum", ""},
+ {13, "MAXIMUM", 0, "Maximum", ""},
+ {14, "ROUND", 0, "Round", ""},
+ {15, "LESS_THAN", 0, "Less Than", ""},
+ {16, "GREATER_THAN", 0, "Greater Than", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+static EnumPropertyItem node_vec_math_items[] = {
+ {0, "ADD", 0, "Add", ""},
+ {1, "SUBTRACT", 0, "Subtract", ""},
+ {2, "AVERAGE", 0, "Average", ""},
+ {3, "DOT_PRODUCT", 0, "Dot Product", ""},
+ {4, "CROSS_PRODUCT", 0, "Cross Product", ""},
+ {5, "NORMALIZE", 0, "Normalize", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+static EnumPropertyItem node_filter_items[] = {
+ {0, "SOFTEN", 0, "Soften", ""},
+ {1, "SHARPEN", 0, "Sharpen", ""},
+ {2, "LAPLACE", 0, "Laplace", ""},
+ {3, "SOBEL", 0, "Sobel", ""},
+ {4, "PREWITT", 0, "Prewitt", ""},
+ {5, "KIRSCH", 0, "Kirsch", ""},
+ {6, "SHADOW", 0, "Shadow", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
#ifdef RNA_RUNTIME
-StructRNA *rna_Node_refine(struct PointerRNA *ptr)
+#include "ED_node.h"
+
+static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
{
bNode *node = (bNode*)ptr->data;
@@ -66,6 +140,53 @@ static char *rna_Node_path(PointerRNA *ptr)
return BLI_sprintfN("nodes[%d]", index);
}
+static void rna_Node_update(bContext *C, PointerRNA *ptr)
+{
+ bNode *node= (bNode*)ptr->data;
+
+ ED_node_changed_update(C, node);
+}
+
+static void rna_Node_update_name(bContext *C, PointerRNA *ptr)
+{
+ bNode *node= (bNode*)ptr->data;
+ const char *name;
+
+ if(node->id) {
+ BLI_strncpy(node->name, node->id->name+2, NODE_MAXSTR);
+ }
+ else {
+ switch(node->typeinfo->type) {
+ case SH_NODE_MIX_RGB:
+ case CMP_NODE_MIX_RGB:
+ case TEX_NODE_MIX_RGB:
+ if(RNA_enum_name(node_blend_type_items, node->custom1, &name))
+ BLI_strncpy(node->name, name, NODE_MAXSTR);
+ break;
+ case CMP_NODE_FILTER:
+ if(RNA_enum_name(node_filter_items, node->custom1, &name))
+ BLI_strncpy(node->name, name, NODE_MAXSTR);
+ break;
+ case CMP_NODE_FLIP:
+ if(RNA_enum_name(node_flip_items, node->custom1, &name))
+ BLI_strncpy(node->name, name, NODE_MAXSTR);
+ break;
+ case SH_NODE_MATH:
+ case CMP_NODE_MATH:
+ case TEX_NODE_MATH:
+ if(RNA_enum_name(node_math_items, node->custom1, &name))
+ BLI_strncpy(node->name, name, NODE_MAXSTR);
+ break;
+ case SH_NODE_VECT_MATH:
+ if(RNA_enum_name(node_vec_math_items, node->custom1, &name))
+ BLI_strncpy(node->name, name, NODE_MAXSTR);
+ break;
+ }
+ }
+
+ rna_Node_update(C, ptr);
+}
+
#else
#define MaxNodes 1000
@@ -183,53 +304,22 @@ static void def_math(StructRNA *srna)
{
PropertyRNA *prop;
- static EnumPropertyItem items[] = {
- { 0, "ADD", 0, "Add", ""},
- { 1, "SUBTRACT", 0, "Subtract", ""},
- { 2, "MULTIPLY", 0, "Multiply", ""},
- { 3, "DIVIDE", 0, "Divide", ""},
- { 4, "SINE", 0, "Sine", ""},
- { 5, "COSINE", 0, "Cosine", ""},
- { 6, "TANGENT", 0, "Tangent", ""},
- { 7, "ARCSINE", 0, "Arcsine", ""},
- { 8, "ARCCOSINE", 0, "Arccosine", ""},
- { 9, "ARCTANGENT", 0, "Arctangent", ""},
- {10, "POWER", 0, "Power", ""},
- {11, "LOGARITHM", 0, "Logarithm", ""},
- {12, "MINIMUM", 0, "Minimum", ""},
- {13, "MAXIMUM", 0, "Maximum", ""},
- {14, "ROUND", 0, "Round", ""},
- {15, "LESS_THAN", 0, "Less Than", ""},
- {16, "GREATER_THAN", 0, "Greater Than", ""},
-
- {0, NULL, 0, NULL, NULL}
- };
-
prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
- RNA_def_property_enum_items(prop, items);
+ RNA_def_property_enum_items(prop, node_math_items);
RNA_def_property_ui_text(prop, "Operation", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
}
static void def_vector_math(StructRNA *srna)
{
PropertyRNA *prop;
- static EnumPropertyItem items[] = {
- {0, "ADD", 0, "Add", ""},
- {1, "SUBTRACT", 0, "Subtract", ""},
- {2, "AVERAGE", 0, "Average", ""},
- {3, "DOT_PRODUCT", 0, "Dot Product", ""},
- {4, "CROSS_PRODUCT", 0, "Cross Product", ""},
- {5, "NORMALIZE", 0, "Normalize", ""},
-
- {0, NULL, 0, NULL, NULL}
- };
-
prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
- RNA_def_property_enum_items(prop, items);
+ RNA_def_property_enum_items(prop, node_vec_math_items);
RNA_def_property_ui_text(prop, "Operation", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
}
static void def_rgb_curve(StructRNA *srna)
@@ -240,6 +330,7 @@ static void def_rgb_curve(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Mapping", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_vector_curve(StructRNA *srna)
@@ -250,6 +341,7 @@ static void def_vector_curve(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Mapping", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_time(StructRNA *srna)
@@ -260,59 +352,44 @@ static void def_time(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Curve", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_ui_text(prop, "Start Frame", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom2");
RNA_def_property_ui_text(prop, "End Frame", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_val_to_rgb(StructRNA *srna)
{
- /*PropertyRNA *prop;*/
+ PropertyRNA *prop;
- /* TODO: uncomment when ColorBand is wrapped *//*
- prop = RNA_def_property(srna, "color_band", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "storage");
- RNA_def_property_struct_type(prop, "ColorBand");
- RNA_def_property_ui_text(prop, "Color Band", "");*/
+ RNA_def_property_struct_type(prop, "ColorRamp");
+ RNA_def_property_ui_text(prop, "Color Ramp", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_mix_rgb(StructRNA *srna)
{
PropertyRNA *prop;
- static EnumPropertyItem blend_type_items[] = {
- { 0, "MIX", 0, "Mix", ""},
- { 1, "ADD", 0, "Add", ""},
- { 3, "SUBTRACT", 0, "Subtract", ""},
- { 2, "MULTIPLY", 0, "Multiply", ""},
- { 4, "SCREEN", 0, "Screen", ""},
- { 9, "OVERLAY", 0, "Overlay", ""},
- { 5, "DIVIDE", 0, "Divide", ""},
- { 6, "DIFFERENCE", 0, "Difference", ""},
- { 7, "DARKEN", 0, "Darken", ""},
- { 8, "LIGHTEN", 0, "Lighten", ""},
- {10, "DODGE", 0, "Dodge", ""},
- {11, "BURN", 0, "Burn", ""},
- {15, "COLOR", 0, "Color", ""},
- {14, "VALUE", 0, "Value", ""},
- {13, "SATURATION", 0, "Saturation", ""},
- {12, "HUE", 0, "Hue", ""},
- {0, NULL, 0, NULL, NULL}
- };
-
prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
- RNA_def_property_enum_items(prop, blend_type_items);
+ RNA_def_property_enum_items(prop, node_blend_type_items);
RNA_def_property_ui_text(prop, "Blend Type", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
prop = RNA_def_property(srna, "alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
- RNA_def_property_ui_text(prop, "Diffuse", "Include alpha of second input in this operation");
+ RNA_def_property_ui_text(prop, "Alpha", "Include alpha of second input in this operation");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_texture(StructRNA *srna)
@@ -324,10 +401,12 @@ static void def_texture(StructRNA *srna)
RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
prop = RNA_def_property(srna, "node_output", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_ui_text(prop, "Node Output", "For node-based textures, which output node to use");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
@@ -342,18 +421,22 @@ static void def_sh_material(StructRNA *srna)
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Material", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
prop = RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_DIFF);
RNA_def_property_ui_text(prop, "Diffuse", "Material Node outputs Diffuse");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Material Node outputs Specular");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "invert_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_NEG);
RNA_def_property_ui_text(prop, "Invert Normal", "Material Node uses inverted normal");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_sh_mapping(StructRNA *srna)
@@ -364,6 +447,7 @@ static void def_sh_mapping(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "TexMapping");
RNA_def_property_ui_text(prop, "Mapping", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_sh_geometry(StructRNA *srna)
@@ -375,10 +459,12 @@ static void def_sh_geometry(StructRNA *srna)
prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvname");
RNA_def_property_ui_text(prop, "UV Layer", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "color_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "colname");
RNA_def_property_ui_text(prop, "Vertex Color Layer", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
@@ -387,10 +473,12 @@ static void def_sh_geometry(StructRNA *srna)
static void def_cmp_alpha_over(StructRNA *srna)
{
PropertyRNA *prop;
-
+
+ // XXX: Tooltip
prop = RNA_def_property(srna, "convert_premul", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
- RNA_def_property_ui_text(prop, "convert_premul", "TODO: don't know what this is");
+ RNA_def_property_ui_text(prop, "Convert Premul", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
RNA_def_struct_sdna_from(srna, "NodeTwoFloats", "storage");
@@ -398,6 +486,32 @@ static void def_cmp_alpha_over(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Premul", "Mix Factor");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+}
+
+static void def_cmp_hue_saturation(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ RNA_def_struct_sdna_from(srna, "NodeHueSat", "storage");
+
+ prop = RNA_def_property(srna, "hue", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "hue");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Hue", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "sat", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "sat");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Saturation", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "val", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "val");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Value", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_blur(StructRNA *srna)
@@ -422,58 +536,70 @@ static void def_cmp_blur(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "sizex");
RNA_def_property_range(prop, 0, 256);
RNA_def_property_ui_text(prop, "Size X", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "sizey", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sizey");
- RNA_def_property_range(prop, 1, 256);
+ RNA_def_property_range(prop, 0, 256);
RNA_def_property_ui_text(prop, "Size Y", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samples");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Samples", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "max_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxspeed");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "Max Speed", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "min_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "minspeed");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "Min Speed", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "relative", 1);
RNA_def_property_ui_text(prop, "Relative", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fac");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Factor", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "factor_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "percentx");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Relative Size X", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "factor_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "percenty");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Relative Size Y", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filtertype");
RNA_def_property_enum_items(prop, filter_type_items);
RNA_def_property_ui_text(prop, "Filter Type", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "bokeh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bokeh", 1);
RNA_def_property_ui_text(prop, "Bokeh", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "gamma", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gamma", 1);
RNA_def_property_ui_text(prop, "Gamma", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/*
TODO:
@@ -490,21 +616,11 @@ static void def_cmp_filter(StructRNA *srna)
{
PropertyRNA *prop;
- static EnumPropertyItem type_items[] = {
- {0, "SOFTEN", 0, "Soften", ""},
- {1, "SHARPEN", 0, "Sharpen", ""},
- {2, "LAPLACE", 0, "Laplace", ""},
- {3, "SOBEL", 0, "Sobel", ""},
- {4, "PREWITT", 0, "Prewitt", ""},
- {5, "KIRSCH", 0, "Kirsch", ""},
- {6, "SHADOW", 0, "Shadow", ""},
- {0, NULL, 0, NULL, NULL}
- };
-
prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
- RNA_def_property_enum_items(prop, type_items);
+ RNA_def_property_enum_items(prop, node_filter_items);
RNA_def_property_ui_text(prop, "Filter Type", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
}
static void def_cmp_map_value(StructRNA *srna)
@@ -515,31 +631,41 @@ static void def_cmp_map_value(StructRNA *srna)
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "loc");
+ RNA_def_property_array(prop, 1);
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Offset", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "size");
+ RNA_def_property_array(prop, 1);
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Size", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
RNA_def_property_ui_text(prop, "Use Minimum", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
RNA_def_property_ui_text(prop, "Use Maximum", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
+ RNA_def_property_array(prop, 1);
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Minimum", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
+ RNA_def_property_array(prop, 1);
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Maximum", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_vector_blur(StructRNA *srna)
@@ -551,22 +677,47 @@ static void def_cmp_vector_blur(StructRNA *srna)
prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samples");
RNA_def_property_ui_text(prop, "Samples", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "min_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "minspeed");
RNA_def_property_ui_text(prop, "Min Speed", "Minimum speed for a pixel to be blurred; used to separate background from foreground");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "max_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxspeed");
- RNA_def_property_ui_text(prop, "Min Speed", "Maximum speed, or zero for none");
+ RNA_def_property_ui_text(prop, "Max Speed", "Maximum speed, or zero for none");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fac");
RNA_def_property_ui_text(prop, "Blur Factor", "Scaling factor for motion vectors; actually 'shutter speed' in frames");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "curved", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "curved", 1);
RNA_def_property_ui_text(prop, "Curved", "Interpolate between frames in a bezier curve, rather than linearly");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+}
+
+static void def_cmp_levels(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ static EnumPropertyItem space_items[] = {
+ {1, "COMNINED_RGB", 0, "C", "Combined RGB"},
+ {2, "RED", 0, "R", "Red Channel"},
+ {3, "GREEN", 0, "G", "Green Channel"},
+ {4, "BLUE", 0, "B", "Blue Channel"},
+ {5, "LUMINANCE", 0, "L", "Luminance Channel"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "custom1");
+ RNA_def_property_enum_items(prop, space_items);
+ RNA_def_property_ui_text(prop, "Color Space", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_image(StructRNA *srna)
@@ -586,6 +737,7 @@ static void def_cmp_image(StructRNA *srna)
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, 0, "rna_Node_update_name");
RNA_def_struct_sdna_from(srna, "ImageUser", "storage");
@@ -595,24 +747,29 @@ static void def_cmp_image(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "frames");
RNA_def_property_range(prop, 1, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Frames", "Number of images used in animation");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, 1, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cycl", 1);
RNA_def_property_ui_text(prop, "Cyclic", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "auto_refresh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS);
RNA_def_property_ui_text(prop, "Auto-Refresh", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* } */
@@ -622,6 +779,7 @@ static void def_cmp_image(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "layer");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Layer", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* } */
@@ -638,16 +796,19 @@ static void def_cmp_render_layers(StructRNA *srna)
RNA_def_property_struct_type(prop, "Scene");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Scene", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
/* TODO: layers in menu */
prop = RNA_def_property(srna, "layer", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_ui_text(prop, "Layer", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO: comments indicate this might be a hack */
prop = RNA_def_property(srna, "re_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
RNA_def_property_ui_text(prop, "Re-render", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_output_file(StructRNA *srna)
@@ -711,11 +872,13 @@ static void def_cmp_output_file(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, 1, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "efra");
RNA_def_property_range(prop, 1, MAXFRAMEF);
RNA_def_property_ui_text(prop, "End Frame", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_dilate_erode(StructRNA *srna)
@@ -724,7 +887,9 @@ static void def_cmp_dilate_erode(StructRNA *srna)
prop = RNA_def_property(srna, "distance", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom2");
+ RNA_def_property_range(prop, -100, 100);
RNA_def_property_ui_text(prop, "Distance", "Distance to grow/shrink (number of iterations)");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_scale(StructRNA *srna)
@@ -742,6 +907,7 @@ static void def_cmp_scale(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, space_items);
RNA_def_property_ui_text(prop, "Space", "Coordinate space to scale relative to");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_diff_matte(StructRNA *srna)
@@ -756,11 +922,13 @@ static void def_cmp_diff_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Tolerance", "Color distances below this threshold are keyed.");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Falloff", "Color distances below this additional threshold are partially keyed.");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_color_matte(StructRNA *srna)
@@ -775,16 +943,19 @@ static void def_cmp_color_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "H", "Hue tolerance for colors to be considered a keying color");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "s", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "S", "Saturation Tolerance for the color");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "v", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t3");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "V", "Value Tolerance for the color");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_distance_matte(StructRNA *srna)
@@ -799,11 +970,13 @@ static void def_cmp_distance_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Tolerance", "Color distances below this threshold are keyed.");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Falloff", "Color distances below this additional threshold are partially keyed.");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_color_spill(StructRNA *srna)
@@ -811,9 +984,9 @@ static void def_cmp_color_spill(StructRNA *srna)
PropertyRNA *prop;
static EnumPropertyItem channel_items[] = {
- {1, "R", 0, "Red", ""},
- {2, "G", 0, "Green", ""},
- {3, "B", 0, "Blue", ""},
+ {1, "R", 0, "R", "Red Spill Suppression"},
+ {2, "G", 0, "G", "Green Spill Suppression"},
+ {3, "B", 0, "B", "Blue Spill Suppression"},
{0, NULL, 0, NULL, NULL}
};
@@ -821,6 +994,7 @@ static void def_cmp_color_spill(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, channel_items);
RNA_def_property_ui_text(prop, "Channel", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
@@ -828,6 +1002,7 @@ static void def_cmp_color_spill(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 0.5f);
RNA_def_property_ui_text(prop, "Amount", "How much the selected channel is affected by");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_chroma_matte(StructRNA *srna)
@@ -840,26 +1015,31 @@ static void def_cmp_chroma_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 1.0f, 80.0f);
RNA_def_property_ui_text(prop, "Acceptance", "Tolerance for a color to be considered a keying color");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "cutoff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 30.0f);
RNA_def_property_ui_text(prop, "Cutoff", "Tolerance below which colors will be considered as exact matches");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fsize");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Lift", "Alpha lift");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fstrength");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gain", "Alpha gain");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "shadow_adjust", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t3");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shadow Adjust", "Adjusts the brightness of any shadows captured");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO:
if(c->t2 > c->t1)
@@ -883,10 +1063,12 @@ static void def_cmp_channel_matte(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, color_space_items);
RNA_def_property_ui_text(prop, "Color Space", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO: channel must be 1, 2 or 3 */
prop = RNA_def_property(srna, "channel", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom2");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
RNA_def_property_ui_text(prop, "Channel", "");
RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
@@ -895,11 +1077,13 @@ static void def_cmp_channel_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "low", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO:
if(c->t2 > c->t1)
@@ -911,17 +1095,11 @@ static void def_cmp_flip(StructRNA *srna)
{
PropertyRNA *prop;
- static EnumPropertyItem axis_items[] = {
- {0, "X", 0, "X", ""},
- {1, "Y", 0, "Y", ""},
- {2, "XY", 0, "X & Y", ""},
- {0, NULL, 0, NULL, NULL}
- };
-
prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
- RNA_def_property_enum_items(prop, axis_items);
+ RNA_def_property_enum_items(prop, node_flip_items);
RNA_def_property_ui_text(prop, "Axis", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
}
static void def_cmp_splitviewer(StructRNA *srna)
@@ -938,12 +1116,13 @@ static void def_cmp_splitviewer(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom2");
RNA_def_property_enum_items(prop, axis_items);
RNA_def_property_ui_text(prop, "Axis", "");
-
- /* TODO: percentage */
- prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_PERCENTAGE);
- RNA_def_property_float_sdna(prop, NULL, "custom1");
- RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "factor", PROP_INT, PROP_FACTOR);
+ RNA_def_property_int_sdna(prop, NULL, "custom1");
+ RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Factor", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_id_mask(StructRNA *srna)
@@ -954,17 +1133,18 @@ static void def_cmp_id_mask(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Index", "Pass index number to convert to alpha");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_map_uv(StructRNA *srna)
{
PropertyRNA *prop;
-
- /* TODO: percentage */
- prop = RNA_def_property(srna, "alpha", PROP_INT, PROP_PERCENTAGE);
+
+ prop = RNA_def_property(srna, "alpha", PROP_INT, PROP_FACTOR);
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Alpha", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_defocus(StructRNA *srna)
@@ -988,50 +1168,60 @@ static void def_cmp_defocus(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "bktype");
RNA_def_property_enum_items(prop, bokeh_items);
RNA_def_property_ui_text(prop, "Bokeh Type", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO: angle in degrees */
prop = RNA_def_property(srna, "angle", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rotation");
RNA_def_property_range(prop, 0, 90);
RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset in degrees");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "gamma_correction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gamco", 1);
RNA_def_property_ui_text(prop, "Gamma Correction", "Enable gamma correction before and after main process");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO */
prop = RNA_def_property(srna, "f_stop", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fstop");
RNA_def_property_range(prop, 0.0f, 128.0f);
RNA_def_property_ui_text(prop, "fStop", "Amount of focal blur, 128=infinity=perfect focus, half the value doubles the blur radius");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "max_blur", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxblur");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Max Blur", "blur limit, maximum CoC radius, 0=no limit");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bthresh");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Threshold", "CoC radius threshold, prevents background bleed on in-focus midground, 0=off");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "preview", 1);
RNA_def_property_ui_text(prop, "Preview", "Enable sampling mode, useful for preview when using low samplecounts");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samples");
RNA_def_property_range(prop, 16, 256);
RNA_def_property_ui_text(prop, "Samples", "Number of samples (16=grainy, higher=less noise)");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "no_zbuf", 1);
RNA_def_property_ui_text(prop, "Use Z-Buffer", "Disable when using an image as input instead of actual zbuffer (auto enabled if node not image based, eg. time node)");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "z_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Z-Scale", "Scales the Z input when not using a zbuffer, controls maximum blur designated by the color white or input value 1");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_luma_matte(StructRNA *srna)
@@ -1044,11 +1234,13 @@ static void def_cmp_luma_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "low", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO: keep low less than high */
@@ -1061,10 +1253,12 @@ static void def_cmp_invert(StructRNA *srna)
prop = RNA_def_property(srna, "rgb", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_CHAN_RGB);
RNA_def_property_ui_text(prop, "RGB", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_CHAN_A);
RNA_def_property_ui_text(prop, "Alpha", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_crop(StructRNA *srna)
@@ -1074,6 +1268,7 @@ static void def_cmp_crop(StructRNA *srna)
prop = RNA_def_property(srna, "crop_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
RNA_def_property_ui_text(prop, "Crop Image Size", "Whether to crop the size of the input image");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
RNA_def_struct_sdna_from(srna, "NodeTwoXYs", "storage");
@@ -1081,21 +1276,25 @@ static void def_cmp_crop(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "x1");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "X1", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "x2", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "x2");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "X2", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "y1", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "y1");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Y1", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "y2", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "y2");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Y2", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_dblur(StructRNA *srna)
@@ -1106,42 +1305,50 @@ static void def_cmp_dblur(StructRNA *srna)
prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "iter");
- RNA_def_property_range(prop, 1, 128);
+ RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "Iterations", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "wrap", 1);
RNA_def_property_ui_text(prop, "Wrap", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "center_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "center_x");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Center X", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "center_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "center_y");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Center Y", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "distance");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Distance", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, 0.0f, 360.0f);
RNA_def_property_ui_text(prop, "Angle", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "spin", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spin");
RNA_def_property_range(prop, -360.0f, 360.0f);
RNA_def_property_ui_text(prop, "Spin", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zoom");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Zoom", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_bilateral_blur(StructRNA *srna)
@@ -1154,16 +1361,19 @@ static void def_cmp_bilateral_blur(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "iter");
RNA_def_property_range(prop, 1, 128);
RNA_def_property_ui_text(prop, "Iterations", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "sigma_color", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sigma_color");
RNA_def_property_range(prop, 0.01f, 3.0f);
RNA_def_property_ui_text(prop, "Color Sigma", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "sigma_space", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sigma_space");
RNA_def_property_range(prop, 0.01f, 30.0f);
RNA_def_property_ui_text(prop, "Space Sigma", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_premul_key(StructRNA *srna)
@@ -1180,6 +1390,7 @@ static void def_cmp_premul_key(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Mapping", "Conversion between premultiplied alpha and key alpha");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
@@ -1195,12 +1406,12 @@ static void def_cmp_glare(StructRNA *srna)
{0, NULL, 0, NULL, NULL}
};
- /*static EnumPropertyItem quality_items[] = {
+ static EnumPropertyItem quality_items[] = {
{0, "HIGH", 0, "High", ""},
{1, "MEDIUM", 0, "Medium", ""},
{2, "LOW", 0, "Low", ""},
{0, NULL, 0, NULL, NULL}
- };*/
+ };
RNA_def_struct_sdna_from(srna, "NodeGlare", "storage");
@@ -1208,55 +1419,66 @@ static void def_cmp_glare(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Glare Type", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "quality", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "quality");
- RNA_def_property_enum_items(prop, type_items);
+ RNA_def_property_enum_items(prop, quality_items);
RNA_def_property_ui_text(prop, "Quality", "If not set to high quality, the effect will be applied to a low-res copy of the source image");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "iter");
RNA_def_property_range(prop, 2, 5);
RNA_def_property_ui_text(prop, "Iterations", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "color_modulation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colmod");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Color Modulation", "");
+ RNA_def_property_ui_text(prop, "Color Modulation", "Amount of Color Modulation, modulates colors of streaks and ghosts for a spectral dispersion effect");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "mix", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mix");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Mix", "-1 is original image only, 0 is exact 50/50 mix, 1 is processed image only");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "threshold");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Threshold", "The glare filter will only be applied to pixels brighter than this value");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "streaks", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, 2, 16);
RNA_def_property_ui_text(prop, "Streaks", "Total number of streaks");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "angle_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "angle_ofs");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "Angle Offset", "Streak angle offset in degrees");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "fade", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fade");
RNA_def_property_range(prop, 0.75f, 1.0f);
RNA_def_property_ui_text(prop, "Fade", "Streak fade-out factor");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "rotate_45", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "angle", 1);
RNA_def_property_ui_text(prop, "Rotate 45", "Simple star filter: add 45 degree rotation offset");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "size");
RNA_def_property_range(prop, 6, 9);
RNA_def_property_ui_text(prop, "Size", "Glow/glare size (not actual size; relative to initial size of bright area of pixels)");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO */
}
@@ -1277,45 +1499,49 @@ static void def_cmp_tonemap(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Tonemap Type", "");
-
- /* TODO: if type==0 { */
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "key", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "key");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Key", "The value the average luminance is mapped to");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, 0.001f, 10.0f);
RNA_def_property_ui_text(prop, "Offset", "Normally always 1, but can be used as an extra control to alter the brightness curve");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "gamma");
RNA_def_property_range(prop, 0.001f, 3.0f);
RNA_def_property_ui_text(prop, "Gamma", "If not used, set to 1");
-
- /* TODO: } else { */
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f");
RNA_def_property_range(prop, -8.0f, 8.0f);
RNA_def_property_ui_text(prop, "Intensity", "If less than zero, darkens image; otherwise, makes it brighter");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "m");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Contrast", "Set to 0 to use estimate from input image");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "adaptation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "a");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Adaptation", "If 0, global; if 1, based on pixel intensity");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "c");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Color Correction", "If 0, same for all channels; if 1, each independent");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_lensdist(StructRNA *srna)
@@ -1327,16 +1553,17 @@ static void def_cmp_lensdist(StructRNA *srna)
prop = RNA_def_property(srna, "projector", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "proj", 1);
RNA_def_property_ui_text(prop, "Projector", "Enable/disable projector mode. Effect is applied in horizontal direction only.");
-
- /* TODO: if proj mode is off { */
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "jitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "jit", 1);
RNA_def_property_ui_text(prop, "Jitter", "Enable/disable jittering; faster, but also noisier");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "fit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "fit", 1);
RNA_def_property_ui_text(prop, "Fit", "For positive distortion factor only: scale image such that black areas are not visible");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
@@ -1352,6 +1579,7 @@ static void def_tex_output(StructRNA *srna)
prop = RNA_def_property(srna, "output_name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Output Name", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_tex_image(StructRNA *srna)
@@ -1362,6 +1590,7 @@ static void def_tex_image(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "ImageUser");
RNA_def_property_ui_text(prop, "Settings", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_tex_bricks(StructRNA *srna)
@@ -1372,21 +1601,25 @@ static void def_tex_bricks(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "custom3");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Offset Amount", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "offset_frequency", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_range(prop, 2, 99);
RNA_def_property_ui_text(prop, "Offset Frequency", "Offset every N rows");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "squash", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "custom4");
RNA_def_property_range(prop, 0.0f, 99.0f);
RNA_def_property_ui_text(prop, "Squash Amount", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "squash_frequency", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom2");
RNA_def_property_range(prop, 2, 99);
RNA_def_property_ui_text(prop, "Squash Frequency", "Squash every N rows");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
/* -------------------------------------------------------------------------- */
@@ -1478,6 +1711,8 @@ static void rna_def_nodetree(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Node Tree", "Node tree consisting of linked nodes used for materials, textures and compositing.");
RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_icon(srna, ICON_NODE);
+
+ rna_def_animdata_common(srna);
prop = RNA_def_property(srna, "nodes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "nodes", NULL);
diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h
index be4f131a6d6..69424649b3b 100644
--- a/source/blender/makesrna/intern/rna_nodetree_types.h
+++ b/source/blender/makesrna/intern/rna_nodetree_types.h
@@ -64,7 +64,7 @@ DefNode( CompositorNode, CMP_NODE_VECBLUR, def_cmp_vector_blur, "VECBL
DefNode( CompositorNode, CMP_NODE_SEPRGBA, 0, "SEPRGBA", SepRGBA, "Separate RGBA", "" )
DefNode( CompositorNode, CMP_NODE_SEPHSVA, 0, "SEPHSVA", SepHSVA, "Separate HSVA", "" )
DefNode( CompositorNode, CMP_NODE_SETALPHA, 0, "SETALPHA", SetAlpha, "Set Alpha", "" )
-DefNode( CompositorNode, CMP_NODE_HUE_SAT, 0, "HUE_SAT", HueSat, "Hue/Saturation", "" )
+DefNode( CompositorNode, CMP_NODE_HUE_SAT, def_cmp_hue_saturation, "HUE_SAT", HueSat, "Hue/Saturation", "" )
DefNode( CompositorNode, CMP_NODE_IMAGE, def_cmp_image, "IMAGE", Image, "Image", "" )
DefNode( CompositorNode, CMP_NODE_R_LAYERS, def_cmp_render_layers, "R_LAYERS", RLayers, "Render Layers", "" )
DefNode( CompositorNode, CMP_NODE_COMPOSITE, 0, "COMPOSITE", Composite, "Composite", "" )
@@ -104,7 +104,7 @@ DefNode( CompositorNode, CMP_NODE_PREMULKEY, def_cmp_premul_key, "PREMU
DefNode( CompositorNode, CMP_NODE_GLARE, def_cmp_glare, "GLARE", Glare, "Glare", "" )
DefNode( CompositorNode, CMP_NODE_TONEMAP, def_cmp_tonemap, "TONEMAP", Tonemap, "Tonemap", "" )
DefNode( CompositorNode, CMP_NODE_LENSDIST, def_cmp_lensdist, "LENSDIST", Lensdist, "Lensdist", "" )
-DefNode( CompositorNode, CMP_NODE_VIEW_LEVELS, 0, "LEVELS", Levels, "Levels", "" )
+DefNode( CompositorNode, CMP_NODE_VIEW_LEVELS, def_cmp_levels, "LEVELS", Levels, "Levels", "" )
DefNode( CompositorNode, CMP_NODE_COLOR_MATTE, def_cmp_color_matte, "COLOR_MATTE", ColorMatte, "Color Matte", "" )
DefNode( CompositorNode, CMP_NODE_DIST_MATTE, def_cmp_distance_matte, "DISTANCE_MATTE", DistanceMatte, "Distance Matte", "" )
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 3d43dfdfc2c..3a3842adbf1 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -31,6 +31,7 @@
#include "rna_internal.h"
+#include "DNA_action_types.h"
#include "DNA_customdata_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
@@ -82,6 +83,8 @@ EnumPropertyItem object_type_items[] = {
#ifdef RNA_RUNTIME
+#include "BLI_arithb.h"
+
#include "DNA_key_types.h"
#include "BKE_armature.h"
@@ -103,6 +106,12 @@ void rna_Object_update(bContext *C, PointerRNA *ptr)
DAG_id_flush_update(ptr->id.data, OB_RECALC_OB);
}
+void rna_Object_matrix_update(bContext *C, PointerRNA *ptr)
+{
+ ED_object_apply_obmat(ptr->id.data);
+ rna_Object_update(C, ptr);
+}
+
void rna_Object_update_data(bContext *C, PointerRNA *ptr)
{
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
@@ -440,6 +449,43 @@ static void rna_Object_active_particle_system_index_set(struct PointerRNA *ptr,
psys_set_current_num(ob, value);
}
+/* rotation - euler angles */
+static void rna_Object_rotation_euler_get(PointerRNA *ptr, float *value)
+{
+ Object *ob= ptr->data;
+
+ if(ob->rotmode == ROT_MODE_AXISANGLE) /* default XYZ eulers */
+ AxisAngleToEulO(&ob->quat[1], ob->quat[0], value, EULER_ORDER_DEFAULT);
+ else if(ob->rotmode == ROT_MODE_QUAT) /* default XYZ eulers */
+ QuatToEul(ob->quat, value);
+ else
+ VECCOPY(value, ob->rot);
+}
+
+/* rotation - euler angles */
+static void rna_Object_rotation_euler_set(PointerRNA *ptr, const float *value)
+{
+ Object *ob= ptr->data;
+
+ if(ob->rotmode == ROT_MODE_AXISANGLE) /* default XYZ eulers */
+ EulOToAxisAngle((float *)value, EULER_ORDER_DEFAULT, &ob->quat[1], &ob->quat[0]);
+ else if(ob->rotmode == ROT_MODE_QUAT) /* default XYZ eulers */
+ EulToQuat((float*)value, ob->quat);
+ else
+ VECCOPY(ob->rot, value);
+}
+
+static void rna_Object_rotation_mode_set(PointerRNA *ptr, int value)
+{
+ Object *ob= ptr->data;
+
+ /* use API Method for conversions... */
+ BKE_rotMode_change_values(ob->quat, ob->rot, ob->rotmode, (short)value);
+
+ /* finally, set the new rotation type */
+ ob->rotmode= value;
+}
+
static PointerRNA rna_MaterialSlot_material_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@@ -695,7 +741,7 @@ static PointerRNA rna_Object_field_get(PointerRNA *ptr)
/* weak */
if(!ob->pd)
- ob->pd= object_add_collision_fields();
+ ob->pd= object_add_collision_fields(0);
return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, ob->pd);
}
@@ -706,7 +752,7 @@ static PointerRNA rna_Object_collision_get(PointerRNA *ptr)
/* weak */
if(!ob->pd)
- ob->pd= object_add_collision_fields();
+ ob->pd= object_add_collision_fields(0);
return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd);
}
@@ -1045,6 +1091,18 @@ static void rna_def_object(BlenderRNA *brna)
{OB_DUPLIFACES, "FACES", 0, "Faces", "Duplicate child objects on all faces."},
{OB_DUPLIGROUP, "GROUP", 0, "Group", "Enable group instancing."},
{0, NULL, 0, NULL, NULL}};
+
+ // XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable
+ static EnumPropertyItem prop_rotmode_items[] = {
+ {ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock."},
+ {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock. (Default)"},
+ {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector."},
+ {0, NULL, 0, NULL, NULL}};
int matrix_dimsize[]= {4, 4};
@@ -1161,57 +1219,105 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_SHADING, NULL);
/* transform */
-
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "Location of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
-
- prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_TRANSLATION);
- RNA_def_property_float_sdna(prop, NULL, "dloc");
- RNA_def_property_ui_text(prop, "Delta Location", "Extra added translation to object location.");
+
+ prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
+ RNA_def_property_float_sdna(prop, NULL, "quat");
+ RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
+ /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
+ * having a single one is better for Keyframing and other property-management situations...
+ */
+ prop= RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "quat");
+ // TODO: we may need some validation funcs
+ RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ prop= RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
- RNA_def_property_ui_text(prop, "Rotation", "Rotation of the object.");
+ RNA_def_property_float_funcs(prop, "rna_Object_rotation_euler_get", "rna_Object_rotation_euler_set", NULL);
+ RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
-
- prop= RNA_def_property(srna, "delta_rotation", PROP_FLOAT, PROP_EULER);
- RNA_def_property_float_sdna(prop, NULL, "drot");
- RNA_def_property_ui_text(prop, "Delta Rotation", "Extra added rotation to the rotation of the object.");
+
+ prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "rotmode");
+ RNA_def_property_enum_items(prop, prop_rotmode_items); // XXX move to using a single define of this someday
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Object_rotation_mode_set", NULL);
+ RNA_def_property_ui_text(prop, "Rotation Mode", "");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "Scaling of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
-
+
+ /* delta transforms */
+ prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "dloc");
+ RNA_def_property_ui_text(prop, "Delta Location", "Extra added translation to object location.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ prop= RNA_def_property(srna, "delta_rotation_euler", PROP_FLOAT, PROP_EULER);
+ RNA_def_property_float_sdna(prop, NULL, "drot");
+ RNA_def_property_ui_text(prop, "Delta Rotation (Euler)", "Extra added rotation to the rotation of the object (when using Euler rotations).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ prop= RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
+ RNA_def_property_float_sdna(prop, NULL, "dquat");
+ RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)", "Extra added rotation to the rotation of the object (when using Quaternion rotations).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+#if 0 // XXX not supported well yet...
+ prop= RNA_def_property(srna, "delta_rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "dquat");
+ RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)", "Extra added rotation to the rotation of the object (when using Axis-Angle rotations).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+#endif
+
prop= RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "dsize");
RNA_def_property_ui_text(prop, "Delta Scale", "Extra added scaling to the scale of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
-
+
+ /* transform locks */
prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ // XXX this is sub-optimal - it really should be included above, but due to technical reasons we can't do this!
+ prop= RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW);
+ RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)", "Lock editing of 'angle' component of four-component rotations in the interface.");
+ // XXX this needs a better name
+ prop= RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D);
+ RNA_def_property_ui_text(prop, "Lock Rotations (4D)", "Lock editing of four component rotations by components (instead of as Eulers).");
prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
/* matrix */
prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "obmat");
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Matrix", "Transformation matrix.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_matrix_update");
/* collections */
prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
@@ -1223,14 +1329,13 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the geometric data of the Object.");
/* game engine */
-
- prop= RNA_def_property(srna, "game", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "game", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "GameObjectSettings");
RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Game Settings", "Game engine related settings for the object.");
/* vertex groups */
-
prop= RNA_def_property(srna, "vertex_groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "defbase", NULL);
RNA_def_property_struct_type(prop, "VertexGroup");
@@ -1249,7 +1354,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Object_update_data");
/* empty */
-
prop= RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "empty_drawtype");
RNA_def_property_enum_items(prop, empty_drawtype_items);
@@ -1263,7 +1367,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* render */
-
prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "index");
RNA_def_property_ui_text(prop, "Pass Index", "Index # for the IndexOB render pass.");
@@ -1274,7 +1377,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* physics */
-
prop= RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "FieldSettings");
@@ -1308,7 +1410,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* restrict */
-
prop= RNA_def_property(srna, "restrict_view", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEW);
RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport.");
@@ -1325,20 +1426,9 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* anim */
-
rna_def_animdata_common(srna);
- prop= RNA_def_property(srna, "draw_keys", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_DRAWKEY);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // update ipo flag indirect
- RNA_def_property_ui_text(prop, "Draw Keys", "Draw object as key positions.");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
-
- prop= RNA_def_property(srna, "draw_keys_selected", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_DRAWKEYSEL);
- RNA_def_property_ui_text(prop, "Draw Keys Selected", "Limit the drawing of object keys to selected.");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
-
+ /* duplicates */
prop= RNA_def_property(srna, "track_override_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_POWERTRACK);
RNA_def_property_ui_text(prop, "Track Override Parent", "Override rotation from parenting.");
@@ -1406,8 +1496,12 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
- /* time offset */
+ prop= RNA_def_property(srna, "dupli_list", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "duplilist", NULL);
+ RNA_def_property_struct_type(prop, "DupliObject");
+ RNA_def_property_ui_text(prop, "Dupli list", "Object duplis.");
+ /* time offset */
prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_float_sdna(prop, NULL, "sf");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
@@ -1434,7 +1528,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
/* drawing */
-
prop= RNA_def_property(srna, "max_draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dt");
RNA_def_property_enum_items(prop, drawtype_items);
@@ -1501,7 +1594,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures.");
/* shape keys */
-
prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_shape_key_lock_set");
@@ -1523,12 +1615,43 @@ static void rna_def_object(BlenderRNA *brna)
RNA_api_object(srna);
}
+static void rna_def_dupli_object(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "DupliObject", NULL);
+ RNA_def_struct_sdna(srna, "DupliObject");
+ RNA_def_struct_ui_text(srna, "Dupli Object", "Dupli Object data.");
+ /* RNA_def_struct_ui_icon(srna, ICON_OBJECT_DATA); */
+
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ /* RNA_def_property_struct_type(prop, "Object"); */
+ RNA_def_property_pointer_sdna(prop, NULL, "ob");
+ /* RNA_def_property_pointer_funcs(prop, "rna_DupliObject_object_get", NULL, NULL); */
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Object", "Object this DupliObject represents.");
+
+ prop= RNA_def_property(srna, "ob_matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "omat");
+ RNA_def_property_array(prop, 16);
+ RNA_def_property_ui_text(prop, "Object Matrix", "Object transformation matrix.");
+
+ prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "mat");
+ RNA_def_property_array(prop, 16);
+ RNA_def_property_ui_text(prop, "DupliObject Matrix", "DupliObject transformation matrix.");
+
+ /* TODO: DupliObject has more properties that can be wrapped */
+}
+
void RNA_def_object(BlenderRNA *brna)
{
rna_def_object(brna);
rna_def_object_game_settings(brna);
rna_def_vertex_group(brna);
rna_def_material_slot(brna);
+ rna_def_dupli_object(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 3541bc2b1b0..098604c1eab 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -28,76 +28,402 @@
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
+#include <time.h>
#include "RNA_define.h"
#include "RNA_types.h"
+#include "DNA_object_types.h"
+
+#include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
+
+#include "ED_mesh.h"
+
#ifdef RNA_RUNTIME
-#include "MEM_guardedalloc.h"
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_context.h"
+#include "BKE_report.h"
+#include "BKE_object.h"
+#include "BKE_mesh.h"
+#include "BKE_DerivedMesh.h"
#include "BKE_customdata.h"
-#include "BKE_DerivedMesh.h"
+#include "BKE_anim.h"
+#include "BKE_depsgraph.h"
+#include "BKE_displist.h"
+#include "BKE_font.h"
+#include "BKE_mball.h"
+
+#include "BLI_arithb.h"
#include "DNA_mesh_types.h"
#include "DNA_scene_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_modifier_types.h"
+
+#include "MEM_guardedalloc.h"
-/* copied from init_render_mesh (render code) */
-Mesh *rna_Object_create_render_mesh(Object *ob, Scene *scene)
+/* copied from Mesh_getFromObject and adapted to RNA interface */
+/* settings: 0 - preview, 1 - render */
+static Mesh *rna_Object_create_mesh(Object *ob, bContext *C, ReportList *reports, int apply_modifiers, int settings)
{
- CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL;
- DerivedMesh *dm;
- Mesh *me;
+ Mesh *tmpmesh;
+ Curve *tmpcu = NULL;
+ Object *tmpobj = NULL;
+ int render = settings, i;
+ int cage = !apply_modifiers;
+ Scene *sce = CTX_data_scene(C);
+
+ /* perform the mesh extraction based on type */
+ switch (ob->type) {
+ case OB_FONT:
+ case OB_CURVE:
+ case OB_SURF:
+
+ /* copies object and modifiers (but not the data) */
+ tmpobj= copy_object(ob);
+ tmpcu = (Curve *)tmpobj->data;
+ tmpcu->id.us--;
+
+ /* if getting the original caged mesh, delete object modifiers */
+ if( cage )
+ object_free_modifiers(tmpobj);
+
+ /* copies the data */
+ tmpobj->data = copy_curve( (Curve *) ob->data );
+
+#if 0
+ /* copy_curve() sets disp.first null, so currently not need */
+ {
+ Curve *cu;
+ cu = (Curve *)tmpobj->data;
+ if( cu->disp.first )
+ MEM_freeN( cu->disp.first );
+ cu->disp.first = NULL;
+ }
- /* TODO: other types */
- if(ob->type != OB_MESH)
- return NULL;
+#endif
+
+ /* get updated display list, and convert to a mesh */
+ makeDispListCurveTypes( sce, tmpobj, 0 );
+ nurbs_to_mesh( tmpobj );
+
+ /* nurbs_to_mesh changes the type to a mesh, check it worked */
+ if (tmpobj->type != OB_MESH) {
+ free_libblock_us( &(CTX_data_main(C)->object), tmpobj );
+ BKE_report(reports, RPT_ERROR, "cant convert curve to mesh. Does the curve have any segments?");
+ return NULL;
+ }
+ tmpmesh = tmpobj->data;
+ free_libblock_us( &G.main->object, tmpobj );
+ break;
+
+ case OB_MBALL:
+ /* metaballs don't have modifiers, so just convert to mesh */
+ ob = find_basis_mball( sce, ob );
+ /* todo, re-generatre for render-res */
+ /* metaball_polygonize(scene, ob) */
+
+ tmpmesh = add_mesh("Mesh");
+ mball_to_mesh( &ob->disp, tmpmesh );
+ break;
+
+ case OB_MESH:
+ /* copies object and modifiers (but not the data) */
+ if (cage) {
+ /* copies the data */
+ tmpmesh = copy_mesh( ob->data );
+ /* if not getting the original caged mesh, get final derived mesh */
+ } else {
+ /* Make a dummy mesh, saves copying */
+ DerivedMesh *dm;
+ /* CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; */
+ CustomDataMask mask = CD_MASK_MESH; /* this seems more suitable, exporter,
+ for example, needs CD_MASK_MDEFORMVERT */
+
+ /* Write the display mesh into the dummy mesh */
+ if (render)
+ dm = mesh_create_derived_render( sce, ob, mask );
+ else
+ dm = mesh_create_derived_view( sce, ob, mask );
+
+ tmpmesh = add_mesh( "Mesh" );
+ DM_to_mesh( dm, tmpmesh );
+ dm->release( dm );
+ }
+
+ break;
+ default:
+ BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
+ return NULL;
+ }
+
+ /* Copy materials to new mesh */
+ switch (ob->type) {
+ case OB_SURF:
+ tmpmesh->totcol = tmpcu->totcol;
+
+ /* free old material list (if it exists) and adjust user counts */
+ if( tmpcu->mat ) {
+ for( i = tmpcu->totcol; i-- > 0; ) {
+ /* are we an object material or data based? */
+ if (ob->colbits & 1<<i)
+ tmpmesh->mat[i] = ob->mat[i];
+ else
+ tmpmesh->mat[i] = tmpcu->mat[i];
+
+ if (tmpmesh->mat[i])
+ tmpmesh->mat[i]->id.us++;
+ }
+ }
+ break;
+
+#if 0
+ /* Crashes when assigning the new material, not sure why */
+ case OB_MBALL:
+ tmpmb = (MetaBall *)ob->data;
+ tmpmesh->totcol = tmpmb->totcol;
+
+ /* free old material list (if it exists) and adjust user counts */
+ if( tmpmb->mat ) {
+ for( i = tmpmb->totcol; i-- > 0; ) {
+ tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */
+ if (tmpmesh->mat[i]) {
+ tmpmb->mat[i]->id.us++;
+ }
+ }
+ }
+ break;
+#endif
+
+ case OB_MESH:
+ if (!cage) {
+ Mesh *origmesh= ob->data;
+ tmpmesh->flag= origmesh->flag;
+ tmpmesh->mat = MEM_dupallocN(origmesh->mat);
+ tmpmesh->totcol = origmesh->totcol;
+ tmpmesh->smoothresh= origmesh->smoothresh;
+ if( origmesh->mat ) {
+ for( i = origmesh->totcol; i-- > 0; ) {
+ /* are we an object material or data based? */
+ if (ob->colbits & 1<<i)
+ tmpmesh->mat[i] = ob->mat[i];
+ else
+ tmpmesh->mat[i] = origmesh->mat[i];
+ if (tmpmesh->mat[i])
+ tmpmesh->mat[i]->id.us++;
+ }
+ }
+ }
+ break;
+ } /* end copy materials */
+
+ /* we don't assign it to anything */
+ tmpmesh->id.us--;
- dm= mesh_create_derived_render(scene, ob, mask);
+ /* make sure materials get updated in objects */
+ test_object_materials( ( ID * ) tmpmesh );
+
+ return tmpmesh;
+}
+
+/* When no longer needed, duplilist should be freed with Object.free_duplilist */
+static void rna_Object_create_duplilist(Object *ob, bContext *C, ReportList *reports)
+{
+ if (!(ob->transflag & OB_DUPLI)) {
+ BKE_report(reports, RPT_ERROR, "Object does not have duplis.");
+ return;
+ }
+
+ /* free duplilist if a user forgets to */
+ if (ob->duplilist) {
+ BKE_reportf(reports, RPT_WARNING, "Object.dupli_list has not been freed.");
+
+ free_object_duplilist(ob->duplilist);
+ ob->duplilist= NULL;
+ }
+
+ ob->duplilist= object_duplilist(CTX_data_scene(C), ob);
- if(!dm)
- return NULL;
+ /* ob->duplilist should now be freed with Object.free_duplilist */
+}
+
+static void rna_Object_free_duplilist(Object *ob, ReportList *reports)
+{
+ if (ob->duplilist) {
+ free_object_duplilist(ob->duplilist);
+ ob->duplilist= NULL;
+ }
+}
+
+static bDeformGroup *rna_Object_add_vertex_group(Object *ob, char *group_name)
+{
+ return ED_vgroup_add_name(ob, group_name);
+}
+
+static void rna_Object_add_vertex_to_group(Object *ob, int vertex_index, bDeformGroup *def, float weight, int assignmode)
+{
+ /* creates dverts if needed */
+ ED_vgroup_vert_add(ob, def, vertex_index, weight, assignmode);
+}
- me= add_mesh("tmp_render_mesh");
- me->id.us--; /* we don't assign it to anything */
- DM_to_mesh(dm, me);
- dm->release(dm);
+/* copied from old API Object.makeDisplayList (Object.c) */
+static void rna_Object_make_display_list(Object *ob, bContext *C)
+{
+ Scene *sce= CTX_data_scene(C);
+ if (ob->type == OB_FONT) {
+ Curve *cu = ob->data;
+ freedisplist(&cu->disp);
+ BKE_text_to_curve(sce, ob, CU_LEFT);
+ }
- { /* update the material */
- short i, *totcol =give_totcolp(ob);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+}
- /* free the current material list */
- if(me->mat)
- MEM_freeN((void *)me->mat);
+static Object *rna_Object_find_armature(Object *ob)
+{
+ Object *ob_arm = NULL;
- me->mat= (Material **)MEM_callocN(sizeof(void *)*(*totcol), "matarray");
+ if (ob->type != OB_MESH) return NULL;
- for(i=0; i<*totcol; i++) {
- Material *mat= give_current_material(ob, i+1);
- if(mat) {
- me->mat[i]= mat;
- mat->id.us++;
+ if (ob->parent && ob->partype == PARSKEL && ob->parent->type == OB_ARMATURE) {
+ ob_arm = ob->parent;
+ }
+ else {
+ ModifierData *mod = (ModifierData*)ob->modifiers.first;
+ while (mod) {
+ if (mod->type == eModifierType_Armature) {
+ ob_arm = ((ArmatureModifierData*)mod)->object;
}
+
+ mod = mod->next;
}
}
- return me;
+ return ob_arm;
}
+int rna_Object_is_visible(Object *ob, bContext *C)
+{
+ return ob->lay & CTX_data_scene(C)->lay;
+}
+
+/*
+static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int *indices, int totindex, float weight, int assignmode)
+{
+ if (ob->type != OB_MESH) {
+ BKE_report(reports, RPT_ERROR, "Object should be of MESH type.");
+ return;
+ }
+
+ Mesh *me = (Mesh*)ob->data;
+ int group_index = get_defgroup_num(ob, group);
+ if (group_index == -1) {
+ BKE_report(reports, RPT_ERROR, "No deform groups assigned to mesh.");
+ return;
+ }
+
+ if (assignmode != WEIGHT_REPLACE && assignmode != WEIGHT_ADD && assignmode != WEIGHT_SUBTRACT) {
+ BKE_report(reports, RPT_ERROR, "Bad assignment mode." );
+ return;
+ }
+
+ // makes a set of dVerts corresponding to the mVerts
+ if (!me->dvert)
+ create_dverts(&me->id);
+
+ // loop list adding verts to group
+ for (i= 0; i < totindex; i++) {
+ if(i < 0 || i >= me->totvert) {
+ BKE_report(reports, RPT_ERROR, "Bad vertex index in list.");
+ return;
+ }
+
+ add_vert_defnr(ob, group_index, i, weight, assignmode);
+ }
+}
+*/
+
#else
void RNA_api_object(StructRNA *srna)
{
FunctionRNA *func;
- PropertyRNA *prop;
-
- func= RNA_def_function(srna, "create_render_mesh", "rna_Object_create_render_mesh");
- RNA_def_function_ui_description(func, "Create a Mesh datablock with all modifiers applied.");
- prop= RNA_def_pointer(func, "scene", "Scene", "", "");
- RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export.");
- RNA_def_function_return(func, prop);
+ PropertyRNA *parm;
+
+ static EnumPropertyItem mesh_type_items[] = {
+ {0, "PREVIEW", 0, "Preview", "Apply modifier preview settings."},
+ {1, "RENDER", 0, "Render", "Apply modifier render settings."},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ static EnumPropertyItem assign_mode_items[] = {
+ {WEIGHT_REPLACE, "REPLACE", 0, "Replace", "Replace."}, /* TODO: more meaningful descriptions */
+ {WEIGHT_ADD, "ADD", 0, "Add", "Add."},
+ {WEIGHT_SUBTRACT, "SUBTRACT", 0, "Subtract", "Subtract."},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ /* mesh */
+ func= RNA_def_function(srna, "create_mesh", "rna_Object_create_mesh");
+ RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied.");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
+ parm= RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export.");
+ RNA_def_function_return(func, parm);
+
+ /* duplis */
+ func= RNA_def_function(srna, "create_dupli_list", "rna_Object_create_duplilist");
+ RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to be freed manually with free_dupli_list.");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
+
+ func= RNA_def_function(srna, "free_dupli_list", "rna_Object_free_duplilist");
+ RNA_def_function_ui_description(func, "Free the list of dupli objects.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+
+ /* vertex groups */
+ func= RNA_def_function(srna, "add_vertex_group", "rna_Object_add_vertex_group");
+ RNA_def_function_ui_description(func, "Add vertex group to object.");
+ parm= RNA_def_string(func, "name", "Group", 0, "", "Vertex group name."); /* optional */
+ parm= RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "add_vertex_to_group", "rna_Object_add_vertex_to_group");
+ RNA_def_function_ui_description(func, "Add vertex to a vertex group.");
+ parm= RNA_def_int(func, "vertex_index", 0, 0, 0, "", "Vertex index.", 0, 0);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to add vertex to.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight.", 0.0f, 1.0f);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ /* Armature */
+ func= RNA_def_function(srna, "find_armature", "rna_Object_find_armature");
+ RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier.");
+ parm= RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL.");
+ RNA_def_function_return(func, parm);
+
+ /* DAG */
+ func= RNA_def_function(srna, "make_display_list", "rna_Object_make_display_list");
+ RNA_def_function_ui_description(func, "Update object's display data."); /* XXX describe better */
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+
+ /* View */
+ func= RNA_def_function(srna, "is_visible", "rna_Object_is_visible");
+ RNA_def_function_ui_description(func, "Determine if object is visible in active scene.");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ parm= RNA_def_boolean(func, "is_visible", 0, "", "Object visibility.");
+ RNA_def_function_return(func, parm);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 3dfbfcccacf..652a80a24eb 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -31,11 +31,40 @@
#include "DNA_object_types.h"
#include "DNA_object_force.h"
+#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "WM_api.h"
#include "WM_types.h"
+EnumPropertyItem effector_shape_items[] = {
+ {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""},
+ {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""},
+ {PFIELD_SHAPE_SURFACE, "SURFACE", 0, "Surface", ""},
+ {PFIELD_SHAPE_POINTS, "POINTS", 0, "Every Point", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+EnumPropertyItem empty_shape_items[] = {
+ {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""},
+ {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+EnumPropertyItem vortex_shape_items[] = {
+ {PFIELD_SHAPE_POINT, "POINT", 0, "Old", ""},
+ {PFIELD_SHAPE_PLANE, "PLANE", 0, "New", ""},
+ {PFIELD_SHAPE_SURFACE, "SURFACE", 0, "Surface falloff (New)", ""},
+ {PFIELD_SHAPE_POINTS, "POINTS", 0, "Every Point (New)", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+EnumPropertyItem empty_vortex_shape_items[] = {
+ {PFIELD_SHAPE_POINT, "POINT", 0, "Old", ""},
+ {PFIELD_SHAPE_PLANE, "PLANE", 0, "New", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
@@ -358,65 +387,115 @@ static void rna_SoftBodySettings_goal_vgroup_set(PointerRNA *ptr, const char *va
rna_object_vgroup_name_index_set(ptr, value, &sb->vertgroup);
}
+static int particle_field_check(PointerRNA *ptr)
+{
+ ID *id= ptr->id.data;
+
+ return (GS(id->name) == ID_PA);
+}
static void rna_FieldSettings_update(bContext *C, PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ if(particle_field_check(ptr)) {
+ ParticleSettings *part = (ParticleSettings*)ptr->id.data;
+
+ if(part->pd->forcefield != PFIELD_TEXTURE && part->pd->tex) {
+ part->pd->tex->id.us--;
+ part->pd->tex= 0;
+ }
+
+ if(part->pd2->forcefield != PFIELD_TEXTURE && part->pd2->tex) {
+ part->pd2->tex->id.us--;
+ part->pd2->tex= 0;
+ }
+
+ DAG_id_flush_update(&part->id, OB_RECALC|PSYS_RECALC_RESET);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL);
- if(ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) {
- ob->pd->tex->id.us--;
- ob->pd->tex= 0;
}
+ else {
+ Object *ob = (Object*)ptr->id.data;
- DAG_id_flush_update(&ob->id, OB_RECALC_OB);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ if(ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) {
+ ob->pd->tex->id.us--;
+ ob->pd->tex= 0;
+ }
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_OB);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ }
}
-static void rna_FieldSettings_surface_update(bContext *C, PointerRNA *ptr)
+static void rna_FieldSettings_shape_update(bContext *C, PointerRNA *ptr)
{
Scene *scene= CTX_data_scene(C);
- Object *ob= (Object*)ptr->id.data;
- PartDeflect *pd= ob->pd;
- ModifierData *md= modifiers_findByType(ob, eModifierType_Surface);
- /* add/remove modifier as needed */
- if(!md) {
- if(pd && (pd->flag & PFIELD_SURFACE))
- if(ELEM6(pd->forcefield,PFIELD_HARMONIC,PFIELD_FORCE,PFIELD_HARMONIC,PFIELD_CHARGE,PFIELD_LENNARDJ,PFIELD_BOID))
+ if(!particle_field_check(ptr)) {
+ Object *ob= (Object*)ptr->id.data;
+ PartDeflect *pd= ob->pd;
+ ModifierData *md= modifiers_findByType(ob, eModifierType_Surface);
+
+ /* add/remove modifier as needed */
+ if(!md) {
+ if(pd && (pd->shape == PFIELD_SHAPE_SURFACE) && ELEM(pd->forcefield,PFIELD_GUIDE,PFIELD_TEXTURE)==0)
if(ELEM4(ob->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE))
ED_object_modifier_add(NULL, scene, ob, eModifierType_Surface);
- }
- else {
- if(!pd || !(pd->flag & PFIELD_SURFACE))
- ED_object_modifier_remove(NULL, scene, ob, md);
- }
+ }
+ else {
+ if(!pd || pd->shape != PFIELD_SHAPE_SURFACE)
+ ED_object_modifier_remove(NULL, scene, ob, md);
+ }
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ }
}
static void rna_FieldSettings_dependency_update(bContext *C, PointerRNA *ptr)
{
Scene *scene= CTX_data_scene(C);
- Object *ob= (Object*)ptr->id.data;
- /* do this before scene sort, that one checks for CU_PATH */
- /* XXX if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE) {
- Curve *cu= ob->data;
- cu->flag |= (CU_PATH|CU_3D);
- do_curvebuts(B_CU3D); // all curves too
- }*/
+ if(particle_field_check(ptr)) {
+ DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC|PSYS_RECALC_RESET);
+ }
+ else {
+ Object *ob= (Object*)ptr->id.data;
+
+ /* do this before scene sort, that one checks for CU_PATH */
+ /* XXX if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE) {
+ Curve *cu= ob->data;
+ cu->flag |= (CU_PATH|CU_3D);
+ do_curvebuts(B_CU3D); // all curves too
+ }*/
- rna_FieldSettings_surface_update(C, ptr);
+ rna_FieldSettings_shape_update(C, ptr);
- DAG_scene_sort(scene);
+ DAG_scene_sort(scene);
- if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE)
- DAG_id_flush_update(&ob->id, OB_RECALC);
- else
- DAG_id_flush_update(&ob->id, OB_RECALC_OB);
+ if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE)
+ DAG_id_flush_update(&ob->id, OB_RECALC);
+ else
+ DAG_id_flush_update(&ob->id, OB_RECALC_OB);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ }
+}
+
+static void rna_EffectorWeight_update(bContext *C, PointerRNA *ptr)
+{
+ DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL);
}
+static void rna_EffectorWeight_dependency_update(bContext *C, PointerRNA *ptr)
+{
+ Scene *scene= CTX_data_scene(C);
+
+ DAG_scene_sort(scene);
+
+ DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL);
+}
static void rna_CollisionSettings_dependency_update(bContext *C, PointerRNA *ptr)
{
Scene *scene= CTX_data_scene(C);
@@ -448,6 +527,47 @@ static void rna_softbody_update(bContext *C, PointerRNA *ptr)
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
}
+
+static EnumPropertyItem *rna_Effector_shape_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ Object *ob= NULL;
+
+ if(C==NULL) {
+ EnumPropertyItem *item= NULL;
+ int totitem= 0;
+
+ /* needed for doc generation */
+ RNA_enum_items_add(&item, &totitem, effector_shape_items);
+ RNA_enum_items_add(&item, &totitem, empty_shape_items);
+ RNA_enum_items_add(&item, &totitem, vortex_shape_items);
+ RNA_enum_items_add(&item, &totitem, empty_shape_items);
+ RNA_enum_item_end(&item, &totitem);
+
+ *free= 1;
+
+ return item;
+ }
+
+ if(particle_field_check(ptr))
+ return empty_shape_items;
+
+ ob= (Object*)ptr->id.data;
+
+ if(ELEM4(ob->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE)) {
+ if(ob->pd->forcefield == PFIELD_VORTEX)
+ return vortex_shape_items;
+
+ return effector_shape_items;
+ }
+ else {
+ if(ob->pd->forcefield == PFIELD_VORTEX)
+ return empty_vortex_shape_items;
+
+ return empty_shape_items;
+ }
+}
+
+
#else
static void rna_def_pointcache(BlenderRNA *brna)
@@ -617,6 +737,135 @@ static void rna_def_collision(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Collision from Stack", "Pick collision object from modifier stack (softbody only)");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
*/
+
+ prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
+ RNA_def_property_ui_text(prop, "Absorption", "How much of effector force gets lost during collision with this object (in percent).");
+ RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
+}
+
+static void rna_def_effector_weight(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "EffectorWeights", NULL);
+ RNA_def_struct_ui_text(srna, "Effector Weights", "Effector weights for physics simulation.");
+ RNA_def_struct_ui_icon(srna, ICON_PHYSICS);
+
+ /* Flags */
+ prop= RNA_def_property(srna, "do_growing_hair", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", EFF_WEIGHT_DO_HAIR);
+ RNA_def_property_ui_text(prop, "Use For Growing Hair", "Use force fields when growing hair.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ /* General */
+ prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "group");
+ RNA_def_property_struct_type(prop, "Group");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this Group.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_dependency_update");
+
+ prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "global_gravity");
+ 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, "Gravity", "Global gravity weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ /* Effector weights */
+ prop= RNA_def_property(srna, "all", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[0]");
+ 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, "All", "All effector's weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "spherical", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[1]");
+ 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, "Spherical", "Spherical effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "vortex", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[2]");
+ 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, "Vortex", "Vortex effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "magnetic", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[3]");
+ 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, "Magnetic", "Magnetic effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "wind", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[4]");
+ 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, "Wind", "Wind effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "curveguide", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[5]");
+ 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, "Curve Guide", "Curve guide effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "texture", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[6]");
+ 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, "Texture", "Texture effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "harmonic", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[7]");
+ 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, "Harmonic", "Harmonic effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "charge", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[8]");
+ 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, "Charge", "Charge effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "lennardjones", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[9]");
+ 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, "Lennard-Jones", "Lennard-Jones effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "boid", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[10]");
+ 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, "Boid", "Boid effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[11]");
+ 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, "Turbulence", "Turbulence effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "drag", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[12]");
+ 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, "Drag", "Drag effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
}
static void rna_def_field(BlenderRNA *brna)
@@ -626,18 +875,20 @@ static void rna_def_field(BlenderRNA *brna)
static EnumPropertyItem field_type_items[] = {
{0, "NONE", 0, "None", ""},
- {PFIELD_FORCE, "SPHERICAL", 0, "Spherical", ""},
+ {PFIELD_FORCE, "FORCE", 0, "Force", ""},
+ {PFIELD_WIND, "WIND", 0, "Wind", ""},
{PFIELD_VORTEX, "VORTEX", 0, "Vortex", ""},
{PFIELD_MAGNET, "MAGNET", 0, "Magnetic", ""},
- {PFIELD_WIND, "WIND", 0, "Wind", ""},
- {PFIELD_GUIDE, "GUIDE", 0, "Curve Guide", ""},
- {PFIELD_TEXTURE, "TEXTURE", 0, "Texture", ""},
{PFIELD_HARMONIC, "HARMONIC", 0, "Harmonic", ""},
{PFIELD_CHARGE, "CHARGE", 0, "Charge", ""},
{PFIELD_LENNARDJ, "LENNARDJ", 0, "Lennard-Jones", ""},
+ {PFIELD_TEXTURE, "TEXTURE", 0, "Texture", ""},
+ {PFIELD_GUIDE, "GUIDE", 0, "Curve Guide", ""},
{PFIELD_BOID, "BOID", 0, "Boid", ""},
+ {PFIELD_TURBULENCE, "TURBULENCE", 0, "Turbulence", ""},
+ {PFIELD_DRAG, "DRAG", 0, "Drag", ""},
{0, NULL, 0, NULL, NULL}};
-
+
static EnumPropertyItem falloff_items[] = {
{PFIELD_FALL_SPHERE, "SPHERE", 0, "Sphere", ""},
{PFIELD_FALL_TUBE, "TUBE", 0, "Tube", ""},
@@ -650,6 +901,12 @@ static void rna_def_field(BlenderRNA *brna)
{PFIELD_TEX_CURL, "CURL", 0, "Curl", ""},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem zdirection_items[] = {
+ {PFIELD_Z_BOTH, "BOTH", 0, "Both Z", ""},
+ {PFIELD_Z_POS, "POSITIVE", 0, "+Z", ""},
+ {PFIELD_Z_NEG, "NEGATIVE", 0, "-Z", ""},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "FieldSettings", NULL);
RNA_def_struct_sdna(srna, "PartDeflect");
RNA_def_struct_ui_text(srna, "Field Settings", "Field settings for an object in physics simulation.");
@@ -662,6 +919,12 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_enum_items(prop, field_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of field.");
RNA_def_property_update(prop, 0, "rna_FieldSettings_dependency_update");
+
+ prop= RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, effector_shape_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Effector_shape_itemf");
+ RNA_def_property_ui_text(prop, "Shape", "Which direction is used to calculate the effector force.");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_shape_update");
prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "falloff");
@@ -674,6 +937,12 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_enum_items(prop, texture_items);
RNA_def_property_ui_text(prop, "Texture Mode", "How the texture effect is calculated (RGB & Curl need a RGB texture else Gradient will be used instead)");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "z_direction", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "zdir");
+ RNA_def_property_enum_items(prop, zdirection_items);
+ RNA_def_property_ui_text(prop, "Z Direction", "Effect in full or only positive/negative Z direction.");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* Float */
@@ -682,18 +951,51 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Strength", "Strength of force field");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
- prop= RNA_def_property(srna, "falloff_power", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "f_power");
- RNA_def_property_range(prop, 0.0f, 10.0f);
- RNA_def_property_ui_text(prop, "Falloff Power", "Falloff power (real gravitational falloff = 2)");
+
+ /* different ui range to above */
+ prop= RNA_def_property(srna, "linear_drag", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_strength");
+ RNA_def_property_range(prop, -2.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Linear Drag", "Drag component proportional to velocity.");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
+
prop= RNA_def_property(srna, "harmonic_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_damp");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Harmonic Damping", "Damping of the harmonic force");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ /* different ui range to above */
+ prop= RNA_def_property(srna, "quadratic_drag", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_damp");
+ RNA_def_property_range(prop, -2.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Quadratic Drag", "Drag component proportional to the square of velocity.");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "flow", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_flow");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Flow", "Convert effector force into air flow velocity");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ /* different ui range to above */
+ prop= RNA_def_property(srna, "inflow", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_flow");
+ RNA_def_property_range(prop, -10.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Inflow", "Inwards component of the vortex force");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_size");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Size", "Size of the noise");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "falloff_power", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_power");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Falloff Power", "Falloff power (real gravitational falloff = 2)");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
prop= RNA_def_property(srna, "minimum_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mindist");
@@ -770,26 +1072,16 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GUIDE_PATH_ADD);
RNA_def_property_ui_text(prop, "Additive", "Based on distance/falloff it adds a portion of the entire path");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
- prop= RNA_def_property(srna, "planar", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_PLANAR);
- RNA_def_property_ui_text(prop, "Planar", "Create planar field");
- RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
- prop= RNA_def_property(srna, "surface", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_SURFACE);
- RNA_def_property_ui_text(prop, "Surface", "Use closest point on surface");
- RNA_def_property_update(prop, 0, "rna_FieldSettings_surface_update");
-
- prop= RNA_def_property(srna, "positive_z", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_POSZ);
- RNA_def_property_ui_text(prop, "Positive", "Effect only in direction of positive Z axis");
- RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
+
prop= RNA_def_property(srna, "use_coordinates", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_OBJECT);
RNA_def_property_ui_text(prop, "Use Coordinates", "Use object/global coordinates for texture");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "global_coordinates", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GLOBAL_CO);
+ RNA_def_property_ui_text(prop, "Use Global Coordinates", "Use effector/global coordinates for turbulence");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
prop= RNA_def_property(srna, "force_2d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_2D);
@@ -800,6 +1092,16 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_ROOTCO);
RNA_def_property_ui_text(prop, "Root Texture Coordinates", "Texture coordinates from root particle locations");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "do_location", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_DO_LOCATION);
+ RNA_def_property_ui_text(prop, "Location", "Effect particles' location");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "do_rotation", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_DO_ROTATION);
+ RNA_def_property_ui_text(prop, "Rotation", "Effect particles' dynamic rotation");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* Pointer */
@@ -1109,12 +1411,18 @@ static void rna_def_softbody(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set");
RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision.");
RNA_def_property_update(prop, 0, "rna_softbody_update");
+
+ 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", "");
}
void RNA_def_object_force(BlenderRNA *brna)
{
rna_def_pointcache(brna);
rna_def_collision(brna);
+ rna_def_effector_weight(brna);
rna_def_field(brna);
rna_def_game_softbody(brna);
rna_def_softbody(brna);
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index e6f0a462f03..453b5f9f91a 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -99,6 +99,7 @@ EnumPropertyItem part_hair_ren_as_items[] = {
#include "BKE_context.h"
#include "BKE_cloth.h"
#include "BKE_depsgraph.h"
+#include "BKE_effect.h"
#include "BKE_modifier.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
@@ -106,48 +107,43 @@ EnumPropertyItem part_hair_ren_as_items[] = {
#include "BLI_arithb.h"
/* property update functions */
-static void rna_Particle_redo(bContext *C, PointerRNA *ptr)
+static void particle_recalc(bContext *C, PointerRNA *ptr, short flag)
{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
if(ptr->type==&RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
- psys->recalc = PSYS_RECALC_REDO;
+ psys->recalc = flag;
- if(ob)
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- else {
- part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_REDO);
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
}
+ else
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|flag);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
}
+static void rna_Particle_redo(bContext *C, PointerRNA *ptr)
+{
+ particle_recalc(C, ptr, PSYS_RECALC_REDO);
+}
static void rna_Particle_reset(bContext *C, PointerRNA *ptr)
{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
+ particle_recalc(C, ptr, PSYS_RECALC_RESET);
+}
- if(ptr->type==&RNA_ParticleSystem) {
- ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
-
- psys->recalc = PSYS_RECALC_RESET;
+static void rna_Particle_change_type(bContext *C, PointerRNA *ptr)
+{
+ particle_recalc(C, ptr, PSYS_RECALC_RESET|PSYS_RECALC_TYPE);
+}
- if(ob) {
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- }
- else {
- part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET);
- }
+static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr)
+{
+ particle_recalc(C, ptr, PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
+}
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
+static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr)
+{
+ particle_recalc(C, ptr, PSYS_RECALC_CHILD);
}
static void rna_Particle_target_reset(bContext *C, PointerRNA *ptr)
@@ -199,62 +195,9 @@ static void rna_Particle_target_redo(bContext *C, PointerRNA *ptr)
}
}
-static void rna_Particle_change_type(bContext *C, PointerRNA *ptr)
-{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
-
- if(ptr->type==&RNA_ParticleSystem) {
- ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
-
- psys->recalc = PSYS_RECALC_RESET|PSYS_RECALC_TYPE;
-
- if(ob) {
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- }
- else {
- part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_TYPE);
- }
-
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
-}
-
-static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr)
-{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
-}
-
-static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr)
-{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
-
- if(ptr->type==&RNA_ParticleSystem) {
- ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
-
- psys->recalc = PSYS_RECALC_CHILD;
-
- if(ob)
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- else {
- part = ptr->id.data;
-
- psys_flush_particle_settings(scene, part, PSYS_RECALC_CHILD);
- }
-
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
-}
static void rna_Particle_hair_dynamics(bContext *C, PointerRNA *ptr)
{
- Scene *scene = CTX_data_scene(C);
+ /* Scene *scene = CTX_data_scene(C); */
ParticleSystem *psys = (ParticleSystem*)ptr->data;
if(psys && !psys->clmd) {
@@ -312,9 +255,10 @@ static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value)
if(value > settings->end)
value = settings->end;
- if(settings->type==PART_REACTOR && value < 1.0)
- value = 1.0;
- else if (value < MINAFRAMEF)
+ //if(settings->type==PART_REACTOR && value < 1.0)
+ // value = 1.0;
+ //else
+ if (value < MINAFRAMEF)
value = MINAFRAMEF;
settings->sta = value;
@@ -506,7 +450,7 @@ EnumPropertyItem reactor_from_items[] = {
static EnumPropertyItem *rna_Particle_from_itemf(bContext *C, PointerRNA *ptr, int *free)
{
- ParticleSettings *part = ptr->id.data;
+ /* ParticleSettings *part = ptr->id.data; */
if(C==NULL) {
EnumPropertyItem *item= NULL;
@@ -522,9 +466,9 @@ static EnumPropertyItem *rna_Particle_from_itemf(bContext *C, PointerRNA *ptr, i
return item;
}
- if(part->type==PART_REACTOR)
- return part_reactor_from_items;
- else
+ //if(part->type==PART_REACTOR)
+ // return part_reactor_from_items;
+ //else
return part_from_items;
}
@@ -576,6 +520,28 @@ static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *C, PointerRNA *ptr,
return part_ren_as_items;
}
+static PointerRNA rna_Particle_field1_get(PointerRNA *ptr)
+{
+ ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+
+ /* weak */
+ if(!part->pd)
+ part->pd= object_add_collision_fields(0);
+
+ return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd);
+}
+
+static PointerRNA rna_Particle_field2_get(PointerRNA *ptr)
+{
+ ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+
+ /* weak */
+ if(!part->pd2)
+ part->pd2= object_add_collision_fields(0);
+
+ return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd2);
+}
+
#else
@@ -649,7 +615,7 @@ static void rna_def_particle(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem alive_items[] = {
- {PARS_KILLED, "KILLED", 0, "Killed", ""},
+ //{PARS_KILLED, "KILLED", 0, "Killed", ""},
{PARS_DEAD, "DEAD", 0, "Dead", ""},
{PARS_UNBORN, "UNBORN", 0, "Unborn", ""},
{PARS_ALIVE, "ALIVE", 0, "Alive", ""},
@@ -767,7 +733,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
static EnumPropertyItem type_items[] = {
{PART_EMITTER, "EMITTER", 0, "Emitter", ""},
- {PART_REACTOR, "REACTOR", 0, "Reactor", ""},
+ //{PART_REACTOR, "REACTOR", 0, "Reactor", ""},
{PART_HAIR, "HAIR", 0, "Hair", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -986,10 +952,10 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Children", "Apply effectors to children.");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "child_seams", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_SEAMS);
- RNA_def_property_ui_text(prop, "Use seams", "Use seams to determine parents");
- RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
+ //prop= RNA_def_property(srna, "child_seams", PROP_BOOLEAN, PROP_NONE);
+ //RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_SEAMS);
+ //RNA_def_property_ui_text(prop, "Use seams", "Use seams to determine parents");
+ //RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
/* TODO: used somewhere? */
prop= RNA_def_property(srna, "child_render", PROP_BOOLEAN, PROP_NONE);
@@ -1713,89 +1679,25 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- /* effectors */
- prop= RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
- RNA_def_property_struct_type(prop, "Group");
- RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this Group.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_all", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[0]");
- 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, "All", "All effector's weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_spherical", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[1]");
- 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, "Spherical", "Spherical effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_vortex", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[2]");
- 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, "Vortex", "Vortex effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_magnetic", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[3]");
- 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, "Magnetic", "Magnetic effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_wind", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[4]");
- 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, "Wind", "Wind effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_curveguide", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[5]");
- 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, "Curve Guide", "Curve guide effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_texture", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[6]");
- 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, "Texture", "Texture effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_harmonic", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[7]");
- 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, "Harmonic", "Harmonic effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_charge", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[8]");
- 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, "Charge", "Charge effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_lennardjones", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[9]");
- 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, "Lennard-Jones", "Lennard-Jones effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
+ 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", "");
/* animation here? */
rna_def_animdata_common(srna);
-// struct PartDeflect *pd;
-// struct PartDeflect *pd2;
+ prop= RNA_def_property(srna, "force_field_1", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "pd");
+ RNA_def_property_struct_type(prop, "FieldSettings");
+ RNA_def_property_pointer_funcs(prop, "rna_Particle_field1_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Force Field 1", "");
+
+ prop= RNA_def_property(srna, "force_field_2", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "pd2");
+ RNA_def_property_struct_type(prop, "FieldSettings");
+ RNA_def_property_pointer_funcs(prop, "rna_Particle_field2_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Force Field 2", "");
}
static void rna_def_particle_target(BlenderRNA *brna)
@@ -1871,10 +1773,10 @@ static void rna_def_particle_system(BlenderRNA *brna)
/* access to particle settings is redirected through functions */
/* to allow proper id-buttons functionality */
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
//RNA_def_property_pointer_sdna(prop, NULL, "part");
RNA_def_property_struct_type(prop, "ParticleSettings");
- RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL);
RNA_def_property_ui_text(prop, "Settings", "Particle system settings.");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -1904,9 +1806,10 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Hair Dynamics", "Enable hair dynamics using cloth simulation.");
RNA_def_property_update(prop, 0, "rna_Particle_hair_dynamics");
- prop= RNA_def_property(srna, "cloth", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "cloth", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clmd");
RNA_def_property_struct_type(prop, "ClothModifier");
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Cloth", "Cloth dynamics for hair");
@@ -2082,7 +1985,8 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* pointcache */
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
+ 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_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache", "");
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 3a03e7a624d..03ced839ebe 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -23,6 +23,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include "RNA_define.h"
#include "RNA_types.h"
@@ -39,8 +40,9 @@
#ifdef RNA_RUNTIME
-#include <string.h>
-
+#include "BIK_api.h"
+#include "BKE_action.h"
+#include "BKE_armature.h"
#include "BLI_arithb.h"
#include "DNA_userdef_types.h"
@@ -49,8 +51,11 @@
#include "BKE_depsgraph.h"
#include "BKE_idprop.h"
+#include "ED_object.h"
#include "ED_armature.h"
+#include "MEM_guardedalloc.h"
+
static void rna_Pose_update(bContext *C, PointerRNA *ptr)
{
// XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
@@ -58,6 +63,15 @@ static void rna_Pose_update(bContext *C, PointerRNA *ptr)
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
}
+static void rna_Pose_IK_update(bContext *C, PointerRNA *ptr)
+{
+ // XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
+ Object *ob= ptr->id.data;
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+ BIK_clear_data(ob->pose);
+}
+
static char *rna_PoseChannel_path(PointerRNA *ptr)
{
return BLI_sprintfN("pose.pose_channels[\"%s\"]", ((bPoseChannel*)ptr->data)->name);
@@ -98,7 +112,7 @@ static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
}
}
-IDProperty *rna_PoseChannel_idproperties(PointerRNA *ptr, int create)
+static IDProperty *rna_PoseChannel_idproperties(PointerRNA *ptr, int create)
{
bPoseChannel *pchan= ptr->data;
@@ -110,106 +124,70 @@ IDProperty *rna_PoseChannel_idproperties(PointerRNA *ptr, int create)
return pchan->prop;
}
+static void rna_Pose_ik_solver_set(struct PointerRNA *ptr, int value)
+{
+ bPose *pose= (bPose*)ptr->data;
+
+ if (pose->iksolver != value) {
+ // the solver has changed, must clean any temporary structures
+ BIK_clear_data(pose);
+ if (pose->ikparam) {
+ MEM_freeN(pose->ikparam);
+ pose->ikparam = NULL;
+ }
+ pose->iksolver = value;
+ init_pose_ikparam(pose);
+ }
+}
+
+static void rna_Pose_ik_solver_update(bContext *C, PointerRNA *ptr)
+{
+ Object *ob= ptr->id.data;
+ bPose *pose = ptr->data;
+ Scene *scene = CTX_data_scene(C);
+
+ pose->flag |= POSE_RECALC; // checks & sorts pose channels
+ DAG_scene_sort(scene);
+
+ update_pose_constraint_flags(pose);
+
+ object_test_constraints(ob);
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
+}
+
/* rotation - euler angles */
-static void rna_PoseChannel_euler_rotation_get(PointerRNA *ptr, float *value)
+static void rna_PoseChannel_rotation_euler_get(PointerRNA *ptr, float *value)
{
bPoseChannel *pchan= ptr->data;
- if(pchan->rotmode == PCHAN_ROT_AXISANGLE) /* default XYZ eulers */
+ if(pchan->rotmode == ROT_MODE_AXISANGLE) /* default XYZ eulers */
AxisAngleToEulO(&pchan->quat[1], pchan->quat[0], value, EULER_ORDER_DEFAULT);
- else if(pchan->rotmode == PCHAN_ROT_QUAT) /* default XYZ eulers */
+ else if(pchan->rotmode == ROT_MODE_QUAT) /* default XYZ eulers */
QuatToEul(pchan->quat, value);
else
VECCOPY(value, pchan->eul);
}
/* rotation - euler angles */
-static void rna_PoseChannel_euler_rotation_set(PointerRNA *ptr, const float *value)
+static void rna_PoseChannel_rotation_euler_set(PointerRNA *ptr, const float *value)
{
bPoseChannel *pchan= ptr->data;
- if(pchan->rotmode == PCHAN_ROT_AXISANGLE) /* default XYZ eulers */
+ if(pchan->rotmode == ROT_MODE_AXISANGLE) /* default XYZ eulers */
EulOToAxisAngle((float *)value, EULER_ORDER_DEFAULT, &pchan->quat[1], &pchan->quat[0]);
- else if(pchan->rotmode == PCHAN_ROT_QUAT) /* default XYZ eulers */
+ else if(pchan->rotmode == ROT_MODE_QUAT) /* default XYZ eulers */
EulToQuat((float*)value, pchan->quat);
else
VECCOPY(pchan->eul, value);
}
-/* rotation - axis angle only */
-static void rna_PoseChannel_rotation_axis_get(PointerRNA *ptr, float *value)
-{
- bPoseChannel *pchan= ptr->data;
-
- if (pchan->rotmode == PCHAN_ROT_AXISANGLE) {
- /* axis is stord in quat for now */
- VecCopyf(value, &pchan->quat[1]);
- }
-}
-
-/* rotation - axis angle only */
-static void rna_PoseChannel_rotation_axis_set(PointerRNA *ptr, const float *value)
-{
- bPoseChannel *pchan= ptr->data;
-
- if (pchan->rotmode == PCHAN_ROT_AXISANGLE) {
- /* axis is stored in quat for now */
- VecCopyf(&pchan->quat[1], (float *)value);
- }
-}
-
static void rna_PoseChannel_rotation_mode_set(PointerRNA *ptr, int value)
{
bPoseChannel *pchan= ptr->data;
- /* check if any change - if so, need to convert data */
- // TODO: this needs to be generalised at some point to work for objects too...
- if (value > 0) { /* to euler */
- if (pchan->rotmode == PCHAN_ROT_AXISANGLE) {
- /* axis-angle to euler */
- AxisAngleToEulO(&pchan->quat[1], pchan->quat[0], pchan->eul, value);
- }
- else if (pchan->rotmode == PCHAN_ROT_QUAT) {
- /* quat to euler */
- QuatToEulO(pchan->quat, pchan->eul, value);
- }
- /* else { no conversion needed } */
- }
- else if (value == PCHAN_ROT_QUAT) { /* to quat */
- if (pchan->rotmode == PCHAN_ROT_AXISANGLE) {
- /* axis angle to quat */
- float q[4];
-
- /* copy to temp var first, since quats and axis-angle are stored in same place */
- QuatCopy(q, pchan->quat);
- AxisAngleToQuat(q, &pchan->quat[1], pchan->quat[0]);
- }
- else if (pchan->rotmode > 0) {
- /* euler to quat */
- EulOToQuat(pchan->eul, pchan->rotmode, pchan->quat);
- }
- /* else { no conversion needed } */
- }
- else { /* to axis-angle */
- if (pchan->rotmode > 0) {
- /* euler to axis angle */
- EulOToAxisAngle(pchan->eul, pchan->rotmode, &pchan->quat[1], &pchan->quat[0]);
- }
- else if (pchan->rotmode == PCHAN_ROT_QUAT) {
- /* quat to axis angle */
- float q[4];
-
- /* copy to temp var first, since quats and axis-angle are stored in same place */
- QuatCopy(q, pchan->quat);
- QuatToAxisAngle(q, &pchan->quat[1], &pchan->quat[0]);
- }
-
- /* when converting to axis-angle, we need a special exception for the case when there is no axis */
- if (IS_EQ(pchan->quat[1], pchan->quat[2]) && IS_EQ(pchan->quat[2], pchan->quat[3])) {
- /* for now, rotate around y-axis then (so that it simply becomes the roll) */
- pchan->quat[2]= 1.0f;
- }
- }
+ /* use API Method for conversions... */
+ BKE_rotMode_change_values(pchan->quat, pchan->eul, pchan->rotmode, (short)value);
/* finally, set the new rotation type */
pchan->rotmode= value;
@@ -236,6 +214,70 @@ static int rna_PoseChannel_has_ik_get(PointerRNA *ptr)
return ED_pose_channel_in_IK_chain(ob, pchan);
}
+StructRNA *rna_IKParam_refine(PointerRNA *ptr)
+{
+ bIKParam *param = (bIKParam *)ptr->data;
+
+ switch (param->iksolver) {
+ case IKSOLVER_ITASC:
+ return &RNA_Itasc;
+ default:
+ return &RNA_IKParam;
+ }
+}
+
+PointerRNA rna_Pose_ikparam_get(struct PointerRNA *ptr)
+{
+ bPose *pose= (bPose*)ptr->data;
+ return rna_pointer_inherit_refine(ptr, &RNA_IKParam, pose->ikparam);
+}
+
+static StructRNA *rna_Pose_ikparam_typef(PointerRNA *ptr)
+{
+ bPose *pose= (bPose*)ptr->data;
+
+ switch (pose->iksolver) {
+ case IKSOLVER_ITASC:
+ return &RNA_Itasc;
+ default:
+ return &RNA_IKParam;
+ }
+}
+
+static void rna_Itasc_update(bContext *C, PointerRNA *ptr)
+{
+ Object *ob = ptr->id.data;
+ bItasc *itasc = ptr->data;
+
+ /* verify values */
+ if (itasc->precision < 0.0001f)
+ itasc->precision = 0.0001f;
+ if (itasc->minstep < 0.001f)
+ itasc->minstep = 0.001f;
+ if (itasc->maxstep < itasc->minstep)
+ itasc->maxstep = itasc->minstep;
+ if (itasc->feedback < 0.01f)
+ itasc->feedback = 0.01f;
+ if (itasc->feedback > 100.f)
+ itasc->feedback = 100.f;
+ if (itasc->maxvel < 0.01f)
+ itasc->maxvel = 0.01f;
+ if (itasc->maxvel > 100.f)
+ itasc->maxvel = 100.f;
+ BIK_update_param(ob->pose);
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+}
+
+static void rna_Itasc_update_rebuild(bContext *C, PointerRNA *ptr)
+{
+ Object *ob= ptr->id.data;
+ bPose *pose = ob->pose;
+
+ pose->flag |= POSE_RECALC; // checks & sorts pose channels
+ rna_Itasc_update(C, ptr);
+}
+
static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@@ -323,7 +365,8 @@ static void rna_Pose_active_bone_group_index_range(PointerRNA *ptr, int *min, in
*max= MAX2(0, *max);
}
-void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int index)
+#if 0
+static void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int index)
{
bPose *pose= (bPose*)ptr->data;
bActionGroup *grp;
@@ -334,7 +377,7 @@ void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int index)
else BLI_strncpy(value, "", sizeof(grp->name)); // XXX if invalid pointer, won't this crash?
}
-int rna_pose_bgroup_name_index_length(PointerRNA *ptr, int index)
+static int rna_pose_bgroup_name_index_length(PointerRNA *ptr, int index)
{
bPose *pose= (bPose*)ptr->data;
bActionGroup *grp;
@@ -343,7 +386,7 @@ int rna_pose_bgroup_name_index_length(PointerRNA *ptr, int index)
return (grp)? strlen(grp->name): 0;
}
-void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
+static void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
{
bPose *pose= (bPose*)ptr->data;
bActionGroup *grp;
@@ -359,7 +402,7 @@ void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, short *i
*index= 0;
}
-void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
+static void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
{
bPose *pose= (bPose*)ptr->data;
bActionGroup *grp;
@@ -373,6 +416,7 @@ void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *result,
BLI_strncpy(result, "", maxlen);
}
+#endif
#else
@@ -428,24 +472,36 @@ static void rna_def_bone_group(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
// TODO: editing the colors for this should result in changes to the color type...
- prop= RNA_def_property(srna, "colors", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "colors", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
RNA_def_property_pointer_sdna(prop, NULL, "cs"); /* NOTE: the DNA data is not really a pointer, but this code works :) */
RNA_def_property_ui_text(prop, "Colors", "Copy of the colors associated with the group's color set.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
}
+static EnumPropertyItem prop_iksolver_items[] = {
+ {IKSOLVER_LEGACY, "LEGACY", 0, "Legacy", "Original IK solver."},
+ {IKSOLVER_ITASC, "ITASC", 0, "iTaSC", "Multi constraint, stateful IK solver."},
+ {0, NULL, 0, NULL, NULL}};
+
+static EnumPropertyItem prop_solver_items[] = {
+ {ITASC_SOLVER_SDLS, "SDLS", 0, "SDLS", "Selective Damped Least Square"},
+ {ITASC_SOLVER_DLS, "DLS", 0, "DLS", "Damped Least Square with Numerical Filtering"},
+ {0, NULL, 0, NULL, NULL}};
+
static void rna_def_pose_channel(BlenderRNA *brna)
{
+ // XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable
static EnumPropertyItem prop_rotmode_items[] = {
- {PCHAN_ROT_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"},
- {PCHAN_ROT_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector."},
+ {ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"},
+ {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector."},
{0, NULL, 0, NULL, NULL}};
StructRNA *srna;
@@ -467,7 +523,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_PoseChannel_name_set");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
-
+
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "selectflag", BONE_SELECTED);
RNA_def_property_ui_text(prop, "Selected", "");
@@ -477,16 +533,17 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "pathsf");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bone Paths Calculation Start Frame", "Starting frame of range of frames to use for Bone Path calculations.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
prop= RNA_def_property(srna, "path_end_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "pathef");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bone Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* Relationships to other bones */
- prop= RNA_def_property(srna, "bone", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "bone", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bone", "Bone associated with this Pose Channel.");
@@ -512,52 +569,53 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Scale", "");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
+ prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
- RNA_def_property_ui_text(prop, "Rotation", "Rotation in Quaternions.");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "rotation_angle", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "quat[0]");
- RNA_def_property_ui_text(prop, "Rotation Angle", "Angle of Rotation for Axis-Angle rotation representation.");
+ RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "rotation_axis", PROP_FLOAT, PROP_XYZ);
+ /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
+ * having a single one is better for Keyframing and other property-management situations...
+ */
+ prop= RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
RNA_def_property_float_sdna(prop, NULL, "quat");
- RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_get", "rna_PoseChannel_rotation_axis_set", NULL);
- RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Rotation Axis", "Axis for Axis-Angle rotation representation.");
+ // TODO: we may need some validation funcs
+ RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "euler_rotation", PROP_FLOAT, PROP_EULER);
+ prop= RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "eul");
- RNA_def_property_float_funcs(prop, "rna_PoseChannel_euler_rotation_get", "rna_PoseChannel_euler_rotation_set", NULL);
- RNA_def_property_ui_text(prop, "Rotation (Euler)", "Rotation in Eulers.");
+ RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_euler_get", "rna_PoseChannel_rotation_euler_set", NULL);
+ RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rotmode");
- RNA_def_property_enum_items(prop, prop_rotmode_items);
+ RNA_def_property_enum_items(prop, prop_rotmode_items); // XXX move to using a single define of this someday
RNA_def_property_enum_funcs(prop, NULL, "rna_PoseChannel_rotation_mode_set", NULL);
RNA_def_property_ui_text(prop, "Rotation Mode", "");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* These three matrix properties await an implementation of the PROP_MATRIX subtype, which currently doesn't exist. */
-/* prop= RNA_def_property(srna, "channel_matrix", PROP_FLOAT, PROP_MATRIX);
- RNA_def_property_struct_type(prop, "chan_mat");
+ prop= RNA_def_property(srna, "channel_matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "chan_mat");
+ RNA_def_property_array(prop, 16);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Channel Matrix", "4x4 matrix, before constraints.");*/
+ RNA_def_property_ui_text(prop, "Channel Matrix", "4x4 matrix, before constraints.");
/* kaito says this should be not user-editable; I disagree; power users should be able to force this in python; he's the boss. */
-/* prop= RNA_def_property(srna, "pose_matrix", PROP_FLOAT, PROP_MATRIX);
- RNA_def_property_struct_type(prop, "pose_mat");
+ prop= RNA_def_property(srna, "pose_matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "pose_mat");
+ RNA_def_property_array(prop, 16);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Pose Matrix", "Final 4x4 matrix for this channel.");
+ /*
prop= RNA_def_property(srna, "constraint_inverse_matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_struct_type(prop, "constinv");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Constraint Inverse Matrix", "4x4 matrix, defines transform from final position to unconstrained position."); */
+ RNA_def_property_ui_text(prop, "Constraint Inverse Matrix", "4x4 matrix, defines transform from final position to unconstrained position.");
+ */
/* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
prop= RNA_def_property(srna, "pose_head", PROP_FLOAT, PROP_TRANSLATION);
@@ -573,96 +631,118 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT);
RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT);
RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT);
RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
+
+ prop= RNA_def_property(srna, "ik_rot_control", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ROTCTL);
+ RNA_def_property_ui_text(prop, "IK rot control", "Apply channel rotation as IK constraint");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
+
+ prop= RNA_def_property(srna, "ik_lin_control", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_LINCTL);
+ RNA_def_property_ui_text(prop, "IK rot control", "Apply channel size as IK constraint if stretching is enabled");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[0]");
RNA_def_property_range(prop, -180.0f, 0.0f);
RNA_def_property_ui_text(prop, "IK X Minimum", "Minimum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[0]");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "IK X Maximum", "Maximum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[1]");
RNA_def_property_range(prop, -180.0f, 0.0f);
RNA_def_property_ui_text(prop, "IK Y Minimum", "Minimum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[1]");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "IK Y Maximum", "Maximum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[2]");
RNA_def_property_range(prop, -180.0f, 0.0f);
RNA_def_property_ui_text(prop, "IK Z Minimum", "Minimum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[2]");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "IK Z Maximum", "Maximum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_stiffness_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[0]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK X Stiffness", "IK stiffness around the X axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_stiffness_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[1]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK Y Stiffness", "IK stiffness around the Y axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_stiffness_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[2]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK Z Stiffness", "IK stiffness around the Z axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_stretch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ikstretch");
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
+
+ prop= RNA_def_property(srna, "ik_rot_weight", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ikrotweight");
+ RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_ui_text(prop, "IK Rot Weight", "Weight of rotation constraint for IK.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_lin_weight", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "iklinweight");
+ RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_ui_text(prop, "IK Lin Weight", "Weight of scale constraint for IK.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* custom bone shapes */
@@ -719,6 +799,113 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
}
+static void rna_def_pose_itasc(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Itasc", "IKParam");
+ RNA_def_struct_sdna(srna, "bItasc");
+ RNA_def_struct_ui_text(srna, "bItasc", "Parameters for the iTaSC IK solver.");
+
+ prop= RNA_def_property(srna, "precision", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "precision");
+ RNA_def_property_range(prop, 0.0f,0.1f);
+ RNA_def_property_ui_text(prop, "Precision", "Precision of convergence in case of reiteration.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "num_iter", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "numiter");
+ RNA_def_property_range(prop, 1.f,1000.f);
+ RNA_def_property_ui_text(prop, "Iterations", "Maximum number of iterations for convergence in case of reiteration.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "num_step", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "numstep");
+ RNA_def_property_range(prop, 1.f, 50.f);
+ RNA_def_property_ui_text(prop, "Num steps", "Divides the frame interval into this many steps.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "simulation", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ITASC_SIMULATION);
+ RNA_def_property_ui_text(prop, "Simulation", "Simulation mode: solver is statefull, runs in real-time context and ignores actions and non-IK constraints (i.e. solver is in full charge of the IK chain).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild");
+
+ prop= RNA_def_property(srna, "initial_reiteration", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ITASC_INITIAL_REITERATION);
+ RNA_def_property_ui_text(prop, "Initial Reiteration", "Allow reiteration for initial frame.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "reiteration", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ITASC_REITERATION);
+ RNA_def_property_ui_text(prop, "Reiteration", "Allow reiteration for all frames.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "auto_step", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ITASC_AUTO_STEP);
+ RNA_def_property_ui_text(prop, "Auto step", "Automatically determine the optimal number of steps for best performance/accurary trade off.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "min_step", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "minstep");
+ RNA_def_property_range(prop, 0.0f,0.1f);
+ RNA_def_property_ui_text(prop, "Min step", "Lower bound for timestep in second in case of automatic substeps.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "max_step", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "maxstep");
+ RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_ui_text(prop, "Max step", "Higher bound for timestep in second in case of automatic substeps.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "feedback", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "feedback");
+ RNA_def_property_range(prop, 0.0f,100.0f);
+ RNA_def_property_ui_text(prop, "Feedback", "Feedback coefficient for error correction. Average response time=1/feedback. Default=20.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "max_velocity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "maxvel");
+ RNA_def_property_range(prop, 0.0f,100.0f);
+ RNA_def_property_ui_text(prop, "Max Velocity", "Maximum joint velocity in rad/s. Default=50.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "solver");
+ RNA_def_property_enum_items(prop, prop_solver_items);
+ RNA_def_property_ui_text(prop, "Solver", "Solving method selection: Automatic damping or manual damping");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild");
+
+ prop= RNA_def_property(srna, "dampmax", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dampmax");
+ RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_ui_text(prop, "Damp", "Maximum damping coefficient when singular value is nearly 0. Higher values=more stability, less reactivity. Default=0.5");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "dampeps", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dampeps");
+ RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_ui_text(prop, "Epsilon", "Singular value under which damping is progressively applied. Higher values=more stability, less reactivity. Default=0.1");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+}
+
+static void rna_def_pose_ikparam(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "IKParam", NULL);
+ RNA_def_struct_sdna(srna, "bIKParam");
+ RNA_def_struct_ui_text(srna, "IKParam", "Base type for IK solver parameters.");
+ RNA_def_struct_refine_func(srna, "rna_IKParam_refine");
+
+ prop= RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "iksolver");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_enum_items(prop, prop_iksolver_items);
+ RNA_def_property_ui_text(prop, "IK Solver", "IK solver for which these parameters are defined, 0 for Legacy, 1 for iTaSC.");
+}
+
static void rna_def_pose(BlenderRNA *brna)
{
StructRNA *srna;
@@ -753,13 +940,29 @@ static void rna_def_pose(BlenderRNA *brna)
RNA_def_property_int_funcs(prop, "rna_Pose_active_bone_group_index_get", "rna_Pose_active_bone_group_index_set", "rna_Pose_active_bone_group_index_range");
RNA_def_property_ui_text(prop, "Active Bone Group Index", "Active index in bone groups array.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "iksolver");
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Pose_ik_solver_set", NULL);
+ RNA_def_property_enum_items(prop, prop_iksolver_items);
+ RNA_def_property_ui_text(prop, "IK Solver", "Selection of IK solver for IK chain, current choice is 0 for Legacy, 1 for iTaSC.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_ik_solver_update");
+
+ prop= RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "IKParam");
+ RNA_def_property_pointer_funcs(prop, "rna_Pose_ikparam_get", NULL, "rna_Pose_ikparam_typef");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "IK Param", "Parameters for IK solver.");
+
+ /* RNA_api_pose(srna); */
}
void RNA_def_pose(BlenderRNA *brna)
{
rna_def_pose(brna);
rna_def_pose_channel(brna);
-
+ rna_def_pose_ikparam(brna);
+ rna_def_pose_itasc(brna);
rna_def_bone_group(brna);
}
diff --git a/source/blender/makesrna/intern/rna_pose_api.c b/source/blender/makesrna/intern/rna_pose_api.c
new file mode 100644
index 00000000000..40bb131b3f9
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_pose_api.c
@@ -0,0 +1,56 @@
+/**
+ * $Id$
+ *
+ * ***** 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "DNA_object_types.h"
+
+/* #include "BLO_sys_types.h" */
+
+#ifdef RNA_RUNTIME
+
+/* #include "DNA_anim_types.h" */
+#include "DNA_action_types.h" /* bPose */
+
+#else
+
+void RNA_api_pose(StructRNA *srna)
+{
+ /* FunctionRNA *func; */
+ /* PropertyRNA *parm; */
+
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 8df6398f1f4..8dd751cd26a 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -458,6 +458,62 @@ static int rna_IntProperty_default_get(PointerRNA *ptr)
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->defaultvalue;
}
+/* int/float/bool */
+static int rna_NumberProperty_default_array_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+
+ length[0]= prop->totarraylength;
+
+ return length[0];
+}
+static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ IntPropertyRNA *nprop= (IntPropertyRNA*)prop;
+ rna_idproperty_check(&prop, ptr);
+
+ if(nprop->defaultarray) {
+ memcpy(values, nprop->defaultarray, prop->totarraylength * sizeof(int));
+ }
+ else {
+ int i;
+ for(i=0; i < prop->totarraylength; i++)
+ values[i]= nprop->defaultvalue;
+ }
+}
+static void rna_BoolProperty_default_array_get(PointerRNA *ptr, int *values)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ BooleanPropertyRNA *nprop= (BooleanPropertyRNA*)prop;
+ rna_idproperty_check(&prop, ptr);
+
+ if(nprop->defaultarray) {
+ memcpy(values, nprop->defaultarray, prop->totarraylength * sizeof(int));
+ }
+ else {
+ int i;
+ for(i=0; i < prop->totarraylength; i++)
+ values[i]= nprop->defaultvalue;
+ }
+}
+static void rna_FloatProperty_default_array_get(PointerRNA *ptr, float *values)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ FloatPropertyRNA *nprop= (FloatPropertyRNA*)prop;
+ rna_idproperty_check(&prop, ptr);
+
+ if(nprop->defaultarray) {
+ memcpy(values, nprop->defaultarray, prop->totarraylength * sizeof(float));
+ }
+ else {
+ int i;
+ for(i=0; i < prop->totarraylength; i++)
+ values[i]= nprop->defaultvalue;
+ }
+}
+
static int rna_IntProperty_hard_min_get(PointerRNA *ptr)
{
PropertyRNA *prop= (PropertyRNA*)ptr->data;
@@ -786,6 +842,7 @@ static void rna_def_property(BlenderRNA *brna)
{PROP_DIRPATH, "DIRECTORY_PATH", 0, "Directory Path", ""},
{PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned Number", ""},
{PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""},
+ {PROP_FACTOR, "FACTOR", 0, "Factor", ""},
{PROP_ANGLE, "ANGLE", 0, "Angle", ""},
{PROP_TIME, "TIME", 0, "Time", ""},
{PROP_DISTANCE, "DISTANCE", 0, "Distance", ""},
@@ -797,7 +854,6 @@ static void rna_def_property(BlenderRNA *brna)
{PROP_QUATERNION, "QUATERNION", 0, "Quaternion", ""},
{PROP_XYZ, "XYZ", 0, "XYZ", ""},
{PROP_RGB, "RGB", 0, "RGB", ""},
- {PROP_NEVER_NULL, "NEVER_NULL", 0, "Never Null", ""},
{PROP_LAYER, "LAYER", 0, "Layer", ""},
{PROP_LAYER_MEMBER, "LAYER_MEMBERSHIP", 0, "Layer Membership", ""},
{0, NULL, 0, NULL, NULL}};
@@ -932,13 +988,27 @@ static void rna_def_number_property(StructRNA *srna, PropertyType type)
}
-#if 0 // XXX - Variable length arrays
prop= RNA_def_property(srna, "default_array", type, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_default_array_get", NULL, NULL);
- else RNA_def_property_float_funcs(prop, "rna_FloatProperty_default_array_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Default", "Default value for this number");
-#endif
+ RNA_def_property_array(prop, RNA_MAX_ARRAY_DIMENSION); /* no fixed default length, important its not 0 though */
+ RNA_def_property_flag(prop, PROP_DYNAMIC);
+ RNA_def_property_dynamic_array_funcs(prop, "rna_NumberProperty_default_array_get_length"); /* same for all types */
+
+ switch(type) {
+ case PROP_BOOLEAN:
+ RNA_def_property_boolean_funcs(prop, "rna_BoolProperty_default_array_get", NULL);
+ break;
+ case PROP_INT:
+ RNA_def_property_int_funcs(prop, "rna_IntProperty_default_array_get", NULL, NULL);
+ break;
+ case PROP_FLOAT:
+ RNA_def_property_float_funcs(prop, "rna_FloatProperty_default_array_get", NULL, NULL);
+ break;
+ default:
+ break;
+ }
+ RNA_def_property_ui_text(prop, "Default Array", "Default value for this array");
+
prop= RNA_def_property(srna, "array_length", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 965796c6d5b..d6cd81aced2 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -62,6 +62,7 @@ EnumPropertyItem prop_mode_items[] ={
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_node.h"
+#include "BKE_pointcache.h"
#include "BLI_threads.h"
@@ -70,7 +71,7 @@ EnumPropertyItem prop_mode_items[] ={
#include "RE_pipeline.h"
-PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
+static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal= iter->internal;
@@ -257,6 +258,41 @@ static void rna_SceneRenderData_file_format_set(PointerRNA *ptr, int value)
#endif
}
+void rna_SceneRenderData_jpeg2k_preset_update(RenderData *rd)
+{
+ rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
+
+ switch(rd->jp2_depth) {
+ case 8: break;
+ case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
+ case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
+ }
+
+ switch(rd->jp2_preset) {
+ case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
+ case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
+ case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
+ case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
+ case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
+ case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
+ case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
+ }
+}
+
+static void rna_SceneRenderData_jpeg2k_preset_set(PointerRNA *ptr, int value)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+ rd->jp2_preset= value;
+ rna_SceneRenderData_jpeg2k_preset_update(rd);
+}
+
+static void rna_SceneRenderData_jpeg2k_depth_set(PointerRNA *ptr, int value)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+ rd->jp2_depth= value;
+ rna_SceneRenderData_jpeg2k_preset_update(rd);
+}
+
static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr)
{
RenderData *rd= (RenderData*)ptr->data;
@@ -371,7 +407,7 @@ static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr)
ntreeCompositForceHidden(scene->nodetree, scene);
}
-void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
+static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
{
Scene *scene= (Scene*)ptr->data;
@@ -380,6 +416,14 @@ void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
ED_node_composit_default(scene);
}
+static void rna_Physics_update(bContext *C, PointerRNA *ptr)
+{
+ Scene *scene= (Scene*)ptr->id.data;
+ Base *base;
+
+ for(base = scene->base.first; base; base=base->next)
+ BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
+}
#else
static void rna_def_tool_settings(BlenderRNA *brna)
@@ -523,7 +567,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_enum_items(prop, mesh_select_mode_items);
RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Mesh selection and display mode.");
- prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups.");
}
@@ -561,7 +605,6 @@ static void rna_def_unit_settings(BlenderRNA *brna)
RNA_def_property_update(prop, NC_WINDOW, NULL);
}
-
void rna_def_render_layer_common(StructRNA *srna, int scene)
{
PropertyRNA *prop;
@@ -784,7 +827,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
}
-void rna_def_scene_game_data(BlenderRNA *brna)
+static void rna_def_scene_game_data(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -1229,19 +1272,19 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
#ifdef WITH_OPENJPEG
static EnumPropertyItem jp2_preset_items[] = {
{0, "NO_PRESET", 0, "No Preset", ""},
- {1, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 2048x1080", ""},
- {2, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
- {3, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 4096x2160", ""},
- {4, "R_JPEG2K_CINE_PRESET", 0, "Cine-Scope 24fps 2048x858", ""},
- {5, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
- {6, "R_JPEG2K_CINE_PRESET", 0, "Cine-Flat 24fps 1998x1080", ""},
- {7, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
+ {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
+ {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
+ {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
+ {4, "CINE_SCOPE_48FPS", 0, "Cine-Scope 24fps 2048x858", ""},
+ {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
+ {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
+ {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem jp2_depth_items[] = {
- {0, "8", 0, "8", ""},
- {R_JPEG2K_12BIT, "16", 0, "16", ""},
- {R_JPEG2K_16BIT, "32", 0, "32", ""},
+ {8, "8", 0, "8", "8 bit color channels"},
+ {12, "12", 0, "12", "12 bit color channels"},
+ {16, "16", 0, "16", "16 bit color channels"},
{0, NULL, 0, NULL, NULL}};
#endif
@@ -1302,23 +1345,25 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
RNA_def_property_enum_items(prop, color_mode_items);
RNA_def_property_ui_text(prop, "Color Mode", "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, AND RGBA for saving red, green, blue + alpha channels");
-
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xsch");
RNA_def_property_range(prop, 4, 10000);
RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image.");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ysch");
RNA_def_property_range(prop, 4, 10000);
RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image.");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "size");
RNA_def_property_ui_range(prop, 1, 100, 10, 1);
RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xparts");
@@ -1336,13 +1381,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "xasp");
RNA_def_property_range(prop, 1.0f, 200.0f);
RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yasp");
RNA_def_property_range(prop, 1.0f, 200.0f);
RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
/* JPEG and AVI JPEG */
@@ -1412,19 +1457,21 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
#ifdef WITH_OPENJPEG
/* Jpeg 2000 */
- prop= RNA_def_property(srna, "jpeg_preset", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_preset");
+ prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
RNA_def_property_enum_items(prop, jp2_preset_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_jpeg2k_preset_set", NULL);
RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "jpeg_depth", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
RNA_def_property_enum_items(prop, jp2_depth_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_jpeg2k_depth_set", NULL);
RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "jpeg_ycc", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -1510,6 +1557,19 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_MULTIPLEX_AUDIO);
RNA_def_property_ui_text(prop, "Multiplex Audio", "Interleave audio with the output video");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
+ RNA_def_property_range(prop, 8000, 192000);
+ RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Volume", "Audio volume");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
#endif
prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
@@ -1574,17 +1634,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, field_order_items);
RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines get rendered first, to create smooth motion for TV output");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "fields_still", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "sync_audio", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
- RNA_def_property_ui_text(prop, "Sync Audio", "Play back and sync with audio from Sequence Editor");
- RNA_def_property_update(prop, NC_SCENE, NULL);
-
prop= RNA_def_property(srna, "render_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
RNA_def_property_ui_text(prop, "Render Shadows", "Calculate shadows while rendering.");
@@ -1643,6 +1699,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, threads_mode_items);
RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "motion_blur", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
@@ -1653,6 +1710,30 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "border.xmin");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border.");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "border.ymin");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "border.xmax");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "border.ymax");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "crop_to_border", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
@@ -1726,6 +1807,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
RNA_def_property_enum_items(prop, display_mode_items);
RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "output_path", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "pic");
@@ -1902,6 +1984,16 @@ void RNA_def_scene(BlenderRNA *brna)
PropertyRNA *prop;
FunctionRNA *func;
+ static EnumPropertyItem audio_distance_model_items[] = {
+ {0, "NONE", 0, "None", "No distance attenuation."},
+ {1, "INVERSE", 0, "Inverse", "Inverse distance model."},
+ {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping."},
+ {3, "LINEAR", 0, "Linear", "Linear distance model."},
+ {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping."},
+ {5, "EXPONENT", 0, "Exponent", "Exponent distance model."},
+ {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping."},
+ {0, NULL, 0, NULL, NULL}};
+
/* Struct definition */
srna= RNA_def_struct(brna, "Scene", "ID");
RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings.");
@@ -1994,6 +2086,9 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ /* Animation Data (for Scene) */
+ rna_def_animdata_common(srna);
+
/* Nodes (Compositing) */
prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree.");
@@ -2032,19 +2127,35 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
/* Tool Settings */
- prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
RNA_def_property_struct_type(prop, "ToolSettings");
RNA_def_property_ui_text(prop, "Tool Settings", "");
/* Unit Settings */
- prop= RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "unit");
RNA_def_property_struct_type(prop, "UnitSettings");
RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
+
+ /* Physics Settings */
+ prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
+ RNA_def_property_float_sdna(prop, NULL, "physics_settings.gravity");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
+ RNA_def_property_update(prop, 0, "rna_Physics_update");
+
+ prop= RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
+ RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics.");
+ RNA_def_property_update(prop, 0, "rna_Physics_update");
/* Render Data */
- prop= RNA_def_property(srna, "render_data", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "render_data", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "r");
RNA_def_property_struct_type(prop, "SceneRenderData");
RNA_def_property_ui_text(prop, "Render Data", "");
@@ -2055,8 +2166,43 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "TimelineMarker");
RNA_def_property_ui_text(prop, "Timeline Markers", "Markers used in all timelines for the current scene.");
+ /* Audio Settings */
+ prop= RNA_def_property(srna, "mute_audio", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_MUTE);
+ RNA_def_property_ui_text(prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "sync_audio", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
+ RNA_def_property_ui_text(prop, "Audio Sync", "Play back and sync with audio from Sequence Editor.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "scrub_audio", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SCRUB);
+ RNA_def_property_ui_text(prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "speed_of_sound", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "audio.speed_of_sound");
+ RNA_def_property_range(prop, 0.01f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Speed of Sound", "Speed of sound for doppler effect calculation.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "doppler_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "audio.doppler_factor");
+ RNA_def_property_range(prop, 0.0, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for doppler effect calculation.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "distance_model", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio.distance_model");
+ RNA_def_property_enum_items(prop, audio_distance_model_items);
+ RNA_def_property_ui_text(prop, "Distance Model", "Distance model for distance attenuation calculation.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
/* Game Settings */
- prop= RNA_def_property(srna, "game_data", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "game_data", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "gm");
RNA_def_property_struct_type(prop, "SceneGameData");
RNA_def_property_ui_text(prop, "Game Data", "");
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 26047ab5dc3..40f2db6d4a4 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -1,5 +1,5 @@
/**
- * $Id:
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -21,7 +21,7 @@
* All rights reserved.
*
*
- * Contributor(s): Joshua Leung
+ * Contributor(s): Joshua Leung, Arystanbek Dyussenov
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -40,9 +40,49 @@
#ifdef RNA_RUNTIME
#include "BKE_animsys.h"
+#include "BKE_scene.h"
+#include "BKE_depsgraph.h"
-// Scene API stuff from kazanbas branch here...
+#include "ED_object.h"
+#include "WM_api.h"
+
+static void rna_Scene_add_object(Scene *sce, ReportList *reports, Object *ob)
+{
+ Base *base= object_in_scene(ob, sce);
+ if (base) {
+ BKE_report(reports, RPT_ERROR, "Object is already in this scene.");
+ return;
+ }
+ base= scene_add_base(sce, ob);
+ ob->id.us++;
+
+ /* this is similar to what object_add_type and add_object do */
+ ob->lay= base->lay= sce->lay;
+ ob->recalc |= OB_RECALC;
+
+ DAG_scene_sort(sce);
+}
+
+static void rna_Scene_remove_object(Scene *sce, ReportList *reports, Object *ob)
+{
+ Base *base= object_in_scene(ob, sce);
+ if (!base) {
+ BKE_report(reports, RPT_ERROR, "Object is not in this scene.");
+ return;
+ }
+ /* as long as ED_base_object_free_and_unlink calls free_libblock_us, we don't have to decrement ob->id.us */
+ ED_base_object_free_and_unlink(sce, base);
+}
+
+static void rna_Scene_set_frame(Scene *sce, bContext *C, int frame)
+{
+ sce->r.cfra= frame;
+ CLAMP(sce->r.cfra, MINAFRAME, MAXFRAME);
+ scene_update_for_newframe(sce, (1<<20) - 1);
+
+ WM_event_add_notifier(C, NC_SCENE|ND_FRAME, sce);
+}
static KeyingSet *rna_Scene_add_keying_set(Scene *sce, ReportList *reports,
char name[], int absolute, int insertkey_needed, int insertkey_visual)
@@ -77,21 +117,37 @@ void RNA_api_scene(StructRNA *srna)
{
FunctionRNA *func;
PropertyRNA *parm;
-
- // Scene API stuff from kazanbas branch here...
-
+
+ func= RNA_def_function(srna, "add_object", "rna_Scene_add_object");
+ RNA_def_function_ui_description(func, "Add object to scene.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "remove_object", "rna_Scene_remove_object");
+ RNA_def_function_ui_description(func, "Remove object from scene.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "set_frame", "rna_Scene_set_frame");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately.");
+ parm= RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set.", MINAFRAME, MAXFRAME);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
/* Add Keying Set */
func= RNA_def_function(srna, "add_keying_set", "rna_Scene_add_keying_set");
RNA_def_function_ui_description(func, "Add a new Keying Set to Scene.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- /* returns the new KeyingSet */
+ /* returns the new KeyingSet */
parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set.");
- RNA_def_function_return(func, parm);
- /* name */
+ RNA_def_function_return(func, parm);
+ /* name */
RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
- /* flags */
+ /* flags */
RNA_def_boolean(func, "absolute", 1, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
- /* keying flags */
+ /* keying flags */
RNA_def_boolean(func, "insertkey_needed", 0, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves.");
RNA_def_boolean(func, "insertkey_visual", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'.");
}
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 7a243327bd1..2a72845dd42 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -135,10 +135,10 @@ static void rna_def_screen(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Screen", "Screen datablock, defining the layout of areas in a window.");
RNA_def_struct_ui_icon(srna, ICON_SPLITSCREEN);
- prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NEVER_NULL);
- RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen.");
- RNA_def_property_flag(prop, PROP_EDITABLE);
+ prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL);
+ RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen.");
RNA_def_property_update(prop, 0, "rna_Screen_scene_update");
prop= RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index 53bd230870f..1003af6d4d1 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -48,6 +48,8 @@ static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
return &RNA_KeyboardSensor;
case SENS_PROPERTY:
return &RNA_PropertySensor;
+ case SENS_ARMATURE:
+ return &RNA_ArmatureSensor;
case SENS_MOUSE:
return &RNA_MouseSensor;
case SENS_COLLISION:
@@ -73,7 +75,7 @@ static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
#else
-void rna_def_sensor(BlenderRNA *brna)
+static void rna_def_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -92,6 +94,7 @@ void rna_def_sensor(BlenderRNA *brna)
{SENS_JOYSTICK, "JOYSTICK", 0, "joystick", ""},
{SENS_ACTUATOR, "ACTUATOR", 0, "Actuator", ""},
{SENS_DELAY, "DELAY", 0, "Delay", ""},
+ {SENS_ARMATURE, "ARMATURE", 0, "Armature", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Sensor", NULL);
@@ -129,14 +132,14 @@ void rna_def_sensor(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 10000);
}
-void rna_def_always_sensor(BlenderRNA *brna)
+static void rna_def_always_sensor(BlenderRNA *brna)
{
StructRNA *srna;
srna= RNA_def_struct(brna, "AlwaysSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Always Sensor", "Sensor to generate continuous pulses.");
}
-void rna_def_near_sensor(BlenderRNA *brna)
+static void rna_def_near_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -160,7 +163,7 @@ void rna_def_near_sensor(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 10000.0f);
}
-void rna_def_mouse_sensor(BlenderRNA *brna)
+static void rna_def_mouse_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -186,7 +189,7 @@ void rna_def_mouse_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Mouse Event", "Specify the type of event this mouse sensor should trigger on.");
}
-void rna_def_touch_sensor(BlenderRNA *brna)
+static void rna_def_touch_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -201,7 +204,7 @@ void rna_def_touch_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Material", "Only look for floors with this material.");
}
-void rna_def_keyboard_sensor(BlenderRNA *brna)
+static void rna_def_keyboard_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -240,7 +243,7 @@ void rna_def_keyboard_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "All Keys", "Trigger this sensor on any keystroke.");
}
-void rna_def_property_sensor(BlenderRNA *brna)
+static void rna_def_property_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -278,7 +281,41 @@ void rna_def_property_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Maximum Value", "Specify maximum value in Interval type.");
}
-void rna_def_actuator_sensor(BlenderRNA *brna)
+static void rna_def_armature_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_type_items[] ={
+ {SENS_ARM_STATE_CHANGED, "STATECHG", 0, "State Changed", ""},
+ {SENS_ARM_LIN_ERROR_BELOW, "LINERRORBELOW", 0, "Lin error below", ""},
+ {SENS_ARM_LIN_ERROR_ABOVE, "LINERRORABOVE", 0, "Lin error above", ""},
+ {SENS_ARM_ROT_ERROR_BELOW, "ROTERRORBELOW", 0, "Rot error below", ""},
+ {SENS_ARM_ROT_ERROR_ABOVE, "ROTERRORBELOW", 0, "Rot error above", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "ArmatureSensor", "Sensor");
+ RNA_def_struct_ui_text(srna, "Armature Sensor", "Sensor to detect values and changes in values of IK solver.");
+ RNA_def_struct_sdna_from(srna, "bArmatureSensor", "data");
+
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_ui_text(prop, "Test Type", "Type of value and test.");
+
+ prop= RNA_def_property(srna, "channel_name", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "posechannel");
+ RNA_def_property_ui_text(prop, "Bone name", "Identify the bone to check value from");
+
+ prop= RNA_def_property(srna, "constraint_name", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "constraint");
+ RNA_def_property_ui_text(prop, "Constraint name", "Identify the bone constraint to check value from.");
+
+ prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "value");
+ RNA_def_property_ui_text(prop, "Compare Value", "Specify value to be used in comparison.");
+}
+
+static void rna_def_actuator_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -292,7 +329,7 @@ void rna_def_actuator_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Actuator", "Actuator name, actuator active state modifications will be detected.");
}
-void rna_def_delay_sensor(BlenderRNA *brna)
+static void rna_def_delay_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -314,7 +351,7 @@ void rna_def_delay_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics.");
}
-void rna_def_collision_sensor(BlenderRNA *brna)
+static void rna_def_collision_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -341,7 +378,7 @@ void rna_def_collision_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Collision Type", "Toggle collision on material or property.");
}
-void rna_def_radar_sensor(BlenderRNA *brna)
+static void rna_def_radar_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -376,7 +413,7 @@ void rna_def_radar_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Distance", "Depth of the radar cone.");
}
-void rna_def_random_sensor(BlenderRNA *brna)
+static void rna_def_random_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -390,7 +427,7 @@ void rna_def_random_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator. (Choose 0 for not random).");
}
-void rna_def_ray_sensor(BlenderRNA *brna)
+static void rna_def_ray_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -438,7 +475,7 @@ void rna_def_ray_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the ray is cast.");
}
-void rna_def_message_sensor(BlenderRNA *brna)
+static void rna_def_message_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -451,7 +488,7 @@ void rna_def_message_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty for all.");
}
-void rna_def_joystick_sensor(BlenderRNA *brna)
+static void rna_def_joystick_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -531,6 +568,7 @@ void RNA_def_sensor(BlenderRNA *brna)
rna_def_touch_sensor(brna);
rna_def_keyboard_sensor(brna);
rna_def_property_sensor(brna);
+ rna_def_armature_sensor(brna);
rna_def_actuator_sensor(brna);
rna_def_delay_sensor(brna);
rna_def_collision_sensor(brna);
diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c
index 9f016f73694..9404fb775c3 100644
--- a/source/blender/makesrna/intern/rna_sequence.c
+++ b/source/blender/makesrna/intern/rna_sequence.c
@@ -228,7 +228,15 @@ static char *rna_Sequence_path(PointerRNA *ptr)
/* sequencer data comes from scene...
* TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths)
*/
- return BLI_sprintfN("sequence_editor.sequences[\"%s\"]", seq->name+2);
+ if (seq->name+2)
+ return BLI_sprintfN("sequence_editor.sequences[\"%s\"]", seq->name+2);
+ else {
+ /* compromise for the frequent sitation when strips don't have names... */
+ Scene *sce= (Scene*)ptr->id.data;
+ Editing *ed= seq_give_editing(sce, FALSE);
+
+ return BLI_sprintfN("sequence_editor.sequences[%d]", BLI_findindex(&ed->seqbase, seq));
+ }
}
static PointerRNA rna_SequenceEdtior_meta_stack_get(CollectionPropertyIterator *iter)
@@ -239,6 +247,35 @@ static PointerRNA rna_SequenceEdtior_meta_stack_get(CollectionPropertyIterator *
return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
}
+static void rna_MovieSequence_filename_set(PointerRNA *ptr, const char *value)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+ char dir[FILE_MAX], name[FILE_MAX];
+
+ BLI_split_dirfile_basic(value, dir, name);
+ BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
+ BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
+}
+
+static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+ char dir[FILE_MAX], name[FILE_MAX];
+
+ BLI_split_dirfile_basic(value, dir, name);
+ BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
+ BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
+}
+
+static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
+{
+ StripElem *elem= (StripElem*)(ptr->data);
+ char name[FILE_MAX];
+
+ BLI_split_dirfile_basic(value, NULL, name);
+ BLI_strncpy(elem->name, name, sizeof(elem->name));
+}
+
#else
static void rna_def_strip_element(BlenderRNA *brna)
@@ -253,6 +290,7 @@ static void rna_def_strip_element(BlenderRNA *brna)
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Filename", "");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set");
}
static void rna_def_strip_crop(BlenderRNA *brna)
@@ -490,6 +528,7 @@ static void rna_def_sequence(BlenderRNA *brna)
prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "machine");
+ RNA_def_property_range(prop, 0, MAXSEQ-1);
RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip.");
RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_channel_set",NULL); // overlap test
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
@@ -514,7 +553,7 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
}
-void rna_def_editor(BlenderRNA *brna)
+static void rna_def_editor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -736,6 +775,7 @@ static void rna_def_movie(BlenderRNA *brna)
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
RNA_def_property_ui_text(prop, "Filename", "");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MovieSequence_filename_set");
prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->dir");
@@ -762,6 +802,7 @@ static void rna_def_sound(BlenderRNA *brna)
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
RNA_def_property_ui_text(prop, "Filename", "");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoundSequence_filename_set");
prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->dir");
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 943129c7169..7bccd685c1d 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -211,11 +211,13 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x ");
RNA_def_property_update(prop, 0, NULL);
- prop= RNA_def_property(srna, "point_cache_low", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "point_cache_low", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]");
RNA_def_property_ui_text(prop, "Point Cache", "");
- prop= RNA_def_property(srna, "point_cache_high", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "point_cache_high", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "point_cache[1]");
RNA_def_property_ui_text(prop, "Point Cache", "");
}
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 542f6e2aeda..422283c940f 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -38,8 +38,7 @@
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
-#include "BKE_paint.h"
-
+#include "WM_api.h"
#include "WM_types.h"
EnumPropertyItem space_type_items[] = {
@@ -80,11 +79,15 @@ static EnumPropertyItem dc_all_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_Z, DC_LC
#ifdef RNA_RUNTIME
+#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
+#include "BKE_animsys.h"
#include "BKE_brush.h"
+#include "BKE_colortools.h"
#include "BKE_context.h"
+#include "BKE_paint.h"
#include "ED_image.h"
#include "ED_screen.h"
@@ -188,7 +191,8 @@ static EnumPropertyItem dc_z_items[] = {DC_RGB, DC_Z, DC_LCMS, DC_ZERO};
static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, PointerRNA *ptr, int *free)
{
SpaceImage *sima= (SpaceImage*)ptr->data;
- ImBuf *ibuf= ED_space_image_buffer(sima);
+ ImBuf *ibuf;
+ void *lock;
int zbuf, alpha;
if(C==NULL) {
@@ -196,9 +200,13 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, P
return dc_all_items;
}
+ ibuf= ED_space_image_acquire_buffer(sima, &lock);
+
alpha= ibuf && (ibuf->channels == 4);
zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1));
+ ED_space_image_release_buffer(sima, lock);
+
if(alpha && zbuf)
return dc_all_items;
else if(alpha)
@@ -209,9 +217,23 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, P
return dc_rgb_items;
}
+static void rna_SpaceImageEditor_curves_update(bContext *C, PointerRNA *ptr)
+{
+ SpaceImage *sima= (SpaceImage*)ptr->data;
+ ImBuf *ibuf;
+ void *lock;
+
+ ibuf= ED_space_image_acquire_buffer(sima, &lock);
+ curvemapping_do_ibuf(sima->cumap, ibuf);
+ ED_space_image_release_buffer(sima, lock);
+
+ WM_event_add_notifier(C, NC_IMAGE, sima->image);
+}
+
+
/* Space Text Editor */
-void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
+static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
{
SpaceText *st= (SpaceText*)(ptr->data);
@@ -219,7 +241,7 @@ void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
st->left= 0;
}
-void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
+static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
{
SpaceText *st= (SpaceText*)(ptr->data);
@@ -227,16 +249,9 @@ void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
st->top= 0;
}
-void rna_SpaceFileBrowser_params_set(PointerRNA *ptr, PointerRNA value)
-{
- SpaceFile *sfile= (SpaceFile*)(ptr->data);
-
- sfile->params= value.data;
-}
-
/* Space Properties */
-StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
+static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
{
SpaceButs *sbuts= (SpaceButs*)(ptr->data);
@@ -246,7 +261,7 @@ StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
return &RNA_ID;
}
-void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
+static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
{
SpaceButs *sbuts= (SpaceButs*)(ptr->data);
@@ -311,12 +326,36 @@ static void rna_View3D_display_background_image_set(PointerRNA *ptr, int value)
}
/* Space Time */
+
static void rna_SpaceTime_redraw_update(bContext *C, PointerRNA *ptr)
{
SpaceTime *st= (SpaceTime*)ptr->data;
ED_screen_animation_timer_update(C, st->redraws);
}
+/* Space Dopesheet */
+
+static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
+{
+ SpaceAction *saction= (SpaceAction*)(ptr->data);
+ saction->action= value.data;
+}
+
+static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
+{
+ SpaceAction *saction= (SpaceAction*)(ptr->data);
+ Object *obact= CTX_data_active_object(C);
+
+ /* we must set this action to be the one used by active object (if not pinned) */
+ if(obact && saction->pin == 0) {
+ AnimData *adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
+
+ /* set action */
+ adt->action= saction->action;
+ id_us_plus(&adt->action->id);
+ }
+}
+
#else
static void rna_def_space(BlenderRNA *brna)
@@ -491,7 +530,8 @@ static void rna_def_background_image(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
@@ -572,11 +612,9 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "localview", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "localview", 0);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ prop= RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "localvd");
RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility.");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "lens");
@@ -717,10 +755,11 @@ static void rna_def_space_buttons(BlenderRNA *brna)
{BCONTEXT_SCENE, "SCENE", ICON_SCENE, "Scene", "Scene"},
{BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"},
{BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"},
- {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraint", "Constraint"},
- {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifier", "Modifier"},
+ {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Constraints"},
+ {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Modifiers"},
{BCONTEXT_DATA, "DATA", 0, "Data", "Data"},
{BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"},
+ {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT, "Bone Constraints", "Bone Constraints"},
{BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
{BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
{BCONTEXT_PARTICLE, "PARTICLE", ICON_PARTICLES, "Particle", "Particle"},
@@ -779,7 +818,8 @@ static void rna_def_space_image(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
@@ -787,7 +827,7 @@ static void rna_def_space_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "curves", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "cumap");
RNA_def_property_ui_text(prop, "Curves", "Color curve mapping to use for displaying the image.");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_curves_update");
prop= RNA_def_property(srna, "image_pin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
@@ -808,7 +848,8 @@ static void rna_def_space_image(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
/* uv */
- prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "SpaceUVEditor");
RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL);
RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings.");
@@ -1036,6 +1077,13 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceAction");
RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data.");
+
+ /* data */
+ prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL);
+ RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space.");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_action_update");
/* mode */
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
@@ -1199,6 +1247,11 @@ static void rna_def_space_time(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sequencer Windows", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
+ prop= RNA_def_property(srna, "play_nodes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_NODES);
+ RNA_def_property_ui_text(prop, "Node Windows", "");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
+
/* Other options */
prop= RNA_def_property(srna, "continue_physics", PROP_BOOLEAN, PROP_NONE);
@@ -1422,7 +1475,6 @@ static void rna_def_space_filebrowser(BlenderRNA *brna)
prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "params");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceFileBrowser_params_set", NULL);
RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser.");
}
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index cd39c317bc5..8c9b2b58887 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -198,7 +198,8 @@ static void rna_def_text(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "TextLine");
RNA_def_property_ui_text(prop, "Lines", "Lines of text.");
- prop= RNA_def_property(srna, "current_line", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "current_line", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "curl");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "TextLine");
@@ -209,7 +210,8 @@ static void rna_def_text(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Current Character", "Index of current character in current line, and also start index of character in selection if one exists.");
- prop= RNA_def_property(srna, "selection_end_line", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "selection_end_line", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "sell");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "TextLine");
@@ -223,6 +225,8 @@ static void rna_def_text(BlenderRNA *brna)
prop= RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "TextMarker");
RNA_def_property_ui_text(prop, "Markers", "Text markers highlighting part of the text.");
+
+ RNA_api_text(srna);
}
void RNA_def_text(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c
new file mode 100644
index 00000000000..b048a6b59d0
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_text_api.c
@@ -0,0 +1,49 @@
+/**
+ *
+ * ***** 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void RNA_api_text(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *prop;
+
+ func= RNA_def_function(srna, "clear", "clear_text");
+ RNA_def_function_ui_description(func, "clear the text block.");
+
+ func= RNA_def_function(srna, "write", "write_text");
+ RNA_def_function_ui_description(func, "write text at the cursor location and advance to the end of the text block.");
+ prop= RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock.");
+ RNA_def_property_flag(prop, PROP_REQUIRED);
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index f6835f3e7b5..5c7a097a54d 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -40,8 +40,6 @@
#include "BKE_node.h"
-#include "WM_types.h"
-
static EnumPropertyItem texture_filter_items[] = {
{TXF_BOX, "BOX", 0, "Box", ""},
{TXF_EWA, "EWA", 0, "EWA", ""},
@@ -52,10 +50,16 @@ static EnumPropertyItem texture_filter_items[] = {
#ifdef RNA_RUNTIME
+#include "BKE_depsgraph.h"
#include "BKE_texture.h"
+#include "BKE_main.h"
+
#include "ED_node.h"
-StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
+#include "WM_api.h"
+#include "WM_types.h"
+
+static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
{
Tex *tex= (Tex*)ptr->data;
@@ -95,6 +99,14 @@ StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
}
}
+static void rna_Texture_update(bContext *C, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ DAG_id_flush_update(&tex->id, 0);
+ WM_event_add_notifier(C, NC_TEXTURE, tex);
+}
+
static void rna_Texture_type_set(PointerRNA *ptr, int value)
{
Tex *tex= (Tex*)ptr->data;
@@ -112,6 +124,28 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value)
tex->type = value;
}
+void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
+{
+ ID *id= ptr->id.data;
+
+ DAG_id_flush_update(id, 0);
+
+ switch(GS(id->name)) {
+ case ID_MA:
+ WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, id);
+ break;
+ case ID_WO:
+ WM_event_add_notifier(C, NC_WORLD, id);
+ break;
+ case ID_LA:
+ WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING, id);
+ break;
+ case ID_BR:
+ WM_event_add_notifier(C, NC_BRUSH, id);
+ break;
+ }
+}
+
static int rna_TextureSlot_name_length(PointerRNA *ptr)
{
MTex *mtex= ptr->data;
@@ -202,7 +236,7 @@ static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value)
tex->coba= add_colorband(0);
}
-void rna_Texture_use_nodes_set(PointerRNA *ptr, int v)
+static void rna_Texture_use_nodes_set(PointerRNA *ptr, int v)
{
Tex *tex= (Tex*)ptr->data;
@@ -242,20 +276,6 @@ static EnumPropertyItem *rna_ImageTexture_filter_itemf(bContext *C, PointerRNA *
return item;
}
-static float rna_TextureSlot_angle_get(PointerRNA *ptr)
-{
- MTex *tex= (MTex*)ptr->data;
- const float conv = 57.295779506;
- return tex->rot * conv;
-}
-
-static void rna_TextureSlot_angle_set(PointerRNA *ptr, float v)
-{
- MTex *tex= (MTex*)ptr->data;
- const float conv = 0.017453293;
- tex->rot = v * conv;
-}
-
#else
static void rna_def_color_ramp_element(BlenderRNA *brna)
@@ -271,13 +291,13 @@ static void rna_def_color_ramp_element(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Color", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "pos");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Position", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_color_ramp(BlenderRNA *brna)
@@ -301,13 +321,13 @@ static void rna_def_color_ramp(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "data", "tot");
RNA_def_property_struct_type(prop, "ColorRampElement");
RNA_def_property_ui_text(prop, "Elements", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipotype");
RNA_def_property_enum_items(prop, prop_interpolation_items);
RNA_def_property_ui_text(prop, "Interpolation", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texmapping(BlenderRNA *brna)
@@ -321,37 +341,37 @@ static void rna_def_texmapping(BlenderRNA *brna)
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "has_minimum", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "has_maximum", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_mtex(BlenderRNA *brna)
@@ -378,12 +398,6 @@ static void rna_def_mtex(BlenderRNA *brna)
{MTEX_LIN_LIGHT , "LINEAR LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_map_mode_items[] = {
- {MTEX_MAP_MODE_FIXED, "FIXED", 0, "Fixed", ""},
- {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
- {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
- {0, NULL, 0, NULL, NULL}};
-
static EnumPropertyItem output_node_items[] = {
{0, "DUMMY", 0, "Dummy", ""},
{0, NULL, 0, NULL, NULL}};
@@ -398,89 +412,66 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "Texture datablock used by this texture slot.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_TextureSlot_name_get", "rna_TextureSlot_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Texture slot name.");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_struct_name_property(srna, prop);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
/* mapping */
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "ofs");
RNA_def_property_ui_range(prop, -10, 10, 10, 2);
RNA_def_property_ui_text(prop, "Offset", "Fine tunes texture mapping X, Y and Z locations.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_ui_range(prop, -100, 100, 10, 2);
RNA_def_property_ui_text(prop, "Size", "Sets scaling for the texture's X, Y and Z sizes.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "The default color for textures that don't return RGB.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendtype");
RNA_def_property_enum_items(prop, prop_blend_type_items);
RNA_def_property_ui_text(prop, "Blend Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "stencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_STENCIL);
RNA_def_property_ui_text(prop, "Stencil", "Use this texture as a blending value on the next texture.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "negate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEGATIVE);
RNA_def_property_ui_text(prop, "Negate", "Inverts the values of the texture to reverse its effect.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "rgb_to_intensity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_RGBTOINT);
RNA_def_property_ui_text(prop, "RGB to Intensity", "Converts texture RGB values to intensity (gray) values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
- RNA_def_property_float_sdna(prop, NULL, "rot");
- RNA_def_property_range(prop, 0, 360);
- RNA_def_property_float_funcs(prop, "rna_TextureSlot_angle_get", "rna_TextureSlot_angle_set", NULL);
- RNA_def_property_ui_text(prop, "Angle", "Defines brush texture rotation.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "brush_map_mode", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_map_mode_items);
- RNA_def_property_ui_text(prop, "Mode", "");
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "def_var");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Default Value", "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "variable_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
- RNA_def_property_ui_range(prop, 0, 1, 10, 3);
- RNA_def_property_ui_text(prop, "Variable Factor", "Amount texture affects other values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "norfac");
- RNA_def_property_ui_range(prop, 0, 5, 10, 3);
- RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "which_output");
RNA_def_property_enum_items(prop, output_node_items);
RNA_def_property_enum_funcs(prop, "rna_TextureSlot_output_node_get", NULL, "rna_TextureSlot_output_node_itemf");
RNA_def_property_ui_text(prop, "Output Node", "Which output node to use, for node-based textures.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
}
static void rna_def_filter_size_common(StructRNA *srna)
@@ -491,14 +482,14 @@ static void rna_def_filter_size_common(StructRNA *srna)
prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN);
RNA_def_property_ui_text(prop, "Use Filter", "Use Filter Size as a minimal filter value in pixels");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "filtersize");
RNA_def_property_range(prop, 0.1, 50.0);
RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Filter Size", "Multiplies the filter size used by MIP Map and Interpolation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_environment_map_common(StructRNA *srna)
@@ -515,14 +506,14 @@ static void rna_def_environment_map_common(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_source_items);
RNA_def_property_ui_text(prop, "Source", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: move this to specific types if needed */
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_ui_text(prop, "Image", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_environment_map(BlenderRNA *brna)
@@ -545,28 +536,28 @@ static void rna_def_environment_map(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.01, 50, 100, 2);
RNA_def_property_ui_text(prop, "Clip Start", "Objects nearer than this are not visible to map.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.10, 20000, 100, 2);
RNA_def_property_ui_text(prop, "Clip End", "Objects further than this are not visible to map.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "viewscale");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.5, 5, 100, 2);
RNA_def_property_ui_text(prop, "Zoom", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: EnvMap.notlay */
@@ -574,12 +565,12 @@ static void rna_def_environment_map(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "cuberes");
RNA_def_property_range(prop, 50, 4096);
RNA_def_property_ui_text(prop, "Resolution", "Pixel resolution of the rendered environment map.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects.)");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static EnumPropertyItem prop_noise_basis_items[] = {
@@ -620,38 +611,38 @@ static void rna_def_texture_clouds(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_clouds_stype);
RNA_def_property_ui_text(prop, "Color", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_wood(BlenderRNA *brna)
@@ -681,44 +672,44 @@ static void rna_def_texture_wood(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_wood_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_wood_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
@@ -748,51 +739,51 @@ static void rna_def_texture_marble(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_marble_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_marble_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
@@ -810,14 +801,14 @@ static void rna_def_texture_magic(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_blend(BlenderRNA *brna)
@@ -835,6 +826,11 @@ static void rna_def_texture_blend(BlenderRNA *brna)
{TEX_RAD, "RADIAL", 0, "Radial", "Creates a radial progression"},
{0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_flip_axis_items[]= {
+ {0, "HORIZONTAL", 0, "Horizontal", "Flips the texture's X and Y axis"},
+ {TEX_FLIPBLEND, "VERTICAL", 0, "Vertical", "Flips the texture's X and Y axis"},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "BlendTexture", "Texture");
RNA_def_struct_ui_text(srna, "Blend Texture", "Procedural color blending texture.");
RNA_def_struct_sdna(srna, "Tex");
@@ -843,12 +839,14 @@ static void rna_def_texture_blend(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_blend_progression);
RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "flip_axis", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_FLIPBLEND);
+ prop= RNA_def_property(srna, "flip_axis", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_flip_axis_items);
RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
}
static void rna_def_texture_stucci(BlenderRNA *brna)
@@ -871,32 +869,32 @@ static void rna_def_texture_stucci(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_stucci_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_noise(BlenderRNA *brna)
@@ -914,11 +912,11 @@ static void rna_def_texture_image(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_image_extension[] = {
- {1, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"},
- {2, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"},
- {4, "CLIP_CUBE", 0, "Clip Cube", "Clips to cubic-shaped area around the image and sets exterior pixels as transparent"},
- {3, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
- {5, "CHECKER", 0, "Checker", "Causes the image to repeat in checker board pattern"},
+ {TEX_EXTEND, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"},
+ {TEX_CLIP, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"},
+ {TEX_CLIPCUBE, "CLIP_CUBE", 0, "Clip Cube", "Clips to cubic-shaped area around the image and sets exterior pixels as transparent"},
+ {TEX_REPEAT, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
+ {TEX_CHECKER, "CHECKER", 0, "Checker", "Causes the image to repeat in checker board pattern"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ImageTexture", "Texture");
@@ -929,45 +927,45 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP);
RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set");
RNA_def_property_ui_text(prop, "MIP Map", "Uses auto-generated MIP maps for the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP);
RNA_def_property_ui_text(prop, "MIP Map Gauss", "Uses Gauss filter to sample down MIP maps");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "interpolation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_INTERPOL);
RNA_def_property_ui_text(prop, "Interpolation", "Interpolates pixels using Area filter");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: I think flip_axis should be a generic Texture property, enabled for all the texture types */
prop= RNA_def_property(srna, "flip_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_IMAROT);
RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_USEALPHA);
RNA_def_property_ui_text(prop, "Use Alpha", "Uses the alpha channel information in the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "calculate_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_CALCALPHA);
RNA_def_property_ui_text(prop, "Calculate Alpha", "Calculates an alpha channel based on RGB values in the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_NEGALPHA);
RNA_def_property_ui_text(prop, "Invert Alpha", "Inverts all the alpha values in the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
rna_def_filter_size_common(srna);
prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: mtex->normapspace "Sets space of normal map image" "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3"
* not sure why this goes in mtex instead of texture directly? */
@@ -975,47 +973,47 @@ static void rna_def_texture_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
RNA_def_property_enum_items(prop, prop_image_extension);
- RNA_def_property_ui_text(prop, "Extension", "Sets how the image is stretched in the texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_ui_text(prop, "Extension", "Sets how the image is extrapolated past its original bounds");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xrepeat");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Repeat X", "Sets a repetition multiplier in the X direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yrepeat");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Repeat Y", "Sets a repetition multiplier in the Y direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_XMIR);
RNA_def_property_ui_text(prop, "Mirror X", "Mirrors the image repetition on the X direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "mirror_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_YMIR);
RNA_def_property_ui_text(prop, "Mirror Y", "Mirrors the image repetition on the Y direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "checker_odd", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_ODD);
RNA_def_property_ui_text(prop, "Checker Odd", "Sets odd checker tiles");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "checker_even", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_EVEN);
RNA_def_property_ui_text(prop, "Checker Even", "Sets even checker tiles");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "checker_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "checkerdist");
RNA_def_property_range(prop, 0.0, 0.99);
RNA_def_property_ui_range(prop, 0.0, 0.99, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Checker Distance", "Sets distance between checker tiles");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
#if 0
@@ -1027,7 +1025,7 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_array(prop, 4);
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_text(prop, "Crop Rectangle", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
#endif
@@ -1036,35 +1034,40 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Minimum X", "Sets minimum X value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "crop_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropymin");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Minimum Y", "Sets minimum Y value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "crop_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropxmax");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Maximum X", "Sets maximum X value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "crop_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropymax");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Maximum Y", "Sets maximum Y value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
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_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "iuser");
+ RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* filtering */
prop= RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE);
@@ -1072,19 +1075,19 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_enum_items(prop, texture_filter_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageTexture_filter_itemf");
RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Probes", "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_plugin(BlenderRNA *brna)
@@ -1109,11 +1112,16 @@ static void rna_def_texture_environment_map(BlenderRNA *brna)
rna_def_environment_map_common(srna);
+ prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "iuser");
+ RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
prop= RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "env");
RNA_def_property_struct_type(prop, "EnvironmentMap");
RNA_def_property_ui_text(prop, "Environment Map", "Gets the environment map associated with this texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
rna_def_filter_size_common(srna);
}
@@ -1139,62 +1147,62 @@ static void rna_def_texture_musgrave(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_musgrave_type);
RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "highest_dimension", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_H");
RNA_def_property_range(prop, 0.0001, 2);
RNA_def_property_ui_text(prop, "Highest Dimension", "Highest fractal dimension");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "lacunarity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_lacunarity");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Lacunarity", "Gap between succesive frequencies");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_octaves");
RNA_def_property_range(prop, 0, 8);
RNA_def_property_ui_text(prop, "Octaves", "Number of frequencies used");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_offset");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Offset", "The fractal offset");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_gain");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Gain", "The gain multiplier");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Noise Intensity", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_voronoi(BlenderRNA *brna)
@@ -1228,62 +1236,62 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "vn_w1");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 1", "Voronoi feature weight 1");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w2");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 2", "Voronoi feature weight 2");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w3");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 3", "Voronoi feature weight 3");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w4");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 4", "Voronoi feature weight 4");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "minkovsky_exponent", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_mexp");
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_ui_text(prop, "Minkovsky Exponent", "Minkovsky exponent");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vn_distm");
RNA_def_property_enum_items(prop, prop_distance_metric_items);
RNA_def_property_ui_text(prop, "Distance Metric", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vn_coltype");
RNA_def_property_enum_items(prop, prop_coloring_items);
RNA_def_property_ui_text(prop, "Coloring", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_ui_text(prop, "Noise Intensity", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_distorted_noise(BlenderRNA *brna)
@@ -1299,32 +1307,32 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "dist_amount");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Distortion Amount", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis for the distortion");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_pointdensity(BlenderRNA *brna)
@@ -1380,104 +1388,104 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "source");
RNA_def_property_enum_items(prop, point_source_items);
RNA_def_property_ui_text(prop, "Point Source", "Point data to use as renderable point density");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Object", "Object to take point data from");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points");
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "particle_cache", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space");
RNA_def_property_enum_items(prop, particle_cache_items);
RNA_def_property_ui_text(prop, "Particle Cache", "Co-ordinate system to cache particles in");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "vertices_cache", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space");
RNA_def_property_enum_items(prop, vertice_cache_items);
RNA_def_property_ui_text(prop, "Vertices Cache", "Co-ordinate system to cache vertices in");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Radius", "Radius from the shaded sample to look for points within");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "falloff_type");
RNA_def_property_enum_items(prop, falloff_items);
RNA_def_property_ui_text(prop, "Falloff", "Method of attenuating density by distance from the point");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "falloff_softness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "falloff_softness");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Softness", "Softness of the 'soft' falloff option");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "color_source");
RNA_def_property_enum_items(prop, color_source_items);
RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "speed_scale");
RNA_def_property_range(prop, 0.001, 100.0);
RNA_def_property_ui_text(prop, "Scale", "Multipler to bring particle speed within an acceptable range");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* Turbulence */
prop= RNA_def_property(srna, "turbulence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE);
RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noise_size");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noise_fac");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Strength", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noise_depth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_influence", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise_influence");
RNA_def_property_enum_items(prop, turbulence_influence_items);
RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise_basis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for tubulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
srna= RNA_def_struct(brna, "PointDensityTexture", "Texture");
@@ -1488,7 +1496,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "PointDensity");
RNA_def_property_ui_text(prop, "Point Density", "The point density settings associated with this texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_voxeldata(BlenderRNA *brna)
@@ -1511,6 +1519,12 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
{TEX_VD_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence", "Generate voxels from a sequence of image slices"},
{TEX_VD_SMOKE, "SMOKE", 0, "Smoke", "Render voxels from a Blender smoke simulation"},
{0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem voxeldata_extension[] = {
+ {TEX_EXTEND, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"},
+ {TEX_CLIP, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"},
+ {TEX_REPEAT, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "VoxelData", NULL);
RNA_def_struct_sdna(srna, "VoxelData");
@@ -1520,46 +1534,52 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "interp_type");
RNA_def_property_enum_items(prop, interpolation_type_items);
RNA_def_property_ui_text(prop, "Interpolation", "Method to interpolate/smooth values between voxel cells");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "extend");
+ RNA_def_property_enum_items(prop, voxeldata_extension);
+ RNA_def_property_ui_text(prop, "Extension", "Sets how the texture is extrapolated past its original bounds");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "int_multiplier");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Intensity", "Multiplier for intensity values");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "file_format");
RNA_def_property_enum_items(prop, file_format_items);
RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render ");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "source_path", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "source_path");
RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resol");
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "still", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL);
RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "still_frame_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "still_frame");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture");
@@ -1570,7 +1590,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "vd");
RNA_def_property_struct_type(prop, "VoxelData");
RNA_def_property_ui_text(prop, "Voxel Data", "The voxel data associated with this texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture(BlenderRNA *brna)
@@ -1609,51 +1629,49 @@ static void rna_def_texture(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Texture_type_set", NULL);
RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_COLORBAND);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_color_ramp_set");
RNA_def_property_ui_text(prop, "Use Color Ramp", "Toggle color ramp operations.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bright");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Brightness", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 5);
RNA_def_property_ui_text(prop, "Contrast", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
- /* XXX: would be nicer to have this as a color selector?
- but the values can go past [0,1]. */
- prop= RNA_def_property(srna, "rgb_factor", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "rgb_factor", PROP_FLOAT, PROP_RGB);
RNA_def_property_float_sdna(prop, NULL, "rfac");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "RGB Factor", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* nodetree */
prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_nodes_set");
RNA_def_property_ui_text(prop, "Use Nodes", "Make this a node-based texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
rna_def_animdata_common(srna);
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 20948843f8a..17846651c3b 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -37,14 +37,15 @@
#ifdef RNA_RUNTIME
-static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle)
+static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle, int icon_only)
{
int flag= 0;
flag |= (slider)? UI_ITEM_R_SLIDER: 0;
flag |= (expand)? UI_ITEM_R_EXPAND: 0;
flag |= (toggle)? UI_ITEM_R_TOGGLE: 0;
-
+ flag |= (icon_only)? UI_ITEM_R_ICON_ONLY: 0;
+
uiItemR(layout, name, icon, ptr, propname, flag);
}
@@ -88,7 +89,7 @@ static void api_ui_item_rna_common(FunctionRNA *func)
PropertyRNA *parm;
parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
- RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -145,6 +146,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values.");
RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values.");
+ RNA_def_boolean(func, "icon_only", 0, "", "Draw only icons in buttons, no text.");
func= RNA_def_function(srna, "items_enumR", "uiItemsEnumR");
api_ui_item_rna_common(func);
@@ -163,7 +165,7 @@ void RNA_api_ui_layout(StructRNA *srna)
api_ui_item_common(func);
api_ui_item_rna_common(func);
parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in.");
- RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property.");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -252,31 +254,29 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data.");
- RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data.");
- RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "template_preview", "uiTemplatePreview");
parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock.");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "parent", "ID", "", "ID datablock.");
- parm= RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot.");
+ RNA_def_pointer(func, "parent", "ID", "", "ID datablock.");
+ RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot.");
func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
- parm= RNA_def_pointer(func, "curvemap", "CurveMapping", "", "Curve mapping pointer.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ api_ui_item_rna_common(func);
RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display.");
- RNA_def_boolean(func, "compact", 0, "", "Use more compact curve mapping.");
+ RNA_def_boolean(func, "levels", 0, "", "Show black/white levels.");
func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
- parm= RNA_def_pointer(func, "ramp", "ColorRamp", "", "Color ramp pointer.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ api_ui_item_rna_common(func);
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
func= RNA_def_function(srna, "template_layers", "uiTemplateLayers");
@@ -292,11 +292,21 @@ void RNA_api_ui_layout(StructRNA *srna)
parm= RNA_def_pointer(func, "image_user", "ImageUser", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "template_list", "uiTemplateList");
+ func= RNA_def_function(srna, "template_image", "uiTemplateImage");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
- parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element.");
+ parm= RNA_def_pointer(func, "image_user", "ImageUser", "", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_boolean(func, "compact", 0, "", "Use more compact layout.");
+
+ func= RNA_def_function(srna, "template_list", "uiTemplateList");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element.");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display.", 0, INT_MAX);
@@ -314,11 +324,6 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "view3d_select_faceselmenu", "uiTemplate_view3d_select_faceselmenu");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
-
- func= RNA_def_function(srna, "template_texture_image", "uiTemplateTextureImage");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "texture", "Texture", "", "");
- RNA_def_property_flag(parm, PROP_REQUIRED);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 4825076528f..25448d0c2de 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -109,11 +109,6 @@ static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesEdit, ptr->data);
}
-static PointerRNA rna_UserDef_language_get(PointerRNA *ptr)
-{
- return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesLanguage, ptr->data);
-}
-
static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesFilePaths, ptr->data);
@@ -197,25 +192,29 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
RNA_def_property_range(prop, 0.5, 2.0);
RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas.");
- prop= RNA_def_property(srna, "paneltitle", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "paneltitle", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Panel Font", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "grouplabel", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "grouplabel", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Group Label Font", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "widgetlabel", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "widgetlabel", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Widget Label Font", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "widget");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Widget Font", "");
@@ -317,7 +316,7 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Driven Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_ui_text(prop, "Blend", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
@@ -334,97 +333,113 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "ThemeUI");
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_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_text");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Text Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_option");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Option Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_num");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Number Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Menu Item Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "List Item Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_state");
RNA_def_property_struct_type(prop, "ThemeWidgetStateColors");
RNA_def_property_ui_text(prop, "State Colors", "");
@@ -1380,87 +1395,104 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "Name of the theme.");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tui");
RNA_def_property_struct_type(prop, "ThemeUserInterface");
RNA_def_property_ui_text(prop, "User Interface", "");
- prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tv3d");
RNA_def_property_struct_type(prop, "ThemeView3D");
RNA_def_property_ui_text(prop, "3D View", "");
- prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tipo");
RNA_def_property_struct_type(prop, "ThemeGraphEditor");
RNA_def_property_ui_text(prop, "Graph Editor", "");
- prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tfile");
RNA_def_property_struct_type(prop, "ThemeFileBrowser");
RNA_def_property_ui_text(prop, "File Browser", "");
- prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tnla");
RNA_def_property_struct_type(prop, "ThemeNLAEditor");
RNA_def_property_ui_text(prop, "NLA Editor", "");
- prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tact");
RNA_def_property_struct_type(prop, "ThemeDopeSheet");
RNA_def_property_ui_text(prop, "DopeSheet", "");
- prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tima");
RNA_def_property_struct_type(prop, "ThemeImageEditor");
RNA_def_property_ui_text(prop, "Image Editor", "");
- prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tseq");
RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
RNA_def_property_ui_text(prop, "Sequence Editor", "");
- prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tbuts");
RNA_def_property_struct_type(prop, "ThemeProperties");
RNA_def_property_ui_text(prop, "Properties", "");
- prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "text");
RNA_def_property_struct_type(prop, "ThemeTextEditor");
RNA_def_property_ui_text(prop, "Text Editor", "");
- prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "ttime");
RNA_def_property_struct_type(prop, "ThemeTimeline");
RNA_def_property_ui_text(prop, "Timeline", "");
- prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tnode");
RNA_def_property_struct_type(prop, "ThemeNodeEditor");
RNA_def_property_ui_text(prop, "Node Editor", "");
- prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tlogic");
RNA_def_property_struct_type(prop, "ThemeLogicEditor");
RNA_def_property_ui_text(prop, "Logic Editor", "");
- prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "toops");
RNA_def_property_struct_type(prop, "ThemeOutliner");
RNA_def_property_ui_text(prop, "Outliner", "");
- prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tinfo");
RNA_def_property_struct_type(prop, "ThemeInfo");
RNA_def_property_ui_text(prop, "Info", "");
- prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
RNA_def_property_struct_type(prop, "ThemeUserPreferences");
RNA_def_property_ui_text(prop, "User Preferences", "");
- prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_collection_sdna(prop, NULL, "tarm", "");
RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
RNA_def_property_ui_text(prop, "Bone Color Sets", "");
@@ -1531,6 +1563,16 @@ static void rna_def_userdef_view(BlenderRNA *brna)
{USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement."},
{USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center."},
{0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem select_mouse_items[] = {
+ {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection."},
+ {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem middle_mouse_mouse_items[] = {
+ {0, "PAN", 0, "Pan", "Use the middle mouse button for panning the viewport."},
+ {USER_VIEWMOVE, "ROTATE", 0, "Rotate", "Use the middle mouse button for rotation the viewport."},
+ {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem view_rotation_items[] = {
{0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport."},
@@ -1646,15 +1688,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the orbiting center.");
/* select with */
- prop= RNA_def_property(srna, "left_mouse_button_select", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_LMOUSESELECT);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_userdef_lmb_select_set");
- RNA_def_property_ui_text(prop, "Left Mouse Button Select", "Use left Mouse Button for selection.");
- prop= RNA_def_property(srna, "right_mouse_button_select", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_LMOUSESELECT);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_userdef_rmb_select_set");
- RNA_def_property_ui_text(prop, "Right Mouse Button Select", "Use Right Mouse Button for selection.");
+ prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, select_mouse_items);
+ RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection.");
prop= RNA_def_property(srna, "emulate_3_button_mouse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
@@ -1683,13 +1721,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* middle mouse button */
- prop= RNA_def_property(srna, "middle_mouse_rotate", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_VIEWMOVE);
- RNA_def_property_ui_text(prop, "Middle Mouse Rotate", "Use the middle mouse button for rotation the viewport.");
-
- prop= RNA_def_property(srna, "middle_mouse_pan", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_VIEWMOVE);
- RNA_def_property_ui_text(prop, "Middle Mouse Pan", "Use the middle mouse button for panning the viewport.");
+
+ prop= RNA_def_property(srna, "middle_mouse", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, middle_mouse_mouse_items);
+ RNA_def_property_ui_text(prop, "Middle Mouse", "Use the middle mouse button to pan or zoom the view.");
prop= RNA_def_property(srna, "wheel_invert_zoom", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
@@ -1766,28 +1802,38 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
{BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""},
{0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem material_link_items[]= {
+ {0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block."},
+ {USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static const EnumPropertyItem object_align_items[]= {
+ {0, "WORLD", 0, "World", "Align newly added objects facing the 3D View direction"},
+ {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects to the world coordinates"},
+ {0, NULL, 0, NULL, NULL}};
+
+
srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data.");
/* Edit Methods */
- prop= RNA_def_property(srna, "material_linked_object", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_MAT_ON_OB);
- RNA_def_property_ui_text(prop, "Material Linked Object", "Toggle whether the material is linked to object data or the object block.");
-
- prop= RNA_def_property(srna, "material_linked_obdata", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_MAT_ON_OB);
- RNA_def_property_ui_text(prop, "Material Linked ObData", "Toggle whether the material is linked to object data or the object block.");
+
+ prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, material_link_items);
+ RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block");
+
+ prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, object_align_items);
+ RNA_def_property_ui_text(prop, "Align Object To", "Align newly added objects facing the 3D View direction or the world coordinates");
prop= RNA_def_property(srna, "enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE);
RNA_def_property_ui_text(prop, "Enter Edit Mode", "Enter Edit Mode automatically after adding a new object.");
- prop= RNA_def_property(srna, "align_to_view", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_VIEWALIGNED);
- RNA_def_property_ui_text(prop, "Align To View", "Align newly added objects facing the 3D View direction.");
-
prop= RNA_def_property(srna, "drag_immediately", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_DRAGIMMEDIATE);
RNA_def_property_ui_text(prop, "Drag Immediately", "Moving things with a mouse drag doesn't require a click to confirm (Best for tablet users).");
@@ -1917,87 +1963,6 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object.");
}
-static void rna_def_userdef_language(BlenderRNA *brna)
-{
- PropertyRNA *prop;
- StructRNA *srna;
-
- /* hardcoded here, could become dynamic somehow */
- static EnumPropertyItem language_items[] = {
- {0, "ENGLISH", 0, "English", ""},
- {1, "JAPANESE", 0, "Japanese", ""},
- {2, "DUTCH", 0, "Dutch", ""},
- {3, "ITALIAN", 0, "Italian", ""},
- {4, "GERMAN", 0, "German", ""},
- {5, "FINNISH", 0, "Finnish", ""},
- {6, "SWEDISH", 0, "Swedish", ""},
- {7, "FRENCH", 0, "French", ""},
- {8, "SPANISH", 0, "Spanish", ""},
- {9, "CATALAN", 0, "Catalan", ""},
- {10, "CZECH", 0, "Czech", ""},
- {11, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese", ""},
- {12, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese", ""},
- {13, "RUSSIAN", 0, "Russian", ""},
- {14, "CROATIAN", 0, "Croatian", ""},
- {15, "SERBIAN", 0, "Serbian", ""},
- {16, "UKRAINIAN", 0, "Ukrainian", ""},
- {17, "POLISH", 0, "Polish", ""},
- {18, "ROMANIAN", 0, "Romanian", ""},
- {19, "ARABIC", 0, "Arabic", ""},
- {20, "BULGARIAN", 0, "Bulgarian", ""},
- {21, "GREEK", 0, "Greek", ""},
- {22, "KOREAN", 0, "Korean", ""},
- {0, NULL, 0, NULL, NULL}};
-
- srna= RNA_def_struct(brna, "UserPreferencesLanguage", NULL);
- RNA_def_struct_sdna(srna, "UserDef");
- RNA_def_struct_nested(brna, srna, "UserPreferences");
- RNA_def_struct_ui_text(srna, "Language & Font", "User interface translation settings.");
-
- prop= RNA_def_property(srna, "international_fonts", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
- RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts.");
- RNA_def_property_update(prop, 0, "rna_userdef_update");
-
- prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "dpi");
- RNA_def_property_range(prop, 48, 128);
- RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display.");
- RNA_def_property_update(prop, 0, "rna_userdef_update");
-
- prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_sdna(prop, NULL, "scrollback");
- RNA_def_property_range(prop, 32, 32768);
- RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer.");
-
- /* Language Selection */
-
- prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, language_items);
- RNA_def_property_ui_text(prop, "Language", "Language use for translation.");
- RNA_def_property_update(prop, 0, "rna_userdef_update");
-
- prop= RNA_def_property(srna, "translate_tooltips", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
- RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips.");
- RNA_def_property_update(prop, 0, "rna_userdef_update");
-
- prop= RNA_def_property(srna, "translate_buttons", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS);
- RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels.");
- RNA_def_property_update(prop, 0, "rna_userdef_update");
-
- prop= RNA_def_property(srna, "translate_toolbox", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS);
- RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu.");
- RNA_def_property_update(prop, 0, "rna_userdef_update");
-
- prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT);
- RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts.");
- RNA_def_property_update(prop, 0, "rna_userdef_update");
-}
-
static void rna_def_userdef_system(BlenderRNA *brna)
{
PropertyRNA *prop;
@@ -2073,12 +2038,84 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws."},
{USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails."},
{0, NULL, 0, NULL, NULL}};
+
+ /* hardcoded here, could become dynamic somehow */
+ static EnumPropertyItem language_items[] = {
+ {0, "ENGLISH", 0, "English", ""},
+ {1, "JAPANESE", 0, "Japanese", ""},
+ {2, "DUTCH", 0, "Dutch", ""},
+ {3, "ITALIAN", 0, "Italian", ""},
+ {4, "GERMAN", 0, "German", ""},
+ {5, "FINNISH", 0, "Finnish", ""},
+ {6, "SWEDISH", 0, "Swedish", ""},
+ {7, "FRENCH", 0, "French", ""},
+ {8, "SPANISH", 0, "Spanish", ""},
+ {9, "CATALAN", 0, "Catalan", ""},
+ {10, "CZECH", 0, "Czech", ""},
+ {11, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese", ""},
+ {12, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese", ""},
+ {13, "RUSSIAN", 0, "Russian", ""},
+ {14, "CROATIAN", 0, "Croatian", ""},
+ {15, "SERBIAN", 0, "Serbian", ""},
+ {16, "UKRAINIAN", 0, "Ukrainian", ""},
+ {17, "POLISH", 0, "Polish", ""},
+ {18, "ROMANIAN", 0, "Romanian", ""},
+ {19, "ARABIC", 0, "Arabic", ""},
+ {20, "BULGARIAN", 0, "Bulgarian", ""},
+ {21, "GREEK", 0, "Greek", ""},
+ {22, "KOREAN", 0, "Korean", ""},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings.");
+ /* Language */
+
+ prop= RNA_def_property(srna, "international_fonts", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
+ RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts.");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "dpi");
+ RNA_def_property_range(prop, 48, 128);
+ RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display.");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "scrollback");
+ RNA_def_property_range(prop, 32, 32768);
+ RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer.");
+
+ /* Language Selection */
+
+ prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, language_items);
+ RNA_def_property_ui_text(prop, "Language", "Language use for translation.");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop= RNA_def_property(srna, "translate_tooltips", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
+ RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips.");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop= RNA_def_property(srna, "translate_buttons", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS);
+ RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels.");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop= RNA_def_property(srna, "translate_toolbox", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS);
+ RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu.");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT);
+ RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts.");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
/* System & OpenGL */
prop= RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
@@ -2090,7 +2127,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
RNA_def_property_ui_text(prop, "Use Weight Color Range", "Enable color range used for weight visualization in weight painting mode.");
- prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Weight Color Range", "Color range used for weight visualization in weight painting mode.");
@@ -2126,14 +2164,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_SOUND);
RNA_def_property_ui_text(prop, "Game Sound", "Enables sounds to be played in games.");
- prop= RNA_def_property(srna, "filter_file_extensions", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
- RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window.");
-
- prop= RNA_def_property(srna, "hide_dot_files_datablocks", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
- RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)");
-
prop= RNA_def_property(srna, "clip_alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -2217,7 +2247,15 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files.");
-
+
+ prop= RNA_def_property(srna, "hide_dot_files_datablocks", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
+ RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)");
+
+ prop= RNA_def_property(srna, "filter_file_extensions", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
+ RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window.");
+
prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector.");
@@ -2296,10 +2334,9 @@ void RNA_def_userdef(BlenderRNA *brna)
static EnumPropertyItem user_pref_sections[] = {
{0, "VIEW_CONTROLS", 0, "View", ""},
{1, "EDIT_METHODS", 0, "Editing", ""},
- {2, "LANGUAGE_COLORS", 0, "Language", ""},
+ {2, "FILE_PATHS", 0, "File", ""},
{3, "SYSTEM_OPENGL", 0, "System", ""},
- {4, "FILE_PATHS", 0, "File", ""},
- {5, "THEMES", 0, "Themes", ""},
+// {4, "THEMES", 0, "Themes", ""}, // Leave this out until we figure out a way to manage themes in the prefs.
{0, NULL, 0, NULL, NULL}};
rna_def_userdef_dothemes(brna);
@@ -2325,34 +2362,32 @@ void RNA_def_userdef(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Styles", "");
/* nested structs */
- prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesView");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL);
RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data.");
- prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesEdit");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data.");
- prop= RNA_def_property(srna, "language", PROP_POINTER, PROP_NEVER_NULL);
- RNA_def_property_struct_type(prop, "UserPreferencesLanguage");
- RNA_def_property_pointer_funcs(prop, "rna_UserDef_language_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Language & Font", "User interface translation settings.");
-
- prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesFilePaths");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL);
RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files.");
- prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesSystem");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL);
RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings.");
rna_def_userdef_view(brna);
rna_def_userdef_edit(brna);
- rna_def_userdef_language(brna);
rna_def_userdef_filepaths(brna);
rna_def_userdef_system(brna);
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index af3ac4a0a82..0dd9e3aed42 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -46,6 +46,8 @@ EnumPropertyItem event_type_items[] = {
{LEFTMOUSE, "LEFTMOUSE", 0, "Left Mouse", ""},
{MIDDLEMOUSE, "MIDDLEMOUSE", 0, "Middle Mouse", ""},
{RIGHTMOUSE, "RIGHTMOUSE", 0, "Right Mouse", ""},
+ {BUTTON4MOUSE, "BUTTON4MOUSE", 0, "Button4 Mouse", ""},
+ {BUTTON5MOUSE, "BUTTON5MOUSE", 0, "Button5 Mouse", ""},
{ACTIONMOUSE, "ACTIONMOUSE", 0, "Action Mouse", ""},
{SELECTMOUSE, "SELECTMOUSE", 0, "Select Mouse", ""},
@@ -197,7 +199,7 @@ static StructRNA *rna_OperatorProperties_refine(PointerRNA *ptr)
return ptr->type;
}
-IDProperty *rna_OperatorProperties_idproperties(PointerRNA *ptr, int create)
+static IDProperty *rna_OperatorProperties_idproperties(PointerRNA *ptr, int create)
{
if(create && !ptr->data) {
IDPropertyTemplate val = {0};
@@ -278,7 +280,8 @@ static void rna_def_operator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "OperatorProperties");
RNA_def_property_ui_text(prop, "Properties", "");
RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL);
@@ -404,7 +407,8 @@ static void rna_def_window(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Window", "Open window.");
RNA_def_struct_sdna(srna, "wmWindow");
- prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Screen");
RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the window.");
RNA_def_property_flag(prop, PROP_EDITABLE);
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index 0ed5016ccd2..b2ed90eef03 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -34,14 +34,17 @@
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
-#include "WM_types.h"
-
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_texture.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static PointerRNA rna_World_ambient_occlusion_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_WorldAmbientOcclusion, ptr->id.data);
@@ -95,6 +98,22 @@ static void rna_World_active_texture_set(PointerRNA *ptr, PointerRNA value)
}
}
+static void rna_World_update(bContext *C, PointerRNA *ptr)
+{
+ World *wo= ptr->id.data;
+
+ DAG_id_flush_update(&wo->id, 0);
+ WM_event_add_notifier(C, NC_WORLD, wo);
+}
+
+static void rna_World_draw_update(bContext *C, PointerRNA *ptr)
+{
+ World *wo= ptr->id.data;
+
+ DAG_id_flush_update(&wo->id, 0);
+ WM_event_add_notifier(C, NC_WORLD|ND_WORLD_DRAW, wo);
+}
+
#else
static void rna_def_world_mtex(BlenderRNA *brna)
@@ -119,22 +138,22 @@ static void rna_def_world_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "map_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_BLEND);
RNA_def_property_ui_text(prop, "Blend", "Affect the color progression of the background.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "map_horizon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_HORIZ);
RNA_def_property_ui_text(prop, "Horizon", "Affect the color of the horizon.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "map_zenith_up", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENUP);
RNA_def_property_ui_text(prop, "Zenith Up", "Affect the color of the zenith above.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "map_zenith_down", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENDOWN);
RNA_def_property_ui_text(prop, "Zenith Down", "Affect the color of the zenith below.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* unused
prop= RNA_def_property(srna, "map_mist", PROP_BOOLEAN, PROP_NONE);
@@ -145,38 +164,38 @@ static void rna_def_world_mtex(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, texco_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used to map the texture onto the background.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "blendfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Blend Factor", "Amount texture affects color progression of the background.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Horizon Factor", "Amount texture affects color of the horizon.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "zenupfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Up Factor", "Amount texture affects color of the zenith above.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "zendownfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Down Factor", "Amount texture affects color of the zenith below.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
}
static void rna_def_ambient_occlusion(BlenderRNA *brna)
@@ -215,83 +234,100 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_AMB_OCC);
RNA_def_property_ui_text(prop, "Enabled", "Use Ambient Occlusion to add light based on distance between elements, creating the illusion of omnipresent light");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "aodist");
RNA_def_property_ui_text(prop, "Distance", "Length of rays, defines how far away other faces give occlusion effect.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aodistfac");
RNA_def_property_ui_text(prop, "Strength", "Distance attenuation factor, the higher, the 'shorter' the shadows.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aoenergy");
RNA_def_property_ui_range(prop, 0, 10, 0.1, 3);
RNA_def_property_ui_text(prop, "Energy", "Amount of enerygy generated by ambient occlusion.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aobias");
RNA_def_property_range(prop, 0, 0.5);
RNA_def_property_ui_text(prop, "Bias", "Bias (in radians) to prevent smoothed faces from showing banding (for Raytrace Constant Jittered).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_thresh");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Threshold", "Samples below this threshold will be considered fully shadowed/unshadowed and skipped (for Raytrace Adaptive QMC).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "adapt_to_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_speed_fac");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Adapt To Speed", "Use the speed vector pass to reduce AO samples in fast moving pixels. Higher values result in more aggressive sample reduction. Requires Vec pass enabled (for Raytrace Adaptive QMC).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "error_tolerance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_approx_error");
RNA_def_property_range(prop, 0.0001, 10);
RNA_def_property_ui_text(prop, "Error Tolerance", "Low values are slower and higher quality (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_approx_correction");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
RNA_def_property_ui_text(prop, "Correction", "Ad-hoc correction for over-occlusion due to the approximation (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AODIST);
RNA_def_property_ui_text(prop, "Falloff", "");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "pixel_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AOCACHE);
RNA_def_property_ui_text(prop, "Pixel Cache", "Cache AO results in pixels and interpolate over neighbouring pixels for speedup (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "aosamp");
RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "Samples", "Amount of ray samples. Higher values give smoother results and longer rendering times");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aomix");
RNA_def_property_enum_items(prop, blend_mode_items);
RNA_def_property_ui_text(prop, "Blend Mode", "Defines how AO mixes with material shading.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "color", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aocolor");
RNA_def_property_enum_items(prop, prop_color_items);
RNA_def_property_ui_text(prop, "Color", "Defines the color of the AO light");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "sample_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ao_samp_method");
RNA_def_property_enum_items(prop, prop_sample_method_items);
RNA_def_property_ui_text(prop, "Sample Method", "Method for generating shadow samples (for Raytrace).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "gather_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ao_gather_method");
RNA_def_property_enum_items(prop, prop_gather_method_items);
RNA_def_property_ui_text(prop, "Gather Method", "");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "passes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ao_approx_passes");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce overocclusion (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
}
static void rna_def_world_mist(BlenderRNA *brna)
@@ -313,35 +349,39 @@ static void rna_def_world_mist(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST);
RNA_def_property_ui_text(prop, "Enabled", "Occlude objects with the environment color as they are further away.");
+ RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "misi");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Intensity", "Intensity of the mist effect.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "miststa");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "mistdist");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Depth", "The distance over which the mist effect fades in");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "misthi");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mistype");
RNA_def_property_enum_items(prop, falloff_items);
RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist");
+ RNA_def_property_update(prop, 0, "rna_World_update");
}
static void rna_def_world_stars(BlenderRNA *brna)
@@ -357,37 +397,38 @@ static void rna_def_world_stars(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS);
RNA_def_property_ui_text(prop, "Enabled", "Enable starfield generation.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "starsize");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "starmindist");
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance to the camera for stars.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "average_separation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stardist");
RNA_def_property_range(prop, 2, 1000);
RNA_def_property_ui_text(prop, "Average Separation", "Average distance between any two stars.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "color_randomization", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "starcolnoise");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* unused
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "starr");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Color", "Stars color.");*/
+ RNA_def_property_ui_text(prop, "Color", "Stars color.");
+ RNA_def_property_update(prop, 0, "rna_World_update");*/
}
void RNA_def_world(BlenderRNA *brna)
@@ -412,65 +453,71 @@ void RNA_def_world(BlenderRNA *brna)
rna_def_animdata_common(srna);
rna_def_mtex_common(srna, "rna_World_mtex_begin", "rna_World_active_texture_get",
- "rna_World_active_texture_set", "WorldTextureSlot");
+ "rna_World_active_texture_set", "WorldTextureSlot", "rna_World_update");
/* colors */
prop= RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "horr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "zenr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "ambr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Ambient Color", "");
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* exp, range */
prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "exp");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "range");
RNA_def_property_range(prop, 0.2, 5.0);
RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* sky type */
prop= RNA_def_property(srna, "blend_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND);
RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "paper_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER);
RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "real_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL);
RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* nested structs */
- prop= RNA_def_property(srna, "ambient_occlusion", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "ambient_occlusion", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldAmbientOcclusion");
RNA_def_property_pointer_funcs(prop, "rna_World_ambient_occlusion_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Ambient Occlusion", "World ambient occlusion settings.");
- prop= RNA_def_property(srna, "mist", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "mist", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldMistSettings");
RNA_def_property_pointer_funcs(prop, "rna_World_mist_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Mist", "World mist settings.");
- prop= RNA_def_property(srna, "stars", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "stars", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldStarsSettings");
RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Stars", "World stars settings.");