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.txt65
-rw-r--r--source/blender/makesrna/intern/Makefile22
-rw-r--r--source/blender/makesrna/intern/SConscript18
-rw-r--r--source/blender/makesrna/intern/makesrna.c31
-rw-r--r--source/blender/makesrna/intern/rna_ID.c20
-rw-r--r--source/blender/makesrna/intern/rna_access.c213
-rw-r--r--source/blender/makesrna/intern/rna_action.c232
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c1050
-rw-r--r--source/blender/makesrna/intern/rna_actuator_api.c72
-rw-r--r--source/blender/makesrna/intern/rna_animation.c64
-rw-r--r--source/blender/makesrna/intern/rna_animation_api.c4
-rw-r--r--source/blender/makesrna/intern/rna_animviz.c39
-rw-r--r--source/blender/makesrna/intern/rna_armature.c108
-rw-r--r--source/blender/makesrna/intern/rna_boid.c69
-rw-r--r--source/blender/makesrna/intern/rna_brush.c540
-rw-r--r--source/blender/makesrna/intern/rna_camera.c41
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c14
-rw-r--r--source/blender/makesrna/intern/rna_color.c159
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c223
-rw-r--r--source/blender/makesrna/intern/rna_context.c42
-rw-r--r--source/blender/makesrna/intern/rna_controller.c145
-rw-r--r--source/blender/makesrna/intern/rna_controller_api.c81
-rw-r--r--source/blender/makesrna/intern/rna_curve.c340
-rw-r--r--source/blender/makesrna/intern/rna_define.c150
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c299
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c37
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c48
-rw-r--r--source/blender/makesrna/intern/rna_group.c3
-rw-r--r--source/blender/makesrna/intern/rna_image.c56
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c50
-rw-r--r--source/blender/makesrna/intern/rna_internal.h25
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_key.c8
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c43
-rw-r--r--source/blender/makesrna/intern/rna_lattice.c67
-rw-r--r--source/blender/makesrna/intern/rna_main.c32
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c356
-rw-r--r--source/blender/makesrna/intern/rna_material.c210
-rw-r--r--source/blender/makesrna/intern/rna_material_api.c9
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c487
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c33
-rw-r--r--source/blender/makesrna/intern/rna_meta.c185
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c336
-rw-r--r--source/blender/makesrna/intern/rna_nla.c28
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c187
-rw-r--r--source/blender/makesrna/intern/rna_object.c575
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c109
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c229
-rw-r--r--source/blender/makesrna/intern/rna_particle.c386
-rw-r--r--source/blender/makesrna/intern/rna_pose.c150
-rw-r--r--source/blender/makesrna/intern/rna_property.c17
-rw-r--r--source/blender/makesrna/intern/rna_render.c4
-rw-r--r--source/blender/makesrna/intern/rna_rna.c53
-rw-r--r--source/blender/makesrna/intern/rna_scene.c784
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c24
-rw-r--r--source/blender/makesrna/intern/rna_screen.c14
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c180
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c396
-rw-r--r--source/blender/makesrna/intern/rna_sensor_api.c72
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c470
-rw-r--r--source/blender/makesrna/intern/rna_sequencer_api.c72
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c86
-rw-r--r--source/blender/makesrna/intern/rna_sound.c12
-rw-r--r--source/blender/makesrna/intern/rna_space.c588
-rw-r--r--source/blender/makesrna/intern/rna_text.c46
-rw-r--r--source/blender/makesrna/intern/rna_texture.c169
-rw-r--r--source/blender/makesrna/intern/rna_timeline.c4
-rw-r--r--source/blender/makesrna/intern/rna_ui.c74
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c64
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c269
-rw-r--r--source/blender/makesrna/intern/rna_vfont.c6
-rw-r--r--source/blender/makesrna/intern/rna_wm.c136
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c4
-rw-r--r--source/blender/makesrna/intern/rna_world.c65
74 files changed, 7965 insertions, 3336 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 58931165638..9dbb2fd00aa 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -32,14 +32,30 @@ LIST(REMOVE_ITEM DEFSRC ${APISRC})
STRING(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
SET(SRC
- makesrna.c
- rna_define.c
- ${DEFSRC}
- ${APISRC}
- ../../../../intern/guardedalloc/intern/mallocn.c
- ../../../../intern/guardedalloc/intern/mmap_win.c)
-
-INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../ikplugin ../../windowmanager ../../editors/include ../../gpu ../../imbuf ../../render/extern/include .)
+ makesrna.c
+ rna_define.c
+ ${DEFSRC}
+ ${APISRC}
+ ../../../../intern/guardedalloc/intern/mallocn.c
+ ../../../../intern/guardedalloc/intern/mmap_win.c)
+
+INCLUDE_DIRECTORIES(
+ ../../../../intern/audaspace/intern
+ ../../../../intern/guardedalloc
+ ../../../../intern/memutil
+ ..
+ ../../makesdna
+ ../../blenkernel
+ ../../blenlib
+ ../../ikplugin
+ ../../windowmanager
+ ../../editors/include
+ ../../gpu
+ ../../imbuf
+ ../../render/extern/include
+ ../../../../extern/glew/include
+ . )
+
FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
IF(NOT WITH_PYTHON)
@@ -54,17 +70,29 @@ IF(WITH_GAMEENGINE)
ADD_DEFINITIONS(-DGAMEBLENDER)
ENDIF(WITH_GAMEENGINE)
-IF(WITH_OPENEXR)
+IF(WITH_IMAGE_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR)
-ENDIF(WITH_OPENEXR)
+ENDIF(WITH_IMAGE_OPENEXR)
+
+IF(WITH_IMAGE_TIFF)
+ ADD_DEFINITIONS(-DWITH_TIFF)
+ENDIF(WITH_IMAGE_TIFF)
-IF(WITH_OPENJPEG)
+IF(WITH_IMAGE_OPENJPEG)
ADD_DEFINITIONS(-DWITH_OPENJPEG)
-ENDIF(WITH_OPENJPEG)
+ENDIF(WITH_IMAGE_OPENJPEG)
-IF(WITH_DDS)
+IF(WITH_IMAGE_DDS)
ADD_DEFINITIONS(-DWITH_DDS)
-ENDIF(WITH_DDS)
+ENDIF(WITH_IMAGE_DDS)
+
+IF(WITH_IMAGE_CINEON)
+ ADD_DEFINITIONS(-DWITH_CINEON)
+ENDIF(WITH_IMAGE_CINEON)
+
+IF(WITH_IMAGE_HDR)
+ ADD_DEFINITIONS(-DWITH_HDR)
+ENDIF(WITH_IMAGE_HDR)
IF(WITH_QUICKTIME)
SET(INC ${INC} ../../quicktime)
@@ -76,9 +104,14 @@ IF(WITH_FFMPEG)
ADD_DEFINITIONS(-DWITH_FFMPEG)
ENDIF(WITH_FFMPEG)
-IF(NOT WITH_ELBEEM)
+IF(WITH_LCMS)
+ SET(INC ${INC} ${LCMS_INCLUDE_DIR})
+ ADD_DEFINITIONS(-DWITH_LCMS)
+ENDIF(WITH_LCMS)
+
+IF(NOT WITH_FLUID)
ADD_DEFINITIONS(-DDISABLE_ELBEEM)
-ENDIF(NOT WITH_ELBEEM)
+ENDIF(NOT WITH_FLUID)
IF(WITH_FFTW3)
ADD_DEFINITIONS(-DFFTW3=1)
diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile
index 5afe55bb319..69d5581184d 100644
--- a/source/blender/makesrna/intern/Makefile
+++ b/source/blender/makesrna/intern/Makefile
@@ -15,7 +15,7 @@
#
# 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.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Blender Foundation (2008).
#
@@ -45,7 +45,11 @@ endif
CFLAGS += $(LEVEL_1_C_WARNINGS)
+CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
+
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+CPPFLAGS += -I$(NAN_MEMUTIL)/include
+CPPFLAGS += -I../../../../intern/audaspace/intern
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../imbuf
@@ -91,6 +95,22 @@ ifeq ($(WITH_OPENAL),true)
CPPFLAGS += -DWITH_OPENAL
endif
+ifeq ($(WITH_TIFF),true)
+ CPPFLAGS += -DWITH_TIFF
+endif
+
+ifeq ($(WITH_LCMS),true)
+ CPPFLAGS += -DWITH_LCMS
+endif
+
+ifeq ($(WITH_CINEON),true)
+ CPPFLAGS += -DWITH_CINEON
+endif
+
+ifeq ($(WITH_HDR),true)
+ CPPFLAGS += -DWITH_HDR
+endif
+
ifeq ($(OS),windows)
# Windows needs these extra libs because of winstuff... It is not
# _really_ needed, but it is the easiest fix for now. If you have
diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript
index b63a816edfb..32ff64e609f 100644
--- a/source/blender/makesrna/intern/SConscript
+++ b/source/blender/makesrna/intern/SConscript
@@ -33,16 +33,26 @@ incs = '#/intern/guardedalloc ../../blenlib ../../blenkernel'
incs += ' ../../imbuf ../../makesdna ../../makesrna ../../ikplugin'
incs += ' ../../windowmanager ../../editors/include'
incs += ' ../../render/extern/include'
+incs += ' #/intern/audaspace/intern '
if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR')
+if env['WITH_BF_TIFF']:
+ defs.append('WITH_TIFF')
+
if env['WITH_BF_OPENJPEG']:
defs.append('WITH_OPENJPEG')
if env['WITH_BF_DDS']:
defs.append('WITH_DDS')
+if env['WITH_BF_CINEON']:
+ defs.append('WITH_CINEON')
+
+if env['WITH_BF_HDR']:
+ defs.append('WITH_HDR')
+
if env['WITH_BF_FFMPEG']:
defs.append('WITH_FFMPEG')
incs += ' ' + env['BF_FFMPEG_INC']
@@ -80,7 +90,7 @@ if not env['WITH_BF_PYTHON']:
if env['OURPLATFORM'] == 'linux2':
cflags='-pthread'
- incs += ' ../../../extern/binreloc/include'
+ incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
@@ -128,9 +138,9 @@ if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
targetpath = '#' + targetpath
if env['OURPLATFORM'] == 'linux2' and root_build_dir[0]==os.sep:
- makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_guardedalloc', 'bf_dna', 'bf_blenlib'])
+ makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_intern_guardedalloc', 'bf_dna', 'bf_blenlib'])
else:
- makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_guardedalloc', 'bf_dna', 'bf_blenlib'])
+ makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_intern_guardedalloc', 'bf_dna', 'bf_blenlib'])
rna_dict = rna.Dictionary()
rna.Depends (generated_files, makesrna)
@@ -142,7 +152,7 @@ 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 )
else:
- rna.Command (generated_files, '', root_build_dir+os.sep+"makesrna " + build_dir)
+ rna.Command (generated_files, '', "\"" + root_build_dir+os.sep+"makesrna\" \"" + build_dir + '"' )
else:
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 c9db05c30b1..af0faf5a165 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -30,7 +30,9 @@
#include "MEM_guardedalloc.h"
+#include "RNA_access.h"
#include "RNA_define.h"
+#include "RNA_types.h"
#include "rna_internal.h"
@@ -80,6 +82,7 @@ static int replace_if_different(char *tmpfile)
if(fp_new==NULL) {
/* shouldn't happen, just to be safe */
fprintf(stderr, "%s:%d, open error: \"%s\"\n", __FILE__, __LINE__, tmpfile);
+ fclose(fp_org);
return -1;
}
@@ -483,13 +486,13 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
if(dp->dnaarraylength == 1) {
if(prop->type == PROP_BOOLEAN && dp->booleanbit)
- fprintf(f, " values[i]= (%s(data->%s & (%d<<i)) != 0);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
+ fprintf(f, " values[i]= %s((data->%s & (%d<<i)) != 0);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
else
fprintf(f, " values[i]= (%s)%s((&data->%s)[i]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname);
}
else {
if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
- fprintf(f, " values[i]= (%s(data->%s[i] & ", (dp->booleannegative)? "!": "", dp->dnaname);
+ fprintf(f, " values[i]= %s((data->%s[i] & ", (dp->booleannegative)? "!": "", dp->dnaname);
rna_int_print(f, dp->booleanbit);
fprintf(f, ") != 0);\n");
}
@@ -514,7 +517,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
else {
rna_print_data_get(f, dp);
if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
- fprintf(f, " return (%s((data->%s) & ", (dp->booleannegative)? "!": "", dp->dnaname);
+ fprintf(f, " return %s(((data->%s) & ", (dp->booleannegative)? "!": "", dp->dnaname);
rna_int_print(f, dp->booleanbit);
fprintf(f, ") != 0);\n");
}
@@ -625,6 +628,14 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
fprintf(f, " if(value.data)\n");
fprintf(f, " id_us_plus((ID*)value.data);\n\n");
}
+ else {
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
+ StructRNA *type= rna_find_struct((char*)pprop->type);
+ if(type && (type->flag & STRUCT_ID)) {
+ fprintf(f, " if(value.data)\n");
+ fprintf(f, " id_lib_extern((ID*)value.data);\n\n");
+ }
+ }
fprintf(f, " data->%s= value.data;\n", dp->dnaname);
@@ -1634,7 +1645,7 @@ static const char *rna_property_typename(PropertyType type)
}
}
-static const char *rna_property_subtypename(PropertyType type)
+static const char *rna_property_subtypename(PropertySubType type)
{
switch(type) {
case PROP_NONE: return "PROP_NONE";
@@ -1684,7 +1695,7 @@ static const char *rna_property_subtype_unit(PropertyType type)
case PROP_UNIT_TIME: return "PROP_UNIT_TIME";
case PROP_UNIT_VELOCITY: return "PROP_UNIT_VELOCITY";
case PROP_UNIT_ACCELERATION:return "PROP_UNIT_ACCELERATION";
- default: return "PROP_UNKNOWN";
+ default: return "PROP_UNIT_UNKNOWN";
}
}
@@ -2077,7 +2088,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
}
case PROP_POINTER: {
PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
- fprintf(f, "\t%s, %s, %s, ", rna_function_string(pprop->get), rna_function_string(pprop->set), rna_function_string(pprop->typef));
+ fprintf(f, "\t%s, %s, %s, %s,", rna_function_string(pprop->get), rna_function_string(pprop->set), rna_function_string(pprop->typef), rna_function_string(pprop->poll));
if(pprop->type) fprintf(f, "&RNA_%s\n", (char*)pprop->type);
else fprintf(f, "NULL\n");
break;
@@ -2234,7 +2245,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_action.c", "rna_action_api.c", RNA_def_action},
{"rna_animation.c", "rna_animation_api.c", RNA_def_animation},
{"rna_animviz.c", NULL, RNA_def_animviz},
- {"rna_actuator.c", NULL, RNA_def_actuator},
+ {"rna_actuator.c", "rna_actuator_api.c", RNA_def_actuator},
{"rna_armature.c", "rna_armature_api.c", RNA_def_armature},
{"rna_boid.c", NULL, RNA_def_boid},
{"rna_brush.c", NULL, RNA_def_brush},
@@ -2243,7 +2254,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_color.c", NULL, RNA_def_color},
{"rna_constraint.c", NULL, RNA_def_constraint},
{"rna_context.c", NULL, RNA_def_context},
- {"rna_controller.c", NULL, RNA_def_controller},
+ {"rna_controller.c", "rna_controller_api.c", RNA_def_controller},
{"rna_curve.c", NULL, RNA_def_curve},
{"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve},
{"rna_fluidsim.c", NULL, RNA_def_fluidsim},
@@ -2270,8 +2281,8 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_scene.c", "rna_scene_api.c", RNA_def_scene},
{"rna_screen.c", NULL, RNA_def_screen},
{"rna_sculpt_paint.c", NULL, RNA_def_sculpt_paint},
- {"rna_sensor.c", NULL, RNA_def_sensor},
- {"rna_sequencer.c", NULL, RNA_def_sequencer},
+ {"rna_sensor.c", "rna_sensor_api.c", RNA_def_sensor},
+ {"rna_sequencer.c", "rna_sequencer_api.c", RNA_def_sequencer},
{"rna_smoke.c", NULL, RNA_def_smoke},
{"rna_space.c", NULL, RNA_def_space},
{"rna_test.c", NULL, RNA_def_test},
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 3263d816ad0..a8b7fb1540b 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -176,7 +176,7 @@ StructRNA *rna_ID_refine(PointerRNA *ptr)
return ID_code_to_RNA_type(GS(id->name));
}
-IDProperty *rna_ID_idproperties(PointerRNA *ptr, int create)
+IDProperty *rna_ID_idprops(PointerRNA *ptr, int create)
{
return IDP_GetProperties(ptr->data, create);
}
@@ -195,7 +195,7 @@ void rna_ID_fake_user_set(PointerRNA *ptr, int value)
}
}
-IDProperty *rna_IDPropertyGroup_idproperties(PointerRNA *ptr, int create)
+IDProperty *rna_IDPropertyGroup_idprops(PointerRNA *ptr, int create)
{
return ptr->data;
}
@@ -317,7 +317,7 @@ static void rna_def_ID_properties(BlenderRNA *brna)
* care of the properties here */
srna= RNA_def_struct(brna, "IDPropertyGroup", NULL);
RNA_def_struct_ui_text(srna, "ID Property Group", "Group of ID properties");
- RNA_def_struct_idproperties_func(srna, "rna_IDPropertyGroup_idproperties");
+ RNA_def_struct_idprops_func(srna, "rna_IDPropertyGroup_idprops");
RNA_def_struct_register_funcs(srna, "rna_IDPropertyGroup_register", "rna_IDPropertyGroup_unregister");
RNA_def_struct_refine_func(srna, "rna_IDPropertyGroup_refine");
@@ -341,7 +341,7 @@ static void rna_def_ID(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection");
RNA_def_struct_flag(srna, STRUCT_ID|STRUCT_ID_REFCOUNT);
RNA_def_struct_refine_func(srna, "rna_ID_refine");
- RNA_def_struct_idproperties_func(srna, "rna_ID_idproperties");
+ RNA_def_struct_idprops_func(srna, "rna_ID_idprops");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name");
@@ -356,7 +356,7 @@ static void rna_def_ID(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Users", "Number of times this datablock is referenced");
- prop= RNA_def_property(srna, "fake_user", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_fake_user", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_FAKEUSER);
RNA_def_property_ui_text(prop, "Fake User", "Saves this datablock even if it has no users");
RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_fake_user_set");
@@ -399,10 +399,14 @@ static void rna_def_library(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Library", "External .blend file from which data is linked");
RNA_def_struct_ui_icon(srna, ICON_LIBRARY_DATA_DIRECT);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Filename", "Path to the library .blend file");
+ RNA_def_property_ui_text(prop, "File Path", "Path to the library .blend file");
+ /* TODO - lib->filename isnt updated, however the outliner also skips this, probably only needed on read. */
+
+ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Library");
+ RNA_def_property_ui_text(prop, "Parent", "");
}
void RNA_def_ID(BlenderRNA *brna)
{
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index c110b89a818..8d3d9a0c747 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -23,6 +23,7 @@
*/
#include <stdlib.h>
+#include <stddef.h>
#include <string.h>
#include <ctype.h>
@@ -64,7 +65,7 @@ void RNA_init()
for(srna=BLENDER_RNA.structs.first; srna; srna=srna->cont.next) {
if(!srna->cont.prophash) {
- srna->cont.prophash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp);
+ srna->cont.prophash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "RNA_init gh");
for(prop=srna->cont.properties.first; prop; prop=prop->next)
if(!(prop->flag & PROP_BUILTIN))
@@ -240,7 +241,7 @@ IDProperty *rna_idproperty_ui(PropertyRNA *prop)
return NULL;
}
-IDProperty *RNA_struct_idproperties(PointerRNA *ptr, int create)
+IDProperty *RNA_struct_idprops(PointerRNA *ptr, int create)
{
StructRNA *type= ptr->type;
@@ -250,22 +251,18 @@ IDProperty *RNA_struct_idproperties(PointerRNA *ptr, int create)
return NULL;
}
-int RNA_struct_idproperties_check(StructRNA *srna)
+int RNA_struct_idprops_check(StructRNA *srna)
{
return (srna && srna->idproperties) ? 1 : 0;
}
static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name)
{
- IDProperty *group= RNA_struct_idproperties(ptr, 0);
- IDProperty *idprop;
+ IDProperty *group= RNA_struct_idprops(ptr, 0);
+
+ if(group)
+ return IDP_GetPropertyFromGroup(group, name);
- if(group) {
- for(idprop=group->data.group.first; idprop; idprop=idprop->next)
- if(strcmp(idprop->name, name) == 0)
- return idprop;
- }
-
return NULL;
}
@@ -390,7 +387,7 @@ IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr)
IDProperty *idprop= rna_idproperty_find(ptr, (*prop)->identifier);
if(idprop && !rna_idproperty_verify_valid(ptr, *prop, idprop)) {
- IDProperty *group= RNA_struct_idproperties(ptr, 0);
+ IDProperty *group= RNA_struct_idprops(ptr, 0);
IDP_RemFromGroup(group, idprop);
IDP_FreeProperty(idprop);
@@ -513,6 +510,11 @@ int RNA_struct_is_ID(StructRNA *type)
return (type->flag & STRUCT_ID) != 0;
}
+int RNA_struct_idprops_register_check(StructRNA *type)
+{
+ return (type->flag & STRUCT_NO_IDPROPERTIES) == 0;
+}
+
int RNA_struct_is_a(StructRNA *type, StructRNA *srna)
{
StructRNA *base;
@@ -577,9 +579,9 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier)
FunctionRNA *func;
StructRNA *type;
for(type= ptr->type; type; type= type->base) {
- for(func= type->functions.first; func; func= func->cont.next) {
- if(strcmp(func->identifier, identifier)==0)
- return func;
+ func= (FunctionRNA *)BLI_findstring_ptr(&type->functions, identifier, offsetof(FunctionRNA, identifier));
+ if(func) {
+ return func;
}
}
return NULL;
@@ -730,7 +732,7 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index)
/* get string to use for array index */
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))
+ else if((index < 4) && ELEM7(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
return vectoritem[index];
else if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA))
return coloritem[index];
@@ -786,6 +788,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name)
return -1;
}
+
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
{
IntPropertyRNA *iprop= (IntPropertyRNA*)rna_ensure_property(prop);
@@ -960,7 +963,8 @@ int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value)
}
}
-/* this is the max length including \0 terminator */
+/* this is the max length including \0 terminator.
+ * '0' used when their is no maximum */
int RNA_property_string_maxlength(PropertyRNA *prop)
{
StringPropertyRNA *sprop= (StringPropertyRNA*)rna_ensure_property(prop);
@@ -989,6 +993,22 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
return &RNA_UnknownType;
}
+int RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *value)
+{
+ prop= rna_ensure_property(prop);
+
+ if(prop->type == PROP_POINTER) {
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ if(pprop->poll)
+ return pprop->poll(ptr, *value);
+
+ return 1;
+ }
+
+ printf("RNA_property_pointer_poll %s: is not a pointer property.\n", prop->identifier);
+ return 0;
+}
+
/* Reuse for dynamic types */
EnumPropertyItem DummyRNA_NULL_items[] = {
{0, NULL, 0, NULL, NULL}
@@ -1085,6 +1105,17 @@ int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name)
return 0;
}
+int RNA_enum_description(EnumPropertyItem *item, const int value, const char **description)
+{
+ for (; item->identifier; item++) {
+ if(item->identifier[0] && item->value==value) {
+ *description = item->description;
+ return 1;
+ }
+ }
+ return 0;
+}
+
int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
{
EnumPropertyItem *item= NULL;
@@ -1101,6 +1132,22 @@ int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop
return 0;
}
+int RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name)
+{
+ EnumPropertyItem *item= NULL;
+ int result, free;
+
+ RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
+ if(item) {
+ result= RNA_enum_name(item, value, name);
+ if(free)
+ MEM_freeN(item);
+
+ return result;
+ }
+ return 0;
+}
+
int RNA_property_enum_bitflag_identifiers(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
{
EnumPropertyItem *item= NULL;
@@ -1214,7 +1261,7 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR
else {
/* WARNING! This is so property drivers update the display!
* not especially nice */
- DAG_id_flush_update(ptr->id.data, OB_RECALC);
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_ALL);
WM_main_add_notifier(NC_WINDOW, NULL);
}
@@ -1263,7 +1310,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value)
val.i= value;
- group= RNA_struct_idproperties(ptr, 1);
+ group= RNA_struct_idprops(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier));
}
@@ -1333,7 +1380,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in
val.array.len= prop->totarraylength;
val.array.type= IDP_INT;
- group= RNA_struct_idproperties(ptr, 1);
+ group= RNA_struct_idprops(ptr, 1);
if(group) {
idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier);
IDP_AddToGroup(group, idprop);
@@ -1430,7 +1477,7 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
val.i= value;
- group= RNA_struct_idproperties(ptr, 1);
+ group= RNA_struct_idprops(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier));
}
@@ -1500,7 +1547,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v
val.array.len= prop->totarraylength;
val.array.type= IDP_INT;
- group= RNA_struct_idproperties(ptr, 1);
+ group= RNA_struct_idprops(ptr, 1);
if(group) {
idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier);
IDP_AddToGroup(group, idprop);
@@ -1606,7 +1653,7 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
val.f= value;
- group= RNA_struct_idproperties(ptr, 1);
+ group= RNA_struct_idprops(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_FLOAT, val, (char*)prop->identifier));
}
@@ -1694,7 +1741,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa
val.array.len= prop->totarraylength;
val.array.type= IDP_FLOAT;
- group= RNA_struct_idproperties(ptr, 1);
+ group= RNA_struct_idprops(ptr, 1);
if(group) {
idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier);
IDP_AddToGroup(group, idprop);
@@ -1813,18 +1860,15 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val
IDProperty *idprop;
if((idprop=rna_idproperty_check(&prop, ptr)))
- IDP_AssignString(idprop, (char*)value);
+ IDP_AssignString(idprop, (char*)value, RNA_property_string_maxlength(prop) - 1);
else if(sprop->set)
- sprop->set(ptr, value);
+ sprop->set(ptr, value); /* set function needs to clamp its self */
else if(prop->flag & PROP_EDITABLE) {
- IDPropertyTemplate val = {0};
IDProperty *group;
- val.str= (char*)value;
-
- group= RNA_struct_idproperties(ptr, 1);
+ group= RNA_struct_idprops(ptr, 1);
if(group)
- IDP_AddToGroup(group, IDP_New(IDP_STRING, val, (char*)prop->identifier));
+ IDP_AddToGroup(group, IDP_NewString((char*)value, (char*)prop->identifier, RNA_property_string_maxlength(prop) - 1));
}
}
@@ -1887,7 +1931,7 @@ void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
val.i= value;
- group= RNA_struct_idproperties(ptr, 1);
+ group= RNA_struct_idprops(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier));
}
@@ -1960,7 +2004,7 @@ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
val.i= 0;
- group= RNA_struct_idproperties(ptr, 1);
+ group= RNA_struct_idprops(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_GROUP, val, (char*)prop->identifier));
}
@@ -1973,7 +2017,7 @@ void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop)
IDProperty *idprop, *group;
if((idprop=rna_idproperty_check(&prop, ptr))) {
- group= RNA_struct_idproperties(ptr, 0);
+ group= RNA_struct_idprops(ptr, 0);
if(group) {
IDP_RemFromGroup(group, idprop);
@@ -2086,7 +2130,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
IDProperty *group, *item;
IDPropertyTemplate val = {0};
- group= RNA_struct_idproperties(ptr, 1);
+ group= RNA_struct_idprops(ptr, 1);
if(group) {
idprop= IDP_NewIDPArray(prop->identifier);
IDP_AddToGroup(group, idprop);
@@ -2905,7 +2949,7 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
PropertyRNA *prop;
PointerRNA curptr, nextptr;
char fixedbuf[256], *token;
- int type, len, intkey;
+ int type, intkey;
prop= NULL;
curptr= *ptr;
@@ -2926,7 +2970,7 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
return 0;
if(use_id_prop) { /* look up property name in current struct */
- IDProperty *group= RNA_struct_idproperties(&curptr, 0);
+ IDProperty *group= RNA_struct_idprops(&curptr, 0);
if(group && rna_token_strip_quotes(token))
prop= (PropertyRNA *)IDP_GetPropertyFromGroup(group, token+1);
}
@@ -2957,33 +3001,44 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
break;
case PROP_COLLECTION:
if(*path) {
- /* resolve the lookup with [] brackets */
- token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
-
- if(!token)
- return 0;
-
- len= strlen(token);
+ if(*path == '[') {
+ /* resolve the lookup with [] brackets */
+ token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
+
+ if(!token)
+ return 0;
+
+ /* check for "" to see if it is a string */
+ if(rna_token_strip_quotes(token)) {
+ RNA_property_collection_lookup_string(&curptr, prop, token+1, &nextptr);
+ }
+ else {
+ /* otherwise do int lookup */
+ intkey= atoi(token);
+ RNA_property_collection_lookup_int(&curptr, prop, intkey, &nextptr);
+ }
- /* check for "" to see if it is a string */
- if(rna_token_strip_quotes(token)) {
- RNA_property_collection_lookup_string(&curptr, prop, token+1, &nextptr);
+ if(token != fixedbuf) {
+ MEM_freeN(token);
+ }
}
else {
- /* otherwise do int lookup */
- intkey= atoi(token);
- RNA_property_collection_lookup_int(&curptr, prop, intkey, &nextptr);
- }
+ PointerRNA c_ptr;
+
+ /* ensure we quit on invalid values */
+ nextptr.data = NULL;
- if(token != fixedbuf)
- MEM_freeN(token);
+ if(RNA_property_collection_type_get(&curptr, prop, &c_ptr)) {
+ nextptr= c_ptr;
+ }
+ }
if(nextptr.data)
curptr= nextptr;
else
return 0;
}
-
+
break;
default:
if (index==NULL)
@@ -3399,6 +3454,18 @@ int RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **ident
return 0;
}
+int RNA_enum_icon_from_value(EnumPropertyItem *item, int value, int *icon)
+{
+ for( ; item->identifier; item++) {
+ if(item->value==value) {
+ *icon = item->icon;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, name);
@@ -3538,7 +3605,8 @@ int RNA_property_is_set(PointerRNA *ptr, const char *name)
return 1;
}
else {
- // printf("RNA_property_is_set: %s.%s not found.\n", ptr->type->identifier, name);
+ /* python raises an error */
+ /* printf("RNA_property_is_set: %s.%s not found.\n", ptr->type->identifier, name); */
return 0;
}
}
@@ -3723,27 +3791,12 @@ int RNA_function_defined(FunctionRNA *func)
PropertyRNA *RNA_function_get_parameter(PointerRNA *ptr, FunctionRNA *func, int index)
{
- PropertyRNA *parm;
- int i;
-
- parm= func->cont.properties.first;
- for(i= 0; parm; parm= parm->next, i++)
- if(i==index)
- return parm;
-
- return NULL;
+ return BLI_findlink(&func->cont.properties, index);
}
PropertyRNA *RNA_function_find_parameter(PointerRNA *ptr, FunctionRNA *func, const char *identifier)
{
- PropertyRNA *parm;
-
- parm= func->cont.properties.first;
- for(; parm; parm= parm->next)
- if(strcmp(parm->identifier, identifier)==0)
- return parm;
-
- return NULL;
+ return BLI_findstring(&func->cont.properties, identifier, offsetof(PropertyRNA, identifier));
}
const struct ListBase *RNA_function_defined_parameters(FunctionRNA *func)
@@ -3759,18 +3812,18 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr,
void *data;
int alloc_size= 0, size;
- parms->arg_count= 0;
- parms->ret_count= 0;
-
+ parms->arg_count= 0;
+ parms->ret_count= 0;
+
/* allocate data */
for(parm= func->cont.properties.first; parm; parm= parm->next) {
alloc_size += rna_parameter_size_alloc(parm);
- if(parm->flag & PROP_OUTPUT)
- parms->ret_count++;
- else
- parms->arg_count++;
- }
+ if(parm->flag & PROP_OUTPUT)
+ parms->ret_count++;
+ else
+ parms->arg_count++;
+ }
parms->data= MEM_callocN(alloc_size, "RNA_parameter_list_create");
parms->func= func;
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 127aa191b5c..623717e469f 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -41,6 +41,9 @@
#ifdef RNA_RUNTIME
+#include "ED_keyframing.h"
+#include "BKE_fcurve.h"
+
static void rna_ActionGroup_channels_next(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal= iter->internal;
@@ -86,6 +89,65 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, bActionG
MEM_freeN(agrp);
}
+static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, char *data_path, int index, char *group)
+{
+ if(group && group[0]=='\0') group= NULL;
+
+ if(data_path[0] == '\0') {
+ BKE_report(reports, RPT_ERROR, "FCurve data path empty, invalid argument");
+ return NULL;
+ }
+
+ /* annoying, check if this exists */
+ if(verify_fcurve(act, group, data_path, index, 0)) {
+ BKE_reportf(reports, RPT_ERROR, "FCurve '%s[%d]' already exists in action '%s'", data_path, index, act->id.name+2);
+ return NULL;
+ }
+ return verify_fcurve(act, group, data_path, index, 1);
+}
+
+static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *fcu)
+{
+ if (fcu->grp) {
+ if (BLI_findindex(&act->groups, fcu->grp) == -1) {
+ BKE_reportf(reports, RPT_ERROR, "FCurve's ActionGroup '%s' not found in action '%s'", fcu->grp->name, act->id.name+2);
+ return;
+ }
+
+ action_groups_remove_channel(act, fcu);
+ free_fcurve(fcu);
+ }
+ else {
+ if (BLI_findindex(&act->curves, fcu) == -1) {
+ BKE_reportf(reports, RPT_ERROR, "FCurve not found in action '%s'", act->id.name+2);
+ return;
+ }
+
+ BLI_remlink(&act->curves, fcu);
+ free_fcurve(fcu);
+ }
+}
+
+static TimeMarker *rna_Action_pose_markers_new(bAction *act, ReportList *reports, char name[])
+{
+ TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
+ marker->flag= 1;
+ marker->frame= 1;
+ BLI_strncpy(marker->name, name, sizeof(marker->name));
+ BLI_addtail(&act->markers, marker);
+ return marker;
+}
+
+static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, TimeMarker *marker)
+{
+ if (!BLI_remlink_safe(&act->markers, marker)) {
+ BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in action '%s'", marker->name, act->id.name+2);
+ return;
+ }
+
+ /* XXX, invalidates PyObject */
+ MEM_freeN(marker);
+}
#else
@@ -104,129 +166,135 @@ static void rna_def_dopesheet(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Source", "ID-Block representing source data, currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil)");
/* General Filtering Settings */
- prop= RNA_def_property(srna, "only_selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYSEL);
RNA_def_property_ui_text(prop, "Only Selected", "Only include channels relating to selected objects and data");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+
+ prop= RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_INCL_HIDDEN);
+ RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that aren't visible");
+ RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* Object Group Filtering Settings */
- prop= RNA_def_property(srna, "only_group_objects", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_only_group_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYOBGROUP);
RNA_def_property_ui_text(prop, "Only Objects in Group", "Only include channels from Objects in the specified Group");
RNA_def_property_ui_icon(prop, ICON_GROUP, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "filtering_group", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "filter_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "filter_grp");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filtering Group", "Group that included Object should be a member of");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* NLA Specific Settings */
- prop= RNA_def_property(srna, "include_missing_nla", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_missing_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NLA_NOACT);
RNA_def_property_ui_text(prop, "Include Missing NLA", "Include Animation Data blocks with no NLA data. (NLA Editor only)");
RNA_def_property_ui_icon(prop, ICON_ACTION, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* Summary Settings (DopeSheet editors only) */
- prop= RNA_def_property(srna, "display_summary", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_summary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_SUMMARY);
RNA_def_property_ui_text(prop, "Display Summary", "Display an additional 'summary' line. (DopeSheet Editors only)");
RNA_def_property_ui_icon(prop, ICON_BORDERMOVE, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "collapse_summary", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_SUMMARY_COLLAPSED);
+ prop= RNA_def_property(srna, "show_expanded_summary", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADS_FLAG_SUMMARY_COLLAPSED);
RNA_def_property_ui_text(prop, "Collapse Summary", "Collapse summary when shown, so all other channels get hidden. (DopeSheet Editors Only)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* General DataType Filtering Settings */
- prop= RNA_def_property(srna, "display_transforms", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_transforms", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOOBJ);
RNA_def_property_ui_text(prop, "Display Transforms", "Include visualization of Object-level Animation data (mostly Transforms)");
RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0); // XXX?
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_shapekeys", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_shapekeys", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSHAPEKEYS);
RNA_def_property_ui_text(prop, "Display Shapekeys", "Include visualization of ShapeKey related Animation data");
RNA_def_property_ui_icon(prop, ICON_SHAPEKEY_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_meshes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMESH);
RNA_def_property_ui_text(prop, "Display Meshes", "Include visualization of Mesh related Animation data");
RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_camera", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_cameras", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCAM);
RNA_def_property_ui_text(prop, "Display Camera", "Include visualization of Camera related Animation data");
RNA_def_property_ui_icon(prop, ICON_CAMERA_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_material", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_materials", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMAT);
RNA_def_property_ui_text(prop, "Display Material", "Include visualization of Material related Animation data");
RNA_def_property_ui_icon(prop, ICON_MATERIAL_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_lamp", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_lamps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAM);
RNA_def_property_ui_text(prop, "Display Lamp", "Include visualization of Lamp related Animation data");
RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_texture", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX);
RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of Texture related Animation data");
RNA_def_property_ui_icon(prop, ICON_TEXTURE_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_curve", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_curves", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCUR);
RNA_def_property_ui_text(prop, "Display Curve", "Include visualization of Curve related Animation data");
RNA_def_property_ui_icon(prop, ICON_CURVE_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_world", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_worlds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOWOR);
RNA_def_property_ui_text(prop, "Display World", "Include visualization of World related Animation data");
RNA_def_property_ui_icon(prop, ICON_WORLD_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_scene", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_scenes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSCE);
RNA_def_property_ui_text(prop, "Display Scene", "Include visualization of Scene related Animation data");
RNA_def_property_ui_icon(prop, ICON_SCENE_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_particle", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOPART);
RNA_def_property_ui_text(prop, "Display Particle", "Include visualization of Particle related Animation data");
RNA_def_property_ui_icon(prop, ICON_PARTICLE_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_metaball", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_metaballs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMBA);
RNA_def_property_ui_text(prop, "Display Metaball", "Include visualization of Metaball related Animation data");
RNA_def_property_ui_icon(prop, ICON_META_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_armature", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_armatures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOARM);
RNA_def_property_ui_text(prop, "Display Armature", "Include visualization of Armature related Animation data");
RNA_def_property_ui_icon(prop, ICON_ARMATURE_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "display_node", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NONTREE);
RNA_def_property_ui_text(prop, "Display Node", "Include visualization of Node related Animation data");
RNA_def_property_ui_icon(prop, ICON_NODETREE, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
}
static void rna_def_action_group(BlenderRNA *brna)
@@ -241,7 +309,7 @@ static void rna_def_action_group(BlenderRNA *brna)
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* WARNING: be very careful when working with this list, since the endpoint is not
* defined like a standard ListBase. Adding/removing channels from this list needs
@@ -259,25 +327,25 @@ static void rna_def_action_group(BlenderRNA *brna)
RNA_def_property_collection_funcs(prop, 0, "rna_ActionGroup_channels_next", 0, 0, 0, 0, 0);
RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED);
- RNA_def_property_ui_text(prop, "Selected", "Action Group is selected");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_SELECT, NULL);
+ RNA_def_property_ui_text(prop, "Select", "Action Group is selected");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED);
- RNA_def_property_ui_text(prop, "Locked", "Action Group is locked");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_ui_text(prop, "Lock", "Action Group is locked");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "Action Group is expanded");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "custom_color", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "customCol");
RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
}
/* fcurve.keyframe_points */
@@ -291,7 +359,7 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_srna(cprop, "ActionGroups");
srna= RNA_def_struct(brna, "ActionGroups", NULL);
RNA_def_struct_sdna(srna, "bAction");
- RNA_def_struct_ui_text(srna, "Action Points", "Collection of action groups");
+ RNA_def_struct_ui_text(srna, "Action Groups", "Collection of action groups");
func= RNA_def_function(srna, "add", "rna_Action_groups_add");
RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
@@ -309,6 +377,64 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
+static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "ActionFCurves");
+ srna= RNA_def_struct(brna, "ActionFCurves", NULL);
+ RNA_def_struct_sdna(srna, "bAction");
+ RNA_def_struct_ui_text(srna, "Action FCurves", "Collection of action fcurves");
+
+ func= RNA_def_function(srna, "new", "rna_Action_fcurve_new");
+ RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_string(func, "data_path", "", 0, "Data Path", "FCurve data path to use.");
+ parm= RNA_def_int(func, "array_index", 0, 0, INT_MAX, "Index", "Array index.", 0, INT_MAX);
+ parm= RNA_def_string(func, "action_group", "", 0, "Action Group", "Acton group to add this fcurve into.");
+
+ parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created fcurve");
+ RNA_def_function_return(func, parm);
+
+
+ func= RNA_def_function(srna, "remove", "rna_Action_fcurve_remove");
+ RNA_def_function_ui_description(func, "Remove action group.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "FCurve to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+}
+
+static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "ActionPoseMarkers");
+ srna= RNA_def_struct(brna, "ActionPoseMarkers", NULL);
+ RNA_def_struct_sdna(srna, "bAction");
+ RNA_def_struct_ui_text(srna, "Action Pose Markers", "Collection of timeline markers");
+
+ func= RNA_def_function(srna, "new", "rna_Action_pose_markers_new");
+ RNA_def_function_ui_description(func, "Add a pose marker to the action.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_Action_pose_markers_remove");
+ RNA_def_function_ui_description(func, "Remove a timeline marker.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+}
+
static void rna_def_action(BlenderRNA *brna)
{
StructRNA *srna;
@@ -323,6 +449,7 @@ static void rna_def_action(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "curves", NULL);
RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_ui_text(prop, "F-Curves", "The individual F-Curves that make up the Action");
+ rna_def_action_fcurves(brna, prop);
prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "groups", NULL);
@@ -334,6 +461,7 @@ static 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_def_action_pose_markers(brna, prop);
RNA_api_action(srna);
}
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 23698e8140f..a4becb87e28 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -27,23 +27,50 @@
#include "RNA_define.h"
#include "rna_internal.h"
-
+#include "DNA_constraint_types.h"
+#include "DNA_object_types.h"
#include "DNA_actuator_types.h"
#include "DNA_scene_types.h" // for MAXFRAME
#include "WM_types.h"
+/* Always keep in alphabetical order */
+EnumPropertyItem actuator_type_items[] ={
+ {ACT_ACTION, "ACTION", 0, "Action", ""},
+ {ACT_ARMATURE, "ARMATURE", 0, "Armature", ""},
+ {ACT_CAMERA, "CAMERA", 0, "Camera", ""},
+ {ACT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""},
+ {ACT_EDIT_OBJECT, "EDIT_OBJECT", 0, "Edit Object", ""},
+ {ACT_IPO, "F-Curve", 0, "F-Curve", ""},
+ {ACT_2DFILTER, "FILTER_2D", 0, "Filter 2D", ""},
+ {ACT_GAME, "GAME", 0, "Game", ""},
+ {ACT_MESSAGE, "MESSAGE", 0, "Message", ""},
+ {ACT_OBJECT, "OBJECT", 0, "Motion", ""},
+ {ACT_PARENT, "PARENT", 0, "Parent", ""},
+ {ACT_PROPERTY, "PROPERTY", 0, "Property", ""},
+ {ACT_RANDOM, "RANDOM", 0, "Random", ""},
+ {ACT_SCENE, "SCENE", 0, "Scene", ""},
+ {ACT_SHAPEACTION, "SHAPE_ACTION", 0, "Shape Action", ""},
+ {ACT_SOUND, "SOUND", 0, "Sound", ""},
+ {ACT_STATE, "STATE", 0, "State", ""},
+ {ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
+#include "BKE_sca.h"
+
static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
{
bActuator *actuator= (bActuator*)ptr->data;
switch(actuator->type) {
+ case ACT_ACTION:
+ return &RNA_ActionActuator;
case ACT_OBJECT:
return &RNA_ObjectActuator;
case ACT_IPO:
- return &RNA_IpoActuator;
+ return &RNA_FCurveActuator;
case ACT_CAMERA:
return &RNA_CameraActuator;
case ACT_SOUND:
@@ -65,7 +92,7 @@ static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
case ACT_VISIBILITY:
return &RNA_VisibilityActuator;
case ACT_2DFILTER:
- return &RNA_TwoDFilterActuator;
+ return &RNA_Filter2DActuator;
case ACT_PARENT:
return &RNA_ParentActuator;
case ACT_SHAPEACTION:
@@ -79,6 +106,354 @@ static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
}
}
+static void rna_Actuator_type_set(struct PointerRNA *ptr, int value)
+{
+ bActuator *act= (bActuator *)ptr->data;
+ if (value != act->type)
+ {
+ act->type = value;
+ init_actuator(act);
+ }
+}
+
+static float rna_ConstraintActuator_limitmin_get(struct PointerRNA *ptr)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->flag & ACT_CONST_LOCX) fp= ca->minloc;
+ else if(ca->flag & ACT_CONST_LOCY) fp= ca->minloc+1;
+ else if(ca->flag & ACT_CONST_LOCZ) fp= ca->minloc+2;
+ else if(ca->flag & ACT_CONST_ROTX) fp= ca->minrot;
+ else if(ca->flag & ACT_CONST_ROTY) fp= ca->minrot+1;
+ else fp= ca->minrot+2;
+
+ return *fp;
+}
+
+static void rna_ConstraintActuator_limitmin_set(struct PointerRNA *ptr, float value)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->flag & ACT_CONST_LOCX) fp= ca->minloc;
+ else if(ca->flag & ACT_CONST_LOCY) fp= ca->minloc+1;
+ else if(ca->flag & ACT_CONST_LOCZ) fp= ca->minloc+2;
+ else if(ca->flag & ACT_CONST_ROTX) fp= ca->minrot;
+ else if(ca->flag & ACT_CONST_ROTY) fp= ca->minrot+1;
+ else fp= ca->minrot+2;
+
+ *fp = value;
+}
+
+static float rna_ConstraintActuator_limitmax_get(struct PointerRNA *ptr)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->flag & ACT_CONST_LOCX) fp= ca->maxloc;
+ else if(ca->flag & ACT_CONST_LOCY) fp= ca->maxloc+1;
+ else if(ca->flag & ACT_CONST_LOCZ) fp= ca->maxloc+2;
+ else if(ca->flag & ACT_CONST_ROTX) fp= ca->maxrot;
+ else if(ca->flag & ACT_CONST_ROTY) fp= ca->maxrot+1;
+ else fp= ca->maxrot+2;
+
+ return *fp;
+}
+
+static void rna_ConstraintActuator_limitmax_set(struct PointerRNA *ptr, float value)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->flag & ACT_CONST_LOCX) fp= ca->maxloc;
+ else if(ca->flag & ACT_CONST_LOCY) fp= ca->maxloc+1;
+ else if(ca->flag & ACT_CONST_LOCZ) fp= ca->maxloc+2;
+ else if(ca->flag & ACT_CONST_ROTX) fp= ca->maxrot;
+ else if(ca->flag & ACT_CONST_ROTY) fp= ca->maxrot+1;
+ else fp= ca->maxrot+2;
+
+ *fp = value;
+}
+
+static float rna_ConstraintActuator_distance_get(struct PointerRNA *ptr)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
+ else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
+ else fp= ca->minloc+2;
+
+ return *fp;
+}
+
+static void rna_ConstraintActuator_distance_set(struct PointerRNA *ptr, float value)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
+ else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
+ else fp= ca->minloc+2;
+
+ *fp = value;
+}
+
+static float rna_ConstraintActuator_range_get(struct PointerRNA *ptr)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
+ else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
+ else fp= ca->maxloc+2;
+
+ return *fp;
+}
+
+static void rna_ConstraintActuator_range_set(struct PointerRNA *ptr, float value)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
+ else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
+ else fp= ca->maxloc+2;
+
+ *fp = value;
+}
+
+static float rna_ConstraintActuator_fhheight_get(struct PointerRNA *ptr)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
+ else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
+ else fp= ca->minloc+2;
+
+ return *fp;
+}
+
+static void rna_ConstraintActuator_fhheight_set(struct PointerRNA *ptr, float value)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
+ else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
+ else fp= ca->minloc+2;
+
+ *fp = value;
+}
+
+static float rna_ConstraintActuator_spring_get(struct PointerRNA *ptr)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
+ else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
+ else fp= ca->maxloc+2;
+
+ return *fp;
+}
+
+static void rna_ConstraintActuator_spring_set(struct PointerRNA *ptr, float value)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+ float *fp;
+
+ if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
+ else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
+ else fp= ca->maxloc+2;
+
+ *fp = value;
+}
+
+/* ConstraintActuator uses the same property for Material and Property.
+ Therefore we need to clear the property when "use_material_detect" mode changes */
+static void rna_Actuator_constraint_detect_material_set(struct PointerRNA *ptr, int value)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bConstraintActuator *ca = act->data;
+
+ short old_value = (ca->flag & ACT_CONST_MATERIAL? 1:0);
+
+ if (old_value != value) {
+ ca->flag ^= ACT_CONST_MATERIAL;
+ ca->matprop[0] = '\0';
+ }
+}
+
+static void rna_FcurveActuator_add_set(struct PointerRNA *ptr, int value)
+{
+ bActuator *act = (bActuator *)ptr->data;
+ bIpoActuator *ia = act->data;
+
+ if(value == 1){
+ ia->flag &= ~ACT_IPOFORCE;
+ ia->flag |= ACT_IPOADD;
+ }else
+ ia->flag &= ~ACT_IPOADD;
+}
+
+static void rna_FcurveActuator_force_set(struct PointerRNA *ptr, int value)
+{
+ bActuator *act = (bActuator *)ptr->data;
+ bIpoActuator *ia = act->data;
+
+ if(value == 1){
+ ia->flag &= ~ACT_IPOADD;
+ ia->flag |= ACT_IPOFORCE;
+ }else
+ ia->flag &= ~ACT_IPOFORCE;
+}
+
+static void rna_ObjectActuator_integralcoefficient_set(struct PointerRNA *ptr, float value)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bObjectActuator *oa = act->data;
+
+ oa->forcerot[1] = value;
+ oa->forcerot[0] = 60.0f*oa->forcerot[1];
+}
+
+static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values)
+{
+ bActuator *act = (bActuator*)ptr->data;
+ bStateActuator *sa = act->data;
+
+ int i, tot= 0;
+
+ /* ensure we always have some state selected */
+ for(i=0; i<OB_MAX_STATES; i++)
+ if(values[i])
+ tot++;
+
+ if(tot==0)
+ return;
+
+ for(i=0; i<OB_MAX_STATES; i++) {
+ if(values[i]) sa->mask |= (1<<i);
+ else sa->mask &= ~(1<<i);
+ }
+}
+
+/* Always keep in alphabetical order */
+EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ EnumPropertyItem *item= NULL;
+ Object *ob= NULL;
+ int totitem= 0;
+
+ if (ptr->type == &RNA_Actuator) {
+ ob = (Object *)ptr->id.data;
+ } else {
+ /* can't use ob from ptr->id.data because that enum is also used by operators */
+ ob = CTX_data_active_object(C);
+ }
+
+ if (ob != NULL) {
+ if (ob->type==OB_ARMATURE) {
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ACTION);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ARMATURE);
+ }
+ }
+
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CAMERA);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CONSTRAINT);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_EDIT_OBJECT);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_IPO);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_2DFILTER);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_GAME);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_MESSAGE);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_OBJECT);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PARENT);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PROPERTY);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_RANDOM);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SCENE);
+
+ if (ob != NULL) {
+ if (ob->type==OB_MESH){
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SHAPEACTION);
+ }
+ }
+
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SOUND);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STATE);
+ RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_VISIBILITY);
+
+ RNA_enum_item_end(&item, &totitem);
+ *free= 1;
+
+ return item;
+}
+
+static void rna_Actuator_Armature_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ bActuator *act= (bActuator *)ptr->data;
+ bArmatureActuator *aa = act->data;
+ Object *ob = (Object *)ptr->id.data;
+
+ char *posechannel= aa->posechannel;
+ char *constraint= aa->constraint;
+
+ /* check that bone exist in the active object */
+ if (ob->type == OB_ARMATURE && ob->pose) {
+ bPoseChannel *pchan;
+ bPose *pose = ob->pose;
+ for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
+ if (!strcmp(pchan->name, posechannel)) {
+ /* found it, now look for constraint channel */
+ bConstraint *con;
+ for (con=pchan->constraints.first; con; con=con->next) {
+ if (!strcmp(con->name, constraint)) {
+ /* found it, all ok */
+ return;
+ }
+ }
+ /* didn't find constraint, make empty */
+ constraint[0] = 0;
+ return;
+ }
+ }
+ }
+ /* didn't find any */
+ posechannel[0] = 0;
+ constraint[0] = 0;
+}
+
+/* note: the following set functions exists only to avoid id refcounting */
+static void rna_Actuator_editobject_mesh_set(PointerRNA *ptr, PointerRNA value)
+{
+ bActuator *act = (bActuator *)ptr->data;
+ bEditObjectActuator *eoa = (bEditObjectActuator *) act->data;
+
+ eoa->me = value.data;
+}
+
+static void rna_Actuator_action_action_set(PointerRNA *ptr, PointerRNA value)
+{
+ bActuator *act = (bActuator *)ptr->data;
+ bActionActuator *aa = (bActionActuator *) act->data;
+
+ aa->act = value.data;
+}
+
#else
void rna_def_actuator(BlenderRNA *brna)
@@ -86,27 +461,6 @@ void rna_def_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem actuator_type_items[] ={
- {ACT_OBJECT, "OBJECT", 0, "Motion", ""},
- {ACT_IPO, "IPO", 0, "IPO", ""},
- {ACT_CAMERA, "CAMERA", 0, "Camera", ""},
- {ACT_SOUND, "SOUND", 0, "Sound", ""},
- {ACT_PROPERTY, "PROPERTY", 0, "Property", ""},
- {ACT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""},
- {ACT_EDIT_OBJECT, "EDIT_OBJECT", 0, "Edit Object", ""},
- {ACT_SCENE, "SCENE", 0, "Scene", ""},
- {ACT_RANDOM, "RANDOM", 0, "Random", ""},
- {ACT_MESSAGE, "MESSAGE", 0, "Message", ""},
- {ACT_ACTION, "ACTION", 0, "Action", ""},
- {ACT_GAME, "GAME", 0, "Game", ""},
- {ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""},
- {ACT_2DFILTER, "FILTER_2D", 0, "2D Filter", ""},
- {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);
RNA_def_struct_ui_text(srna, "Actuator", "Actuator to apply actions in the game engine");
RNA_def_struct_sdna(srna, "bActuator");
@@ -114,13 +468,108 @@ void rna_def_actuator(BlenderRNA *brna)
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_struct_name_property(srna, prop);
- /* type is not editable, would need to do proper data free/alloc */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, actuator_type_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Actuator_type_set", "rna_Actuator_type_itemf");
RNA_def_property_ui_text(prop, "Type", "");
+ prop= RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_PIN);
+ RNA_def_property_ui_text(prop, "Pinned", "Display when not linked to a visible states controller");
+ RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SHOW);
+ RNA_def_property_ui_text(prop, "Expanded", "Set actuator expanded in the user interface");
+ RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
+
+ RNA_api_actuator(srna);
+}
+
+static void rna_def_action_actuator(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_type_items[] ={
+ {ACT_ACTION_PLAY, "PLAY", 0, "Play", ""},
+ {ACT_ACTION_FLIPPER, "FLIPPER", 0, "Flipper", ""},
+ {ACT_ACTION_LOOP_STOP, "LOOPSTOP", 0, "Loop Stop", ""},
+ {ACT_ACTION_LOOP_END, "LOOPEND", 0, "Loop End", ""},
+ {ACT_ACTION_FROM_PROP, "PROPERTY", 0, "Property", ""},
+#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
+ {ACT_ACTION_MOTION, "MOTION", 0, "Displacement", ""},
+#endif
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "ActionActuator", "Actuator");
+ RNA_def_struct_ui_text(srna, "Action Actuator", "Actuator to control the object movement");
+ RNA_def_struct_sdna_from(srna, "bActionActuator", "data");
+
+ prop= RNA_def_property(srna, "play_mode", 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, "Action type", "Action playback type");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "act");
+ RNA_def_property_struct_type(prop, "Action");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Action", "");
+ /* note: custom set function is ONLY to avoid rna setting a user for this. */
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "end_reset", 1);
+ RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "sta");
+ RNA_def_property_range(prop, 0, MAXFRAME);
+ RNA_def_property_ui_text(prop, "Start frame", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "end");
+ RNA_def_property_range(prop, 0, MAXFRAME);
+ RNA_def_property_ui_text(prop, "End frame", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "frame_blend_in", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "blendin");
+ RNA_def_property_range(prop, 0, 32767);
+ RNA_def_property_ui_text(prop, "Blendin", "Number of frames of motion blending");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "priority", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 0, 100);
+ RNA_def_property_ui_text(prop, "Priority", "Execution priority - lower numbers will override actions with higher numbers. With 2 or more actions at once, the overriding channels must be lower in the stack");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "frameProp");
+ RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
+ prop= RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "stridelength");
+ RNA_def_property_range(prop, 0.0, 2500.0);
+ RNA_def_property_ui_text(prop, "Cycle", "Distance covered by a single cycle of the action");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+#endif
}
static void rna_def_object_actuator(BlenderRNA *brna)
@@ -129,7 +578,7 @@ static void rna_def_object_actuator(BlenderRNA *brna)
PropertyRNA* prop;
static EnumPropertyItem prop_type_items[] ={
- {ACT_OBJECT_NORMAL, "OBJECT_NORMAL", 0, "Simple motion", ""},
+ {ACT_OBJECT_NORMAL, "OBJECT_NORMAL", 0, "Simple Motion", ""},
{ACT_OBJECT_SERVO, "OBJECT_SERVO", 0, "Servo Control", ""},
{0, NULL, 0, NULL, NULL}};
@@ -138,11 +587,11 @@ static void rna_def_object_actuator(BlenderRNA *brna)
RNA_def_struct_sdna_from(srna, "bObjectActuator", "data");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode", 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, "Motion Type", "Specify the motion system");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- // XXX otype = type
prop= RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
@@ -153,145 +602,161 @@ static void rna_def_object_actuator(BlenderRNA *brna)
prop= RNA_def_property(srna, "damping", PROP_INT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 1000, 1, 1);
- RNA_def_property_ui_text(prop, "Damping", "Number of frames to reach the target velocity");
+ RNA_def_property_ui_text(prop, "Damping Frames", "Number of frames to reach the target velocity");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "proportional_coefficient", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "forcerot[0]");
- RNA_def_property_ui_range(prop, 0.0, 200.0, 1.0, 0.1);
+ RNA_def_property_ui_range(prop, 0.0, 200.0, 10, 2);
RNA_def_property_ui_text(prop, "Proportional Coefficient", "Typical value is 60x integral coefficient");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "integral_coefficient", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "forcerot[1]");
- RNA_def_property_ui_range(prop, 0.0, 3.0, 0.1, 0.01);
+ RNA_def_property_ui_range(prop, 0.0, 3.0, 10, 2);
+ RNA_def_property_float_funcs(prop, NULL, "rna_ObjectActuator_integralcoefficient_set", NULL);
RNA_def_property_ui_text(prop, "Integral Coefficient", "Low value (0.01) for slow response, high value (0.5) for fast response");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "derivate_coefficient", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "forcerot[2]");
- RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 10, 2);
RNA_def_property_ui_text(prop, "Derivate Coefficient", "Not required, high values can cause instability");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- /* XXX We need one of those special get/set functions here:
- int offset
- if (flag & ACT_SERVO_LIMIT_X):
- offset = 0
- elif (flag & ACT_SERVO_LIMIT_Y):
- offset = 1
- elif (flag & ACT_SERVO_LIMIT_Z):
- offset = 2
-
- prop= RNA_def_property(srna, "force_max", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "dloc[offset]");
- RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+ /* Servo Limit */
+ prop= RNA_def_property(srna, "force_max_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "force_max", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "drot[offset]");
- RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+ prop= RNA_def_property(srna, "force_min_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "drot[0]");
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
+ RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "force_max_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dloc[1]");
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- */
-
+
+ prop= RNA_def_property(srna, "force_min_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "drot[1]");
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
+ RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "force_max_z", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dloc[2]");
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
+ RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "force_min_z", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "drot[2]");
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
+ RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
/* floats 3 Arrays*/
- prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "offset_location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "dloc");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+ RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Loc", "Sets the location");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "rot", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "offset_rotation", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "drot");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+ RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Rot", "Sets the rotation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "forceloc");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+ RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Force", "Sets the force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "torque", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "torque", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "forcerot");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+ RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Torque", "Sets the torque");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "linearvelocity");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+ RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Linear Velocity", "Sets the linear velocity (in Servo mode it sets the target relative linear velocity, it will be achieved by automatic application of force. Null velocity is a valid target)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "angularvelocity");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
+ RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Angular Velocity", "Sets the angular velocity");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "local_location", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DLOC_LOCAL);
RNA_def_property_ui_text(prop, "L", "Location is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "local_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DROT_LOCAL);
RNA_def_property_ui_text(prop, "L", "Rotation is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "local_force", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_force", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_FORCE_LOCAL);
RNA_def_property_ui_text(prop, "L", "Force is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "local_torque", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_torque", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_TORQUE_LOCAL);
RNA_def_property_ui_text(prop, "L", "Torque is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_LIN_VEL_LOCAL);
RNA_def_property_ui_text(prop, "L", "Velocity is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ANG_VEL_LOCAL);
RNA_def_property_ui_text(prop, "L", "Angular velocity is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "add_linear_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_add_linear_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ADD_LIN_VEL);
RNA_def_property_ui_text(prop, "Add", "Toggles between ADD and SET linV");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "servo_limit_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_servo_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_X);
RNA_def_property_ui_text(prop, "X", "Set limit to force along the X axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "servo_limit_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_servo_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Y);
RNA_def_property_ui_text(prop, "Y", "Set limit to force along the Y axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "servo_limit_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_servo_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Z);
RNA_def_property_ui_text(prop, "Z", "Set limit to force along the Z axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
-static void rna_def_ipo_actuator(BlenderRNA *brna)
+static void rna_def_fcurve_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -306,14 +771,14 @@ static void rna_def_ipo_actuator(BlenderRNA *brna)
{ACT_IPO_FROM_PROP, "PROP", 0, "Property", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "IpoActuator", "Actuator");
- RNA_def_struct_ui_text(srna, "Ipo Actuator", "Actuator to animate the object");
+ srna= RNA_def_struct(brna, "FCurveActuator", "Actuator");
+ RNA_def_struct_ui_text(srna, "F-Curve Actuator", "Actuator to animate the object");
RNA_def_struct_sdna_from(srna, "bIpoActuator", "data");
prop= RNA_def_property(srna, "play_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, "Ipo Type", "Specify the way you want to play the animation");
+ RNA_def_property_ui_text(prop, "F-Curve Type", "Specify the way you want to play the animation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
@@ -330,7 +795,7 @@ static void rna_def_ipo_actuator(BlenderRNA *brna)
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Property", "Use this property to define the Ipo position");
+ RNA_def_property_ui_text(prop, "Property", "Use this property to define the F-Curve position");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
@@ -338,29 +803,27 @@ static void rna_def_ipo_actuator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property");
/* booleans */
- prop= RNA_def_property(srna, "force", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOADD);
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_FcurveActuator_add_set");
+ RNA_def_property_ui_text(prop, "Add", "F-Curve is added to the current loc/rot/scale in global or local coordinate according to Local flag");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "use_force", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOFORCE);
- RNA_def_property_ui_text(prop, "Force", "Apply Ipo as a global or local force depending on the local option (dynamic objects only)");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_FcurveActuator_force_set");
+ RNA_def_property_ui_text(prop, "Force", "Apply F-Curve as a global or local force depending on the local option (dynamic objects only)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
-// logic_window::change_ipo_actuator
-// RNA_def_property_boolean_funcs(prop, "rna_Actuator_Ipo_get", "rna_Actuator_Ipo_get", "rna_Actuator_Ipo_range");
- prop= RNA_def_property(srna, "local", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOLOCAL);
- RNA_def_property_ui_text(prop, "L", "Let the ipo acts in local coordinates, used in Force and Add mode");
+ RNA_def_property_ui_text(prop, "L", "Let the F-Curve act in local coordinates, used in Force and Add mode");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "child", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOCHILD);
- RNA_def_property_ui_text(prop, "Child", "Update IPO on all children Objects as well");
+ RNA_def_property_ui_text(prop, "Child", "Update F-Curve on all children Objects as well");
RNA_def_property_update(prop, NC_LOGIC, NULL);
-
- prop= RNA_def_property(srna, "add", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOADD);
- RNA_def_property_ui_text(prop, "Add", "Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag");
- RNA_def_property_update(prop, NC_LOGIC, NULL);
-// logic_window::change_ipo_actuator
-// RNA_def_property_boolean_funcs(prop, "rna_Actuator_Ipo_get", "rna_Actuator_Ipo_get", "rna_Actuator_Ipo_range");
}
static void rna_def_camera_actuator(BlenderRNA *brna)
@@ -369,8 +832,8 @@ static void rna_def_camera_actuator(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_axis_items[] ={
- {(float)'x', "X", 0, "X", "Camera tries to get behind the X axis"},
- {(float)'y', "Y", 0, "Y", "Camera tries to get behind the Y axis"},
+ {ACT_CAMERA_X, "X", 0, "X", "Camera tries to get behind the X axis"},
+ {ACT_CAMERA_Y, "Y", 0, "Y", "Camera tries to get behind the Y axis"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "CameraActuator", "Actuator");
@@ -386,26 +849,25 @@ static void rna_def_camera_actuator(BlenderRNA *brna)
/* floats */
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
- RNA_def_property_ui_range(prop, 0.0, 20.0, 0.1, 0.1);
+ RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
RNA_def_property_ui_text(prop, "Height", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
- RNA_def_property_ui_range(prop, 0.0, 20.0, 0.1, 0.1);
+ RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
RNA_def_property_ui_text(prop, "Min", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
- RNA_def_property_ui_range(prop, 0.0, 20.0, 0.1, 0.1);
+ RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
RNA_def_property_ui_text(prop, "Max", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* x/y */
- // It could be changed to be a regular ENUM instead of this weird "(float)string enum"
prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axis");
RNA_def_property_enum_items(prop, prop_axis_items);
- RNA_def_property_ui_text(prop, "Axis", "Specify the axy the Camera will try to get behind");
+ RNA_def_property_ui_text(prop, "Axis", "Specify the axis the Camera will try to get behind");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
@@ -434,73 +896,74 @@ static void rna_def_sound_actuator(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Sound", "Sound file");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode", 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, "Type", "");
+ RNA_def_property_ui_text(prop, "Play Mode", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
- RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
+ RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Volume", "Sets the initial volume of the sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
- RNA_def_property_ui_range(prop, -12.0, 12.0, 1.0, 0.1);
+ RNA_def_property_ui_range(prop, -12.0, 12.0, 1, 2);
RNA_def_property_ui_text(prop, "Pitch", "Sets the pitch of the sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats - 3D Parameters */
- prop= RNA_def_property(srna, "minimum_gain_3d", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "gain_3d_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.min_gain");
- RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
+ RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Minimum Gain", "The minimum gain of the sound, no matter how far it is away");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "maximum_gain_3d", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "gain_3d_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.max_gain");
- RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
- RNA_def_property_ui_text(prop, "Minimum Gain", "The maximum gain of the sound, no matter how near it is");
+ RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
+ RNA_def_property_ui_text(prop, "Maximum Gain", "The maximum gain of the sound, no matter how near it is");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "reference_distance_3d", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "distance_3d_reference", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.reference_distance");
- RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1.0, 0.01);
+ RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2);
RNA_def_property_ui_text(prop, "Reference Distance", "The distance where the sound has a gain of 1.0");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "max_distance_3d", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "distance_3d_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.max_distance");
- RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1.0, 0.01);
+ RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2);
RNA_def_property_ui_text(prop, "Maximum Distance", "The maximum distance at which you can hear the sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "rolloff_factor_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.rolloff_factor");
- RNA_def_property_ui_range(prop, 0.0, 5.0, 1.0, 0.01);
+ RNA_def_property_ui_range(prop, 0.0, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Rolloff", "The influence factor on volume depending on distance");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "cone_outer_gain_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_gain");
- RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
+ RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Cone Outer Gain", "The gain outside the outer cone. The gain in the outer cone will be interpolated between this value and the normal gain in the inner cone");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "cone_outer_angle_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_angle");
- RNA_def_property_ui_range(prop, 0.0, 360.0, 1.0, 0.01);
+ RNA_def_property_ui_range(prop, 0.0, 360.0, 1, 2);
RNA_def_property_ui_text(prop, "Cone Outer Angle", "The angle of the outer cone");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "cone_inner_angle_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_inner_angle");
- RNA_def_property_ui_range(prop, 0.0, 360.0, 1.0, 0.01);
+ RNA_def_property_ui_range(prop, 0.0, 360.0, 1, 2);
RNA_def_property_ui_text(prop, "Cone Inner Angle", "The angle of the inner cone");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "enable_sound_3d", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_sound_3d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SND_3D_SOUND);
RNA_def_property_ui_text(prop, "3D Sound", "Enable/Disable 3D Sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -523,12 +986,13 @@ static void rna_def_property_actuator(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Property Actuator", "Actuator to handle properties");
RNA_def_struct_sdna_from(srna, "bPropertyActuator", "data");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode", 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, "Mode", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "prop_name", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "The name of the property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -536,12 +1000,26 @@ static void rna_def_property_actuator(BlenderRNA *brna)
prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Value", "The value to use, use \"\" around strings");
RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ /* Copy Mode */
+ 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_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Object", "Copy from this Object");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ //XXX add even magic'er property lookup (need to look for the property list of the target object)
+ prop= RNA_def_property(srna, "object_property", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "value");
+ RNA_def_property_ui_text(prop, "Property Name", "Copy this property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_constraint_actuator(BlenderRNA *brna)
{
StructRNA *srna;
- /*PropertyRNA *prop;
+ PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_CONST_TYPE_LOC, "LOC", 0, "Location Constraint", ""},
@@ -549,13 +1027,187 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
{ACT_CONST_TYPE_ORI, "ORI", 0, "Orientation Constraint", ""},
{ACT_CONST_TYPE_FH, "FH", 0, "Force Field Constraint", ""},
{0, NULL, 0, NULL, NULL}
- };*/
+ };
+
+ static EnumPropertyItem prop_limit_items[] ={
+ {ACT_CONST_NONE, "NONE", 0, "None", ""},
+ {ACT_CONST_LOCX, "LOCX", 0, "Loc X", ""},
+ {ACT_CONST_LOCY, "LOCY", 0, "Loc Y", ""},
+ {ACT_CONST_LOCZ, "LOCZ", 0, "Loc Z", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ static EnumPropertyItem prop_direction_items[] ={
+ {ACT_CONST_NONE, "NONE", 0, "None", ""},
+ {ACT_CONST_DIRPX, "DIRPX", 0, "X axis", ""},
+ {ACT_CONST_DIRPY, "DIRPY", 0, "Y axis", ""},
+ {ACT_CONST_DIRPZ, "DIRPZ", 0, "Z axis", ""},
+ {ACT_CONST_DIRNX, "DIRNX", 0, "-X axis", ""},
+ {ACT_CONST_DIRNY, "DIRNY", 0, "-Y axis", ""},
+ {ACT_CONST_DIRNZ, "DIRNZ", 0, "-Z axis", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
srna= RNA_def_struct(brna, "ConstraintActuator", "Actuator");
- RNA_def_struct_ui_text(srna, "Constraint Actuator", "Actuator to ..");
+ RNA_def_struct_ui_text(srna, "Constraint Actuator", "Actuator to handle Constraints");
RNA_def_struct_sdna_from(srna, "bConstraintActuator", "data");
- //XXX
+ prop= RNA_def_property(srna, "mode", 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, "Constraints Mode", "The type of the constraint");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "limit", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_limit_items);
+ RNA_def_property_ui_text(prop, "Limit", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, prop_direction_items);
+ RNA_def_property_ui_text(prop, "Direction", "Set the direction of the ray");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "direction_axis", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, prop_direction_items);
+ RNA_def_property_ui_text(prop, "Direction", "Select the axis to be aligned along the reference direction");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ /* ACT_CONST_TYPE_LOC */
+ prop= RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_limitmin_get", "rna_ConstraintActuator_limitmin_set", NULL);
+ RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
+ RNA_def_property_ui_text(prop, "Min", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_limitmax_get", "rna_ConstraintActuator_limitmax_set", NULL);
+ RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
+ RNA_def_property_ui_text(prop, "Max", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "damping", PROP_INT, PROP_PERCENTAGE);
+ RNA_def_property_int_sdna(prop, NULL, "damp");
+ RNA_def_property_ui_range(prop, 0, 100, 1, 1);
+ RNA_def_property_ui_text(prop, "Damping", "Damping factor: time constant (in frame) of low pass filter");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ /* ACT_CONST_TYPE_DIST */
+ prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_range_get", "rna_ConstraintActuator_range_set", NULL);
+ RNA_def_property_ui_range(prop, 0.f, 2000.f, 1, 2);
+ RNA_def_property_ui_text(prop, "Range", "Set the maximum length of ray");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_distance_get", "rna_ConstraintActuator_distance_set", NULL);
+ RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
+ RNA_def_property_ui_text(prop, "Distance", "Set the maximum length of ray");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ //XXX to use a pointer or add a material lookup
+ prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "matprop");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Material", "Ray detects only Objects with this material");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ //XXX add magic property lookup
+ prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "matprop");
+ RNA_def_property_ui_text(prop, "Property", "Ray detect only Objects with this property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "time", PROP_INT, PROP_NONE);
+ RNA_def_property_ui_range(prop, 0, 1000, 1, 2);
+ RNA_def_property_ui_text(prop, "Time", "Maximum activation time in frame, 0 for unlimited");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "damping_rotation", PROP_INT, PROP_PERCENTAGE);
+ RNA_def_property_int_sdna(prop, NULL, "rotdamp");
+ RNA_def_property_ui_range(prop, 0, 100, 1, 1);
+ RNA_def_property_ui_text(prop, "rotDamp", "Use a different damping for orientation");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ /* ACT_CONST_TYPE_ORI */
+ prop= RNA_def_property(srna, "rotation_max", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "maxrot");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_range(prop, -2000.0, 2000.0, 10, 2);
+ RNA_def_property_ui_text(prop, "Reference Direction", "Reference Direction");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "minloc[0]");
+ RNA_def_property_ui_range(prop, 0.0, 180.0, 10, 2);
+ RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle (in degree) to maintain with target direction. No correction is done if angle with target direction is between min and max");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "maxloc[0]");
+ RNA_def_property_ui_range(prop, 0.0, 180.0, 10, 2);
+ RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle (in degree) allowed with target direction. No correction is done if angle with target direction is between min and max");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ /* ACT_CONST_TYPE_FH */
+ prop= RNA_def_property(srna, "fh_height", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_fhheight_get", "rna_ConstraintActuator_fhheight_set", NULL);
+ RNA_def_property_ui_range(prop, 0.01, 2000.0, 10, 2);
+ RNA_def_property_ui_text(prop, "Distance", "Height of the Fh area");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "spring", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_spring_get", "rna_ConstraintActuator_spring_set", NULL);
+ RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2);
+ RNA_def_property_ui_text(prop, "Fh", "Spring force within the Fh area");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "maxrot[0]");
+ RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2);
+ RNA_def_property_ui_text(prop, "Damping", "Damping factor of the Fh spring force");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ /* booleans */
+ prop= RNA_def_property(srna, "use_force_distance", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_DISTANCE);
+ RNA_def_property_ui_text(prop, "Force Distance", "Force distance of object to point of impact of ray");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_LOCAL);
+ RNA_def_property_ui_text(prop, "L", "Set ray along object's axis or global axis");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL);
+ RNA_def_property_ui_text(prop, "N", "Set object axis along (local axis) or parallel (global axis) to the normal at hit position");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_PERMANENT);
+ RNA_def_property_ui_text(prop, "PER", "Persistent actuator: stays active even if ray does not reach target");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ //XXX to use an enum instead of a flag if possible
+ prop= RNA_def_property(srna, "use_material_detect", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_MATERIAL);
+ RNA_def_property_ui_text(prop, "M/P", "Detect material instead of property");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Actuator_constraint_detect_material_set");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "use_fh_paralel_axis", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_DOROTFH);
+ RNA_def_property_ui_text(prop, "Rot Fh", "Keep object axis parallel to normal");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL);
+ RNA_def_property_ui_text(prop, "N", "Add a horizontal spring force on slopes");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_edit_object_actuator(BlenderRNA *brna)
@@ -563,27 +1215,27 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
- {ACT_EDOB_ADD_OBJECT, "ADDOBJECT", 0, "Add Object", ""},
- {ACT_EDOB_END_OBJECT, "ENDOBJECT", 0, "End Object", ""},
- {ACT_EDOB_REPLACE_MESH, "REPLACEMESH", 0, "Replace Mesh", ""},
- {ACT_EDOB_TRACK_TO, "TRACKTO", 0, "Track to", ""},
- {ACT_EDOB_DYNAMICS, "DYNAMICS", 0, "Dynamics", ""},
- {0, NULL, 0, NULL, NULL} };
-
static EnumPropertyItem prop_dyn_items[] ={
{ACT_EDOB_RESTORE_DYN, "RESTOREDYN", 0, "Restore Dynamics", ""},
{ACT_EDOB_SUSPEND_DYN, "SUSPENDDYN", 0, "Suspend Dynamics", ""},
- {ACT_EDOB_ENABLE_RB, "ENABLERIGIDBOBY", 0, "Enable Rigid Body", ""},
- {ACT_EDOB_DISABLE_RB, "DISABLERIGIDBOBY", 0, "Disable Rigid Body", ""},
+ {ACT_EDOB_ENABLE_RB, "ENABLERIGIDBODY", 0, "Enable Rigid Body", ""},
+ {ACT_EDOB_DISABLE_RB, "DISABLERIGIDBODY", 0, "Disable Rigid Body", ""},
{ACT_EDOB_SET_MASS, "SETMASS", 0, "Set Mass", ""},
{0, NULL, 0, NULL, NULL} };
+ static EnumPropertyItem prop_type_items[] ={
+ {ACT_EDOB_ADD_OBJECT, "ADDOBJECT", 0, "Add Object", ""},
+ {ACT_EDOB_END_OBJECT, "ENDOBJECT", 0, "End Object", ""},
+ {ACT_EDOB_REPLACE_MESH, "REPLACEMESH", 0, "Replace Mesh", ""},
+ {ACT_EDOB_TRACK_TO, "TRACKTO", 0, "Track to", ""},
+ {ACT_EDOB_DYNAMICS, "DYNAMICS", 0, "Dynamics", ""},
+ {0, NULL, 0, NULL, NULL} };
+
srna= RNA_def_struct(brna, "EditObjectActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Edit Object Actuator", "Actuator used to edit objects");
RNA_def_struct_sdna_from(srna, "bEditObjectActuator", "data");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode", 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, "Edit Object", "The mode of the actuator");
@@ -614,6 +1266,8 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "me");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mesh", "Replace the existing, when left blank 'Phys' will remake the existing physics mesh");
+ /* note: custom set function is ONLY to avoid rna setting a user for this. */
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_editobject_mesh_set", NULL, NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "time", PROP_INT, PROP_NONE);
@@ -622,47 +1276,47 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
- RNA_def_property_ui_range(prop, 0, 10000, 1, 0.01);
+ RNA_def_property_ui_range(prop, 0, 10000, 1, 2);
RNA_def_property_ui_text(prop, "Mass", "The mass of the object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats 3 Arrays*/
- prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "linVelocity");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_range(prop, -100.0, 100.0, 0.1, 0.01);
+ RNA_def_property_ui_range(prop, -100.0, 100.0, 10, 2);
RNA_def_property_ui_text(prop, "Linear Velocity", "Velocity upon creation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "angVelocity");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1.0, 0.01);
+ RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity upon creation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "localflag", ACT_EDOB_LOCAL_LINV);
RNA_def_property_ui_text(prop, "L", "Apply the transformation locally");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "localflag", ACT_EDOB_LOCAL_ANGV);
RNA_def_property_ui_text(prop, "L", "Apply the rotation locally");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "replace_display_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_replace_display_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_NOGFX);
RNA_def_property_ui_text(prop, "Gfx", "Replace the display mesh");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "replace_physics_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_replace_physics_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_PHYS);
RNA_def_property_ui_text(prop, "Phys", "Replace the physics mesh (triangle bounds only - compound shapes not supported)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "enable_3d_tracking", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_3d_tracking", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_TRACK_3D);
RNA_def_property_ui_text(prop, "3D", "Enable 3D tracking");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -688,11 +1342,13 @@ static void rna_def_scene_actuator(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Scene Actuator", "Actuator to ..");
RNA_def_struct_sdna_from(srna, "bSceneActuator", "data");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode", 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, "Scene", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
+ //XXX filter only camera objects
prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -705,7 +1361,7 @@ static void rna_def_scene_actuator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Scene", "Set the Scene to be added/removed/paused/resumed");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- /* XXX
+ /* XXX no need for those tooltips. to remove soon
Originally we had different 'scene' tooltips for different values of 'type'.
They were:
ACT_SCENE_RESTART ""
@@ -764,7 +1420,7 @@ static void rna_def_random_actuator(BlenderRNA *brna)
/* int_arg_1, int_arg_2, float_arg_1, float_arg_2 */
/* ACT_RANDOM_BOOL_CONST */
- prop= RNA_def_property(srna, "always_true", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_always_true", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "int_arg_1", 1);
RNA_def_property_ui_text(prop, "Always true", "Always false or always true");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -873,7 +1529,7 @@ static void rna_def_message_actuator(BlenderRNA *brna)
prop= RNA_def_property(srna, "body_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "bodyType");
RNA_def_property_enum_items(prop, prop_body_type_items);
- RNA_def_property_ui_text(prop, "Body Type", "Toggle message type: either Text or a PropertyName");
+ RNA_def_property_ui_text(prop, "Body", "Toggle message type: either Text or a PropertyName");
/* ACT_MESG_MESG */
prop= RNA_def_property(srna, "body_message", PROP_STRING, PROP_NONE);
@@ -902,22 +1558,25 @@ static void rna_def_game_actuator(BlenderRNA *brna)
{ACT_GAME_LOAD, "START", 0, "Start new game", ""},
{ACT_GAME_RESTART, "RESTART", 0, "Restart this game", ""},
{ACT_GAME_QUIT, "QUIT", 0, "Quit this game", ""},
- {ACT_GAME_SAVECFG, "SAVECFG", 0, "Save GameLogic.globalDict", ""},
- {ACT_GAME_LOADCFG, "LOADCFG", 0, "Load GameLogic.globalDict", ""},
+ {ACT_GAME_SAVECFG, "SAVECFG", 0, "Save bge.logic.globalDict", ""},
+ {ACT_GAME_LOADCFG, "LOADCFG", 0, "Load bge.logic.globalDict", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "GameActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Game Actuator", "");
RNA_def_struct_sdna_from(srna, "bGameActuator", "data");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode", 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, "Game", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_NONE);
+ /* ACT_GAME_LOAD */
+ prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
RNA_def_property_update(prop, NC_LOGIC, NULL);
+ //XXX to do: an operator that calls file_browse with relative_path on and blender filtering active
}
static void rna_def_visibility_actuator(BlenderRNA *brna)
@@ -929,17 +1588,17 @@ static void rna_def_visibility_actuator(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Visibility Actuator", "Actuator to set visibility and occlusion of the object");
RNA_def_struct_sdna_from(srna, "bVisibilityActuator", "data");
- prop= RNA_def_property(srna, "visible", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_INVISIBLE);
+ prop= RNA_def_property(srna, "use_visible", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_VISIBILITY_INVISIBLE);
RNA_def_property_ui_text(prop, "Visible", "Set the objects visible. Initialized from the objects render restriction toggle (access in the outliner)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "occlusion", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_occlusion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_OCCLUSION);
RNA_def_property_ui_text(prop, "Occlusion", "Set the object to occlude objects behind it. Initialized from the object type in physics button");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "children", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_RECURSIVE);
RNA_def_property_ui_text(prop, "Children", "Set all the children of this object to the same visibility/occlusion recursively");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -969,11 +1628,12 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
// {ACT_2DFILTER_NUMBER_OF_FILTERS, "", 0, "Do not use it. Sentinel", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "TwoDFilterActuator", "Actuator");
+ srna= RNA_def_struct(brna, "Filter2DActuator", "Actuator");
RNA_def_struct_ui_text(srna, "2D Filter Actuator", "Actuator to ..");
RNA_def_struct_sdna_from(srna, "bTwoDFilterActuator", "data");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode", 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, "2D Filter Type", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -991,19 +1651,16 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 99); //MAX_RENDER_PASS-1
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "motion_blur_value", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "motion_blur_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg");
- RNA_def_property_ui_text(prop, "Value", "Set motion blur value");
+ RNA_def_property_ui_text(prop, "Value", "Set motion blur factor");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- // it must be renamed to enable_motion_blur.
- // it'll require code change and do_version()
- // or RNA_def_property_boolean_funcs() to flip the boolean value
- prop= RNA_def_property(srna, "disable_motion_blur", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
- RNA_def_property_ui_text(prop, "D", "Enable/Disable Motion Blur");
+ prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 1);
+ RNA_def_property_ui_text(prop, "Enable", "Enable/Disable Motion Blur");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
@@ -1021,7 +1678,8 @@ static void rna_def_parent_actuator(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Parent Actuator", "");
RNA_def_struct_sdna_from(srna, "bParentActuator", "data");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode", 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, "Scene", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1034,12 +1692,12 @@ static void rna_def_parent_actuator(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "compound", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_compound", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_PARENT_COMPOUND);
RNA_def_property_ui_text(prop, "Compound", "Add this object shape to the parent shape (only if the parent shape is already compound)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "ghost", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_PARENT_GHOST);
RNA_def_property_ui_text(prop, "Ghost", "Make this object ghost while parented (only if not compound)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1062,10 +1720,11 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ShapeActionActuator", "Actuator");
- RNA_def_struct_ui_text(srna, "Shape Action Actuator", "Actuator to ..");
+ RNA_def_struct_ui_text(srna, "Shape Action Actuator", "Actuator to control shape key animations");
RNA_def_struct_sdna_from(srna, "bActionActuator", "data");
-
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+
+ prop= RNA_def_property(srna, "mode", 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, "Action type", "Action playback type");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1075,9 +1734,11 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Action");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Action", "");
+ /* note: custom set function is ONLY to avoid rna setting a user for this. */
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "continue_last_frame", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "end_reset", 1);
RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1099,7 +1760,8 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "End frame", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "blendin", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame_blend_in", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "blendin");
RNA_def_property_range(prop, 0, 32767);
RNA_def_property_ui_text(prop, "Blendin", "Number of frames of motion blending");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1145,14 +1807,11 @@ static void rna_def_state_actuator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Operation", "Select the bit operation on object state mask");
RNA_def_property_update(prop, NC_LOGIC, NULL);
-/*
- XXX mask needs a template or to use RNA layer type
- prop= RNA_def_property(srna, "mask", PROP_BOOLEAN, PROP_LAYER);
- RNA_def_property_array(prop, 20);
-*/
- prop= RNA_def_property(srna, "mask", PROP_INT, PROP_NONE);
- RNA_def_property_ui_text(prop, "Mask", "");
- RNA_def_property_update(prop, NC_LOGIC, NULL);
+ prop= RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ RNA_def_property_boolean_sdna(prop, NULL, "mask", 1);
+ RNA_def_property_array(prop, OB_MAX_STATES);
+ RNA_def_property_ui_text(prop, "State", "");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_StateActuator_state_set");
}
static void rna_def_armature_actuator(BlenderRNA *brna)
@@ -1161,18 +1820,18 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
PropertyRNA* prop;
static EnumPropertyItem prop_type_items[] ={
- {ACT_ARM_RUN, "RUN", 0, "Run armature", ""},
+ {ACT_ARM_RUN, "RUN", 0, "Run Armature", ""},
{ACT_ARM_ENABLE, "ENABLE", 0, "Enable", ""},
{ACT_ARM_DISABLE, "DISABLE", 0, "Disable", ""},
- {ACT_ARM_SETTARGET, "SETTARGET", 0, "Set target", ""},
- {ACT_ARM_SETWEIGHT, "SETWEIGHT", 0, "Set weight", ""},
+ {ACT_ARM_SETTARGET, "SETTARGET", 0, "Set Target", ""},
+ {ACT_ARM_SETWEIGHT, "SETWEIGHT", 0, "Set Weight", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ArmatureActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Armature Actuator", "Actuator to ..");
RNA_def_struct_sdna_from(srna, "bArmatureActuator", "data");
- prop= RNA_def_property(srna, "contraint_type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode", 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, "Constraint Type", "");
@@ -1181,18 +1840,12 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
prop= RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "posechannel");
RNA_def_property_ui_text(prop, "Bone", "Bone on which the constraint is defined");
- RNA_def_property_update(prop, NC_LOGIC, NULL);
- // XXX uiButSetFunc(but, check_armature_actuator, but, armAct); // the bone must be from the armature
- /* XXX eventually move to a datablock pointer. However datablocking this may be a problem
- we would need to update the value whenever the armature changes. */
+ RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update");
- prop= RNA_def_property(srna, "contraint", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "constraint");
RNA_def_property_ui_text(prop, "Constraint", "Name of the constraint you want to control");
- RNA_def_property_update(prop, NC_LOGIC, NULL);
- // XXX uiButSetFunc(but, check_armature_actuator, but, armAct); // the constraintbone must be from the armature
- /* XXX eventually move to a datablock pointer.
- (more likely to work than for the Bone in my opinion) */
+ RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
@@ -1207,7 +1860,7 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Secondary Target", "Set weight of this constraint");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Weight", "Set weight of this constraint");
@@ -1218,12 +1871,13 @@ void RNA_def_actuator(BlenderRNA *brna)
{
rna_def_actuator(brna);
+ rna_def_action_actuator(brna);
rna_def_object_actuator(brna);
- rna_def_ipo_actuator(brna);
+ rna_def_fcurve_actuator(brna);
rna_def_camera_actuator(brna);
rna_def_sound_actuator(brna);
rna_def_property_actuator(brna);
- rna_def_constraint_actuator(brna); // to be done
+ rna_def_constraint_actuator(brna);
rna_def_edit_object_actuator(brna);
rna_def_scene_actuator(brna);
rna_def_random_actuator(brna);
diff --git a/source/blender/makesrna/intern/rna_actuator_api.c b/source/blender/makesrna/intern/rna_actuator_api.c
new file mode 100644
index 00000000000..b61f9e252a6
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_actuator_api.c
@@ -0,0 +1,72 @@
+/**
+ * $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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2010 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s):
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "WM_types.h"
+#include "RNA_define.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_sca.h"
+#include "DNA_controller_types.h"
+#include "DNA_actuator_types.h"
+
+static void rna_Actuator_link(bActuator *act, bController *cont)
+{
+ link_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks, sizeof(bActuator *));
+}
+
+static void rna_Actuator_unlink(bActuator *act, bController *cont)
+{
+ unlink_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks);
+}
+
+#else
+
+void RNA_api_actuator(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "link", "rna_Actuator_link");
+ RNA_def_function_ui_description(func, "Link the actuator to a controller.");
+ parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_update(parm, NC_LOGIC, NULL);
+
+ func= RNA_def_function(srna, "unlink", "rna_Actuator_unlink");
+ RNA_def_function_ui_description(func, "Unlink the actuator from a controller.");
+ parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_update(parm, NC_LOGIC, NULL);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index fedba105a69..42cd6fd5911 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -327,7 +327,7 @@ static PointerRNA rna_KeyingSet_typeinfo_get(PointerRNA *ptr)
static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *reports,
- ID *id, char rna_path[], int index, int grouping_method, char group_name[])
+ ID *id, char rna_path[], int index, int group_method, char group_name[])
{
KS_Path *ksp = NULL;
short flag = 0;
@@ -340,7 +340,7 @@ static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *report
/* if data is valid, call the API function for this */
if (keyingset) {
- ksp= BKE_keyingset_add_path(keyingset, id, group_name, rna_path, index, flag, grouping_method);
+ ksp= BKE_keyingset_add_path(keyingset, id, group_name, rna_path, index, flag, group_method);
keyingset->active_path= BLI_countlist(&keyingset->paths);
}
else {
@@ -395,17 +395,17 @@ static void rna_def_common_keying_flags(StructRNA *srna, short reg)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "insertkey_needed", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_insertkey_needed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_NEEDED);
RNA_def_property_ui_text(prop, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves");
if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
- prop= RNA_def_property(srna, "insertkey_visual", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_insertkey_visual", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_MATRIX);
RNA_def_property_ui_text(prop, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'");
if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
- prop= RNA_def_property(srna, "insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_XYZ2RGB);
RNA_def_property_ui_text(prop, "F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis");
if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
@@ -489,7 +489,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ID");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_editable_func(prop, "rna_ksPath_id_editable");
- RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_ksPath_id_typef");
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_ksPath_id_typef", NULL);
RNA_def_property_ui_text(prop, "ID-Block", "ID-Block that keyframes for Keying Set should be added to (for Absolute Keying Sets only)");
prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
@@ -504,7 +504,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Group Name", "Name of Action Group to assign setting(s) for this path to");
/* Grouping */
- prop= RNA_def_property(srna, "grouping", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "group_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "groupmode");
RNA_def_property_enum_items(prop, keyingset_path_grouping_items);
RNA_def_property_ui_text(prop, "Grouping Method", "Method used to define which Group-name to use");
@@ -519,7 +519,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific setting if applicable");
/* Flags */
- prop= RNA_def_property(srna, "entire_array", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_entire_array", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KSP_FLAG_WHOLE_ARRAY);
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");
@@ -528,7 +528,6 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
}
-
/* keyingset.paths */
static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -536,6 +535,8 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
+
+ PropertyRNA *prop;
RNA_def_property_srna(cprop, "KeyingSetPaths");
srna= RNA_def_struct(brna, "KeyingSetPaths", NULL);
@@ -557,9 +558,9 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
parm= RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property."); // xxx hopefully this is long enough
RNA_def_property_flag(parm, PROP_REQUIRED);
/* index (defaults to -1 for entire array) */
- parm=RNA_def_int(func, "index", -1, 0, INT_MAX, "Index", "The index of the destination property (i.e. axis of Location/Rotation/etc.), or -1 for the entire array.", 0, INT_MAX);
+ parm=RNA_def_int(func, "index", -1, -1, INT_MAX, "Index", "The index of the destination property (i.e. axis of Location/Rotation/etc.), or -1 for the entire array.", 0, INT_MAX);
/* grouping */
- parm=RNA_def_enum(func, "grouping_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, "Grouping Method", "Method used to define which Group-name to use.");
+ parm=RNA_def_enum(func, "group_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, "Grouping Method", "Method used to define which Group-name to use.");
parm=RNA_def_string(func, "group_name", "", 64, "Group Name", "Name of Action Group to assign destination to (only if grouping mode is to use this name).");
@@ -569,13 +570,25 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* path to remove */
parm= RNA_def_pointer(func, "path", "KeyingSetPath", "Path", "");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* Remove All Paths */
func= RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear");
RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
+
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "KeyingSetPath");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_editable_func(prop, "rna_KeyingSet_active_ksPath_editable");
+ RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_active_ksPath_get", "rna_KeyingSet_active_ksPath_set", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "active_path");
+ RNA_def_property_int_funcs(prop, "rna_KeyingSet_active_ksPath_index_get", "rna_KeyingSet_active_ksPath_index_set", "rna_KeyingSet_active_ksPath_index_range");
+ RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index");
}
static void rna_def_keyingset(BlenderRNA *brna)
@@ -595,8 +608,8 @@ static void rna_def_keyingset(BlenderRNA *brna)
/* KeyingSetInfo (Type Info) for Builtin Sets only */
prop= RNA_def_property(srna, "type_info", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyingSetInfo");
- RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_typeinfo_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Type Info", "Callback function defines for builtin Keying Sets");
+ RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_typeinfo_get", NULL, NULL, NULL);
+ RNA_def_property_ui_text(prop, "Type Info", "Callback function defines for built-in Keying Sets");
/* Paths */
prop= RNA_def_property(srna, "paths", PROP_COLLECTION, PROP_NONE);
@@ -604,21 +617,10 @@ static void rna_def_keyingset(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "KeyingSetPath");
RNA_def_property_ui_text(prop, "Paths", "Keying Set Paths to define settings that get keyframed together");
rna_def_keyingset_paths(brna, prop);
-
- prop= RNA_def_property(srna, "active_path", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "KeyingSetPath");
- RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_editable_func(prop, "rna_KeyingSet_active_ksPath_editable");
- RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_active_ksPath_get", "rna_KeyingSet_active_ksPath_set", NULL);
- RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
-
- prop= RNA_def_property(srna, "active_path_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "active_path");
- RNA_def_property_int_funcs(prop, "rna_KeyingSet_active_ksPath_index_get", "rna_KeyingSet_active_ksPath_index_set", "rna_KeyingSet_active_ksPath_index_range");
- RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index");
-
+
/* Flags */
- prop= RNA_def_property(srna, "absolute", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_path_absolute", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_ABSOLUTE);
RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
@@ -658,7 +660,7 @@ void rna_def_animdata(BlenderRNA *brna)
/* Active Action */
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL, 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");
@@ -670,7 +672,7 @@ void rna_def_animdata(BlenderRNA *brna)
RNA_def_property_enum_items(prop, nla_mode_extend_items);
RNA_def_property_ui_text(prop, "Action Extrapolation", "Action to take for gaps past the Active Action's range (when evaluating with NLA)");
- prop= RNA_def_property(srna, "action_blending", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "action_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "act_blendmode");
RNA_def_property_enum_items(prop, nla_mode_blend_items);
RNA_def_property_ui_text(prop, "Action Blending", "Method used for combining Active Action's result with result of NLA stack");
@@ -688,7 +690,7 @@ void rna_def_animdata(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this datablock");
/* General Settings */
- prop= RNA_def_property(srna, "nla_enabled", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADT_NLA_EVAL_OFF);
RNA_def_property_ui_text(prop, "NLA Evaluation Enabled", "NLA stack is evaluated when evaluating this block");
}
diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c
index 5c745eac59f..1e62e10f211 100644
--- a/source/blender/makesrna/intern/rna_animation_api.c
+++ b/source/blender/makesrna/intern/rna_animation_api.c
@@ -44,8 +44,8 @@
void RNA_api_keyingset(StructRNA *srna)
{
- FunctionRNA *func;
- PropertyRNA *parm;
+// FunctionRNA *func;
+// PropertyRNA *parm;
}
#endif
diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c
index 95ff202a2d8..1fcd53d5d0f 100644
--- a/source/blender/makesrna/intern/rna_animviz.c
+++ b/source/blender/makesrna/intern/rna_animviz.c
@@ -104,9 +104,9 @@ static void rna_def_animviz_motionpath_vert(BlenderRNA *brna)
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Coordinates", "");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_VERT_SEL);
- RNA_def_property_ui_text(prop, "Selected", "Path point is selected for editing");
+ RNA_def_property_ui_text(prop, "Select", "Path point is selected for editing");
}
static void rna_def_animviz_motion_path(BlenderRNA *brna)
@@ -145,7 +145,7 @@ static void rna_def_animviz_motion_path(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // xxx
RNA_def_property_ui_text(prop, "Use Bone Heads", "For PoseBone paths, use the bone head location when calculating this path");
- prop= RNA_def_property(srna, "editing", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_FLAG_EDIT);
RNA_def_property_ui_text(prop, "Edit Path", "Path is being edited");
}
@@ -158,7 +158,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
PropertyRNA *prop;
static const EnumPropertyItem prop_type_items[] = {
- {GHOST_TYPE_NONE, "NONE", 0, "No Ghosts", "Don not show any ghosts"},
+ {GHOST_TYPE_NONE, "NONE", 0, "No Ghosts", "Do not show any ghosts"},
{GHOST_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Current Frame", "Show ghosts from around the current frame"},
{GHOST_TYPE_RANGE, "RANGE", 0, "In Range", "Show ghosts for the specified frame range"},
{GHOST_TYPE_KEYS, "KEYS", 0, "On Keyframes", "Show ghosts on keyframes"},
@@ -178,7 +178,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Settings */
- prop= RNA_def_property(srna, "only_selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ghost_flag", GHOST_FLAG_ONLYSEL);
RNA_def_property_ui_text(prop, "On Selected Bones Only", "For Pose-Mode drawing, only draw ghosts for selected bones");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
@@ -186,7 +186,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ghost_step");
RNA_def_property_range(prop, 1, 20);
- RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between ghosts shown (not for 'On Keyframes' Onion-skining method)");
+ RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between ghosts shown (not for 'On Keyframes' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Playback Ranges */
@@ -203,13 +203,13 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Around Current Ranges */
- prop= RNA_def_property(srna, "before_current", PROP_INT, PROP_TIME);
+ prop= RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghost_bc");
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "after_current", PROP_INT, PROP_TIME);
+ prop= RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghost_ac");
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)");
@@ -222,8 +222,8 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
PropertyRNA *prop;
static const EnumPropertyItem prop_type_items[]= {
- {MOTIONPATH_TYPE_RANGE, "RANGE", 0, "In Range", "Display Paths of poses within specified range"},
{MOTIONPATH_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display Paths of poses within a fixed number of frames around the current frame"},
+ {MOTIONPATH_TYPE_RANGE, "RANGE", 0, "In Range", "Display Paths of poses within specified range"},
{0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_location_items[]= {
{MOTIONPATH_BAKE_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"},
@@ -254,7 +254,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Frame Numbers", "Show frame numbers on Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "highlight_keyframes", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_keyframe_highlight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFRAS);
RNA_def_property_ui_text(prop, "Highlight Keyframes", "Emphasize position of keyframes on Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
@@ -264,10 +264,15 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Keyframe Numbers", "Show frame numbers of Keyframes on Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+ prop= RNA_def_property(srna, "show_keyframe_action_all", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFACT);
+ RNA_def_property_ui_text(prop, "All Action Keyframes", "For bone motion paths, search whole Action for keyframes instead of in group with matching name only (is slower)");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+
prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "path_step");
RNA_def_property_range(prop, 1, 100);
- RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between paths shown (not for 'On Keyframes' Onion-skining method)");
+ RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between paths shown (not for 'On Keyframes' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
@@ -285,13 +290,13 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Around Current Ranges */
- prop= RNA_def_property(srna, "before_current", PROP_INT, PROP_TIME);
+ prop= RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "path_bc");
RNA_def_property_range(prop, 1, MAXFRAMEF/2);
RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "after_current", PROP_INT, PROP_TIME);
+ prop= RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "path_ac");
RNA_def_property_range(prop, 1, MAXFRAMEF/2);
RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)");
@@ -320,17 +325,17 @@ static void rna_def_animviz(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Animation Visualisation", "Settings for the visualisation of motion");
/* onion-skinning settings (nested struct) */
- prop= RNA_def_property(srna, "onion_skinning", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "onion_skin_frames", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "AnimVizOnionSkinning");
- RNA_def_property_pointer_funcs(prop, "rna_AnimViz_onion_skinning_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_AnimViz_onion_skinning_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Onion Skinning", "Onion Skinning (ghosting) settings for visualisation");
/* motion path settings (nested struct) */
- prop= RNA_def_property(srna, "motion_paths", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "AnimVizMotionPaths");
- RNA_def_property_pointer_funcs(prop, "rna_AnimViz_motion_paths_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_AnimViz_motion_paths_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Motion Paths", "Motion Path settings for visualisation");
}
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 1ad63d63639..f2abe690218 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -108,6 +108,12 @@ void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, EditBone
BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone.", arm->id.name+2);
return;
}
+
+ if(BLI_findindex(arm->edbo, ebone) == -1) {
+ BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'.", arm->id.name+2, ebone->name);
+ return;
+ }
+
ED_armature_edit_bone_remove(arm, ebone);
}
@@ -123,7 +129,7 @@ static char *rna_Bone_path(PointerRNA *ptr)
return BLI_sprintfN("bones[\"%s\"]", ((Bone*)ptr->data)->name);
}
-static IDProperty *rna_Bone_idproperties(PointerRNA *ptr, int create)
+static IDProperty *rna_Bone_idprops(PointerRNA *ptr, int create)
{
Bone *bone= ptr->data;
@@ -135,7 +141,7 @@ static IDProperty *rna_Bone_idproperties(PointerRNA *ptr, int create)
return bone->prop;
}
-static IDProperty *rna_EditBone_idproperties(PointerRNA *ptr, int create)
+static IDProperty *rna_EditBone_idprops(PointerRNA *ptr, int create)
{
EditBone *ebone= ptr->data;
@@ -393,7 +399,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* flags */
- prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
RNA_def_property_array(prop, 32);
if(editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_layer_set");
@@ -401,49 +407,49 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
RNA_def_property_ui_text(prop, "Layers", "Layers bone exists in");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "connected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_connect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED);
if(editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_connected_set");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is struck to the parent's tail");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "hinge", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_hinge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_HINGE);
RNA_def_property_ui_text(prop, "Inherit Rotation", "Bone inherits rotation or scale from parent bone");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "multiply_vertexgroup_with_envelope", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_envelope_multiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_MULT_VG_ENV);
RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope", "When deforming bone, multiply effects of Vertex Group weights with Envelope influence");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "deform", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_deform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_DEFORM);
RNA_def_property_ui_text(prop, "Deform", "Bone does not deform any geometry");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "inherit_scale", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_inherit_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Inherit Scale", "Bone inherits scaling from parent bone");
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_SCALE);
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "local_location", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Local Location", "Bone location is set in local space");
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_LOCAL_LOCATION);
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "draw_wire", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE);
RNA_def_property_ui_text(prop, "Draw Wire", "Bone is always drawn as Wireframe regardless of viewport draw mode. Useful for non-obstructive custom bone shapes");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "cyclic_offset", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cyclic_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_CYCLICOFFSET);
RNA_def_property_ui_text(prop, "Cyclic Offset", "When bone doesn't have a parent, it receives cyclic offset effects");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "restrict_select", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_UNSELECTABLE);
RNA_def_property_ui_text(prop, "Selectable", "Bone is able to be selected");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
@@ -504,7 +510,7 @@ static void rna_def_bone(BlenderRNA *brna)
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");
- RNA_def_struct_idproperties_func(srna, "rna_Bone_idproperties");
+ RNA_def_struct_idprops_func(srna, "rna_Bone_idprops");
/* pointers/collections */
/* parent (pointer) */
@@ -523,14 +529,14 @@ static void rna_def_bone(BlenderRNA *brna)
rna_def_bone_common(srna, 0);
// XXX should we define this in PoseChannel wrapping code instead? but PoseChannels directly get some of their flags from here...
- prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P);
- RNA_def_property_ui_text(prop, "Hidden", "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)");
+ RNA_def_property_ui_text(prop, "Hide", "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED);
- RNA_def_property_ui_text(prop, "Selected", "");
+ RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* XXX better matrix descriptions possible (Arystan) */
@@ -572,7 +578,7 @@ static void rna_def_edit_bone(BlenderRNA *brna)
srna= RNA_def_struct(brna, "EditBone", NULL);
RNA_def_struct_sdna(srna, "EditBone");
- RNA_def_struct_idproperties_func(srna, "rna_EditBone_idproperties");
+ RNA_def_struct_idprops_func(srna, "rna_EditBone_idprops");
RNA_def_struct_ui_text(srna, "Edit Bone", "Editmode bone in an Armature datablock");
RNA_def_struct_ui_icon(srna, ICON_BONE_DATA);
@@ -580,7 +586,7 @@ static void rna_def_edit_bone(BlenderRNA *brna)
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EditBone");
- RNA_def_property_pointer_funcs(prop, "rna_EditBone_parent_get", "rna_EditBone_parent_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_EditBone_parent_get", "rna_EditBone_parent_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Parent", "Parent edit bone (in same Armature)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
@@ -604,29 +610,29 @@ static void rna_def_edit_bone(BlenderRNA *brna)
rna_def_bone_common(srna, 1);
- prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_A);
- RNA_def_property_ui_text(prop, "Hidden", "Bone is not visible when in Edit Mode");
+ RNA_def_property_ui_text(prop, "Hide", "Bone is not visible when in Edit Mode");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_EDITMODE_LOCKED);
- RNA_def_property_ui_text(prop, "Locked", "Bone is not able to be transformed when in Edit Mode");
+ RNA_def_property_ui_text(prop, "Lock", "Bone is not able to be transformed when in Edit Mode");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED);
- RNA_def_property_ui_text(prop, "Selected", "");
+ RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "selected_head", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_head", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ROOTSEL);
- RNA_def_property_ui_text(prop, "Head Selected", "");
+ RNA_def_property_ui_text(prop, "Head Select", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "selected_tail", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_tail", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_TIPSEL);
- RNA_def_property_ui_text(prop, "Tail Selected", "");
+ RNA_def_property_ui_text(prop, "Tail Select", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* calculated and read only, not actual data access */
@@ -664,7 +670,7 @@ static void rna_def_armature_bones(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_pointer_sdna(prop, NULL, "act_bone");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Bone", "Armatures active bone");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL, NULL);
/* todo, redraw */
// RNA_def_property_collection_active(prop, prop_act);
@@ -690,7 +696,7 @@ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active EditBone", "Armatures active edit bone");
//RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL, NULL);
/* todo, redraw */
// RNA_def_property_collection_active(prop, prop_act);
@@ -712,7 +718,7 @@ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove an existing bone from the armature");
/* target to remove*/
parm= RNA_def_pointer(func, "bone", "EditBone", "", "EditBone to remove");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
static void rna_def_armature(BlenderRNA *brna)
@@ -765,7 +771,8 @@ static void rna_def_armature(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "drawtype");
RNA_def_property_enum_items(prop, prop_drawtype_items);
RNA_def_property_ui_text(prop, "Draw Type", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
@@ -782,7 +789,7 @@ static void rna_def_armature(BlenderRNA *brna)
/* Boolean values */
/* layer */
- prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
RNA_def_property_array(prop, 32);
RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility");
@@ -791,54 +798,54 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
/* layer protection */
- prop= RNA_def_property(srna, "layer_protection", PROP_BOOLEAN, PROP_LAYER);
+ prop= RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1);
RNA_def_property_array(prop, 32);
RNA_def_property_ui_text(prop, "Layer Proxy Protection", "Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* flag */
- prop= RNA_def_property(srna, "draw_axes", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_axes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES);
RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "draw_names", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWNAMES);
RNA_def_property_ui_text(prop, "Draw Names", "Draw bone names");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "delay_deform", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_deform_delay", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DELAYDEFORM);
RNA_def_property_ui_text(prop, "Delay Deform", "Don't deform children when manipulating bones in Pose Mode");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "x_axis_mirror", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_MIRROR_EDIT);
RNA_def_property_ui_text(prop, "X-Axis Mirror", "Apply changes to matching bone on opposite side of X-Axis");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "auto_ik", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_ik", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_AUTO_IK);
RNA_def_property_ui_text(prop, "Auto IK", "Add temporaral IK constraints while grabbing bones in Pose Mode");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "draw_custom_bone_shapes", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_bone_custom_shapes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_NO_CUSTOM);
RNA_def_property_ui_text(prop, "Draw Custom Bone Shapes", "Draw bones with their custom shapes");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "draw_group_colors", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_COL_CUSTOM);
RNA_def_property_ui_text(prop, "Draw Bone Group Colors", "Draw bone group colors");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
// XXX depreceated ....... old animviz for armatures only
- prop= RNA_def_property(srna, "ghost_only_selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_only_ghost_selected", PROP_BOOLEAN, PROP_NONE);
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");
@@ -846,26 +853,21 @@ static void rna_def_armature(BlenderRNA *brna)
// XXX depreceated ....... old animviz for armatures only
/* deformflag */
- prop= RNA_def_property(srna, "deform_vertexgroups", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_deform_vertex_groups", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP);
RNA_def_property_ui_text(prop, "Deform Vertex Groups", "Enable Vertex Groups when defining deform");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "deform_envelope", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_deform_envelopes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE);
RNA_def_property_ui_text(prop, "Deform Envelopes", "Enable Bone Envelopes when defining deform");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "deform_quaternion", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION);
RNA_def_property_ui_text(prop, "Use Dual Quaternion Deformation", "Enable deform rotation with Quaternions");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "deform_bbone_rest", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_B_BONE_REST);
- RNA_def_property_ui_text(prop, "B-Bones Deform in Rest Position", "Make B-Bones deform already in Rest Position");
- RNA_def_property_update(prop, 0, "rna_Armature_update_data");
-
//prop= RNA_def_property(srna, "deform_invert_vertexgroups", PROP_BOOLEAN, PROP_NONE);
//RNA_def_property_boolean_negative_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP);
//RNA_def_property_ui_text(prop, "Invert Vertex Group Influence", "Invert Vertex Group influence (only for Modifiers)");
@@ -877,14 +879,14 @@ static void rna_def_armature(BlenderRNA *brna)
prop= RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ghostep");
RNA_def_property_range(prop, 0, 30);
- RNA_def_property_ui_text(prop, "Ghosting Step", "Number of frame steps on either side of current frame to show as ghosts (only for 'Around Current Frame' Onion-skining method)");
+ RNA_def_property_ui_text(prop, "Ghosting Step", "Number of frame steps on either side of current frame to show as ghosts (only for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
prop= RNA_def_property(srna, "ghost_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ghostsize");
RNA_def_property_range(prop, 1, 20);
- RNA_def_property_ui_text(prop, "Ghosting Frame Step", "Frame step for Ghosts (not for 'On Keyframes' Onion-skining method)");
+ RNA_def_property_ui_text(prop, "Ghosting Frame Step", "Frame step for Ghosts (not for 'On Keyframes' Onion-skinning method)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index ddf9cf1aeda..3afa135d079 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -83,7 +83,7 @@ static void rna_Boids_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
else
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -97,9 +97,9 @@ static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
else
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr)
@@ -238,7 +238,7 @@ static void rna_def_boidrule_goal(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Object", "Goal object");
RNA_def_property_update(prop, 0, "rna_Boids_reset_deps");
- prop= RNA_def_property(srna, "predict", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_predict", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT);
RNA_def_property_ui_text(prop, "Predict", "Predict target movement");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -259,14 +259,14 @@ static void rna_def_boidrule_avoid(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Object", "Object to avoid");
RNA_def_property_update(prop, 0, "rna_Boids_reset_deps");
- prop= RNA_def_property(srna, "predict", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_predict", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT);
RNA_def_property_ui_text(prop, "Predict", "Predict target movement");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "fear_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
- RNA_def_property_ui_text(prop, "Fear factor", "Avoid object if danger from it is above this threshol");
+ RNA_def_property_ui_text(prop, "Fear factor", "Avoid object if danger from it is above this threshold");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
}
@@ -278,12 +278,12 @@ static void rna_def_boidrule_avoid_collision(BlenderRNA *brna)
srna= RNA_def_struct(brna, "BoidRuleAvoidCollision", "BoidRule");
RNA_def_struct_ui_text(srna, "Avoid Collision", "");
- prop= RNA_def_property(srna, "boids", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_avoid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_BOIDS);
RNA_def_property_ui_text(prop, "Boids", "Avoid collision with other boids");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "deflectors", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_avoid_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_DEFLECTORS);
RNA_def_property_ui_text(prop, "Deflectors", "Avoid collision with deflector objects");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -313,12 +313,13 @@ static void rna_def_boidrule_follow_leader(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Distance", "Distance behind leader to follow");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "queue_size", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "queue_count", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "queue_size");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Queue Size", "How many boids in a line");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "line", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_LEADER_IN_LINE);
RNA_def_property_ui_text(prop, "Line", "Follow leader in a line");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -391,17 +392,17 @@ static void rna_def_boidrule(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "");
/* flags */
- prop= RNA_def_property(srna, "in_air", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_in_air", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_IN_AIR);
RNA_def_property_ui_text(prop, "In Air", "Use rule when boid is flying");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "on_land", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_on_land", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_ON_LAND);
RNA_def_property_ui_text(prop, "On Land", "Use rule when boid is on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- //prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
+ //prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
//RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded);
//RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
@@ -436,16 +437,17 @@ static void rna_def_boidstate(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_boid_rule", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidRule");
- RNA_def_property_pointer_funcs(prop, "rna_BoidState_active_boid_rule_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_BoidState_active_boid_rule_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Boid Rule", "");
prop= RNA_def_property(srna, "active_boid_rule_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_BoidState_active_boid_rule_index_get", "rna_BoidState_active_boid_rule_index_set", "rna_BoidState_active_boid_rule_index_range");
RNA_def_property_ui_text(prop, "Active Boid Rule Index", "");
- prop= RNA_def_property(srna, "rule_fuzziness", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "rule_fuzzy", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "rule_fuzziness");
RNA_def_property_range(prop, 0.0, 1.0);
- RNA_def_property_ui_text(prop, "Rule Fuzzines", "");
+ RNA_def_property_ui_text(prop, "Rule Fuzziness", "");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
@@ -466,12 +468,14 @@ static void rna_def_boid_settings(BlenderRNA *brna)
srna = RNA_def_struct(brna, "BoidSettings", NULL);
RNA_def_struct_ui_text(srna, "Boid Settings", "Settings for boid physics");
- prop= RNA_def_property(srna, "landing_smoothness", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "land_smooth", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "landing_smoothness");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Landing Smoothness", "How smoothly the boids land");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "banking", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "bank", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "banking");
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Banking", "Amount of rotation around velocity vector on turns");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -488,7 +492,7 @@ static void rna_def_boid_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_boid_state", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidRule");
- RNA_def_property_pointer_funcs(prop, "rna_BoidSettings_active_boid_state_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_BoidSettings_active_boid_state_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Boid Rule", "");
prop= RNA_def_property(srna, "active_boid_state_index", PROP_INT, PROP_UNSIGNED);
@@ -522,22 +526,26 @@ static void rna_def_boid_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Boids_reset");
/* physical properties */
- prop= RNA_def_property(srna, "air_min_speed", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "air_speed_min", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "air_min_speed");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Min Air Speed", "Minimum speed in air (relative to maximum speed)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "air_max_speed", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "air_speed_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "air_max_speed");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Max Air Speed", "Maximum speed in air");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "air_max_acc", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "air_acc_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "air_max_acc");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Air Acceleration", "Maximum acceleration in air (relative to maximum speed)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "air_max_ave", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "air_ave_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "air_max_ave");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Air Angular Velocity", "Maximum angular velocity in air (relative to 180 degrees)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -552,17 +560,20 @@ static void rna_def_boid_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Jump Speed", "Maximum speed for jumping");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "land_max_speed", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "land_speed_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "land_max_speed");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Max Land Speed", "Maximum speed on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "land_max_acc", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "land_acc_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "land_max_acc");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Land Acceleration", "Maximum acceleration on land (relative to maximum speed)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "land_max_ave", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "land_ave_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "land_max_ave");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Land Angular Velocity", "Maximum angular velocity on land (relative to 180 degrees)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -578,17 +589,17 @@ static void rna_def_boid_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Boids_reset");
/* options */
- prop= RNA_def_property(srna, "allow_flight", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_flight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_FLIGHT);
RNA_def_property_ui_text(prop, "Allow Flight", "Allow boids to move in air");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "allow_land", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_land", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_LAND);
RNA_def_property_ui_text(prop, "Allow Land", "Allow boids to move on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "allow_climb", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_climb", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_CLIMB);
RNA_def_property_ui_text(prop, "Allow Climbing", "Allow boids to climb goal objects");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index fff29ba8f56..83d40a3802b 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -30,25 +30,266 @@
#include "DNA_brush_types.h"
#include "DNA_texture_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
#include "BLI_math.h"
#include "IMB_imbuf.h"
+
#include "WM_types.h"
+static EnumPropertyItem prop_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}};
+
+EnumPropertyItem brush_sculpt_tool_items[] = {
+ {SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""},
+ {SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""},
+ {SCULPT_TOOL_CREASE, "CREASE",ICON_BRUSH_CREASE, "Crease", ""},
+ {SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""},
+ {SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""},
+ {SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""},
+ {SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""},
+ {SCULPT_TOOL_INFLATE, "INFLATE", ICON_BRUSH_INFLATE, "Inflate", ""},
+ {SCULPT_TOOL_LAYER, "LAYER", ICON_BRUSH_LAYER, "Layer", ""},
+ {SCULPT_TOOL_NUDGE, "NUDGE", ICON_BRUSH_NUDGE, "Nudge", ""},
+ {SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_PINCH, "Pinch", ""},
+ {SCULPT_TOOL_ROTATE, "ROTATE", ICON_BRUSH_ROTATE, "Rotate", ""},
+ {SCULPT_TOOL_SCRAPE, "SCRAPE", ICON_BRUSH_SCRAPE, "Scrape", ""},
+ {SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_SMOOTH, "Smooth", ""},
+ {SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_SNAKE_HOOK, "Snake Hook", ""},
+ {SCULPT_TOOL_THUMB, "THUMB", ICON_BRUSH_THUMB, "Thumb", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+
+EnumPropertyItem brush_vertexpaint_tool_items[] = {
+ {0, "MIX", ICON_BRUSH_MIX, "Mix", "Use mix blending mode while painting"},
+ {1, "ADD", ICON_BRUSH_ADD, "Add", "Use add blending mode while painting"},
+ {2, "SUB", ICON_BRUSH_SUBTRACT, "Subtract", "Use subtract blending mode while painting"},
+ {3, "MUL", ICON_BRUSH_MULTIPLY, "Multiply", "Use multiply blending mode while painting"},
+ {4, "BLUR", ICON_BRUSH_BLUR, "Blur", "Blur the color with surrounding values"},
+ {5, "LIGHTEN", ICON_BRUSH_LIGHTEN, "Lighten", "Use lighten blending mode while painting"},
+ {6, "DARKEN", ICON_BRUSH_DARKEN, "Darken", "Use darken blending mode while painting"},
+ {0, NULL, 0, NULL, NULL}};
+
+EnumPropertyItem brush_imagepaint_tool_items[] = {
+ {PAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_TEXDRAW, "Draw", ""},
+ {PAINT_TOOL_SOFTEN, "SOFTEN", ICON_BRUSH_SOFTEN, "Soften", ""},
+ {PAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SMEAR, "Smear", ""},
+ {PAINT_TOOL_CLONE, "CLONE", ICON_BRUSH_CLONE, "Clone", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
+#include "DNA_object_types.h"
+
+#include "RNA_access.h"
+
#include "BKE_texture.h"
+#include "BKE_brush.h"
+#include "BKE_icons.h"
+
+#include "BKE_paint.h"
#include "WM_api.h"
+static void rna_Brush_reset_icon(Brush *br, char *type)
+{
+ ID *id = &br->id;
+
+ if(br->flag & BRUSH_CUSTOM_ICON)
+ return;
+
+ if(id->icon_id >= BIFICONID_LAST) {
+ BKE_icon_delete(id);
+ BKE_previewimg_free_id(id);
+ }
+
+ id->icon_id = 0;
+}
+
static void rna_Brush_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Brush *br= (Brush*)ptr->data;
WM_main_add_notifier(NC_BRUSH|NA_EDITED, br);
+ //WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL);
+}
+
+static void rna_Brush_sculpt_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Brush *br= (Brush*)ptr->data;
+ rna_Brush_reset_icon(br, "sculpt");
+ rna_Brush_update(bmain, scene, ptr);
+}
+
+static void rna_Brush_vertexpaint_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Brush *br= (Brush*)ptr->data;
+ rna_Brush_reset_icon(br, "vertex_paint");
+ rna_Brush_update(bmain, scene, ptr);
+}
+
+static void rna_Brush_imagepaint_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Brush *br= (Brush*)ptr->data;
+ rna_Brush_reset_icon(br, "texture_paint");
+ rna_Brush_update(bmain, scene, ptr);
+}
+
+static void rna_Brush_icon_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Brush *br= (Brush*)ptr->data;
+
+ if(br->icon_imbuf) {
+ IMB_freeImBuf(br->icon_imbuf);
+ br->icon_imbuf= NULL;
+ }
+
+ br->id.icon_id = 0;
+
+ if(br->flag & BRUSH_CUSTOM_ICON) {
+ BKE_previewimg_get(&br->id);
+ BKE_icon_changed(BKE_icon_getid(&br->id));
+ }
+
+ WM_main_add_notifier(NC_BRUSH|NA_EDITED, br);
+}
+
+static void rna_Brush_set_size(PointerRNA *ptr, int value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_size(me, value);
+}
+
+static int rna_Brush_get_size(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_size(me);
+}
+
+static void rna_Brush_set_use_locked_size(PointerRNA *ptr, int value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_use_locked_size(me, value);
+}
+
+static int rna_Brush_get_use_locked_size(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_use_locked_size(me);
+}
+
+static void rna_Brush_set_use_size_pressure(PointerRNA *ptr, int value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_use_size_pressure(me, value);
+}
+
+static int rna_Brush_get_use_size_pressure(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_use_size_pressure(me);
+}
+
+static void rna_Brush_set_use_alpha_pressure(PointerRNA *ptr, int value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_use_alpha_pressure(me, value);
+}
+
+static int rna_Brush_get_use_alpha_pressure(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_use_alpha_pressure(me);
+}
+
+static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_unprojected_radius(me, value);
+}
+
+static float rna_Brush_get_unprojected_radius(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_unprojected_radius(me);
+}
+
+static void rna_Brush_set_alpha(PointerRNA *ptr, float value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_alpha(me, value);
+}
+
+static float rna_Brush_get_alpha(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_alpha(me);
+}
+
+static EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ static EnumPropertyItem prop_default_items[]= {
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_flatten_contrast_items[]= {
+ {0, "FLATTEN", 0, "Flatten", "Add effect of brush"},
+ {BRUSH_DIR_IN, "CONTRAST", 0, "Contrast", "Subtract effect of brush"},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_fill_deepen_items[]= {
+ {0, "FILL", 0, "Fill", "Add effect of brush"},
+ {BRUSH_DIR_IN, "DEEPEN", 0, "Deepen", "Subtract effect of brush"},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_scrape_peaks_items[]= {
+ {0, "SCRAPE", 0, "Scrape", "Add effect of brush"},
+ {BRUSH_DIR_IN, "PEAKS", 0, "Peaks", "Subtract effect of brush"},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_pinch_magnify_items[]= {
+ {0, "PINCH", 0, "Pinch", "Add effect of brush"},
+ {BRUSH_DIR_IN, "MAGNIFY", 0, "Magnify", "Subtract effect of brush"},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_inflate_deflate_items[]= {
+ {0, "INFLATE", 0, "Inflate", "Add effect of brush"},
+ {BRUSH_DIR_IN, "DEFLATE", 0, "Deflate", "Subtract effect of brush"},
+ {0, NULL, 0, NULL, NULL}};
+
+ Brush *me= (Brush*)(ptr->data);
+
+ switch (me->sculpt_tool) {
+ case SCULPT_TOOL_DRAW:
+ case SCULPT_TOOL_CREASE:
+ case SCULPT_TOOL_BLOB:
+ case SCULPT_TOOL_LAYER:
+ case SCULPT_TOOL_CLAY:
+ return prop_direction_items;
+
+ case SCULPT_TOOL_FLATTEN:
+ return prop_flatten_contrast_items;
+
+ case SCULPT_TOOL_FILL:
+ return prop_fill_deepen_items;
+
+ case SCULPT_TOOL_SCRAPE:
+ return prop_scrape_peaks_items;
+
+ case SCULPT_TOOL_PINCH:
+ return prop_pinch_magnify_items;
+
+ case SCULPT_TOOL_INFLATE:
+ return prop_inflate_deflate_items;
+
+ default:
+ return prop_default_items;
+ }
}
#else
@@ -97,43 +338,37 @@ static void rna_def_brush(BlenderRNA *brna)
{IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem brush_sculpt_tool_items[] = {
- {SCULPT_TOOL_DRAW, "DRAW", 0, "Draw", ""},
- {SCULPT_TOOL_SMOOTH, "SMOOTH", 0, "Smooth", ""},
- {SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", ""},
- {SCULPT_TOOL_INFLATE, "INFLATE", 0, "Inflate", ""},
- {SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", ""},
- {SCULPT_TOOL_LAYER, "LAYER", 0, "Layer", ""},
- {SCULPT_TOOL_FLATTEN, "FLATTEN", 0, "Flatten", ""},
- {SCULPT_TOOL_CLAY, "CLAY", 0, "Clay", ""},
+ static EnumPropertyItem brush_stroke_method_items[] = {
+ {0, "DOTS", 0, "Dots", ""},
+ {BRUSH_RESTORE_MESH, "DRAG_DOT", 0, "Drag Dot", ""},
+ {BRUSH_SPACE, "SPACE", 0, "Space", ""},
+ {BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", ""},
+ {BRUSH_AIRBRUSH, "AIRBRUSH", 0, "Airbrush", ""},
{0, NULL, 0, NULL, NULL}};
-
- static EnumPropertyItem brush_vertexpaint_tool_items[] = {
- {0, "MIX", 0, "Mix", "Use mix blending mode while painting"},
- {1, "ADD", 0, "Add", "Use add blending mode while painting"},
- {2, "SUB", 0, "Subtract", "Use subtract blending mode while painting"},
- {3, "MUL", 0, "Multiply", "Use multiply blending mode while painting"},
- {4, "BLUR", 0, "Blur", "Blur the color with surrounding values"},
- {5, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting"},
- {6, "DARKEN", 0, "Darken", "Use darken blending mode while painting"},
+
+ static EnumPropertyItem texture_angle_source_items[] = {
+ {0, "USER", 0, "User", ""},
+ {BRUSH_RAKE, "RAKE", 0, "Rake", ""},
+ {BRUSH_RANDOM_ROTATION, "RANDOM", 0, "Random", ""},
{0, NULL, 0, NULL, NULL}};
-
- static EnumPropertyItem brush_imagepaint_tool_items[] = {
- {PAINT_TOOL_DRAW, "DRAW", 0, "Draw", ""},
- {PAINT_TOOL_SOFTEN, "SOFTEN", 0, "Soften", ""},
- {PAINT_TOOL_SMEAR, "SMEAR", 0, "Smear", ""},
- {PAINT_TOOL_CLONE, "CLONE", 0, "Clone", ""},
+
+ static EnumPropertyItem texture_angle_source_no_random_items[] = {
+ {0, "USER", 0, "User", ""},
+ {BRUSH_RAKE, "RAKE", 0, "Rake", ""},
{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"},
+
+ static EnumPropertyItem brush_sculpt_plane_items[] = {
+ {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""},
+ {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""},
+ {SCULPT_DISP_DIR_X, "X", 0, "X Plane", ""},
+ {SCULPT_DISP_DIR_Y, "Y", 0, "Y Plane", ""},
+ {SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""},
{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");
RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA);
-
+
/* enums */
prop= RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_blend_items);
@@ -143,48 +378,82 @@ static void rna_def_brush(BlenderRNA *brna)
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");
-
+ RNA_def_property_update(prop, 0, "rna_Brush_sculpt_tool_update");
+
prop= RNA_def_property(srna, "vertexpaint_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, brush_vertexpaint_tool_items);
RNA_def_property_ui_text(prop, "Vertex/Weight Paint Tool", "");
- RNA_def_property_update(prop, 0, "rna_Brush_update");
+ RNA_def_property_update(prop, 0, "rna_Brush_vertexpaint_tool_update");
prop= RNA_def_property(srna, "imagepaint_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, brush_imagepaint_tool_items);
RNA_def_property_ui_text(prop, "Image Paint Tool", "");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_imagepaint_tool_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_enum_items(prop, prop_direction_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_direction_itemf");
+ RNA_def_property_ui_text(prop, "Direction", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, brush_stroke_method_items);
+ RNA_def_property_ui_text(prop, "Stroke Method", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "texture_angle_source_random", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, texture_angle_source_items);
+ RNA_def_property_ui_text(prop, "Texture Angle Source", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "texture_angle_source_no_random", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, texture_angle_source_no_random_items);
+ RNA_def_property_ui_text(prop, "Texture Angle Source", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, brush_sculpt_plane_items);
+ RNA_def_property_ui_text(prop, "Sculpt Plane", "");
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");
+ prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
+ RNA_def_property_int_funcs(prop, "rna_Brush_get_size", "rna_Brush_set_size", NULL);
+ RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10);
+ RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0);
+ RNA_def_property_ui_text(prop, "Size", "Radius of the brush in pixels");
RNA_def_property_update(prop, 0, "rna_Brush_update");
+ prop= RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_funcs(prop, "rna_Brush_get_unprojected_radius", "rna_Brush_set_unprojected_radius", NULL);
+ RNA_def_property_range(prop, 0.001, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.001, 1, 0, 0);
+ RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
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, "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");
+ prop= RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
+ RNA_def_property_int_sdna(prop, NULL, "spacing");
+ RNA_def_property_range(prop, 1, 1000);
+ RNA_def_property_ui_range(prop, 1, 500, 5, 0);
+ RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_DISTANCE);
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);
+ prop= RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR);
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");
@@ -202,10 +471,57 @@ static void rna_def_brush(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "alpha");
+ RNA_def_property_float_funcs(prop, "rna_Brush_get_alpha", "rna_Brush_set_alpha", NULL);
+ RNA_def_property_float_default(prop, 0.5f);
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 0.001);
+ RNA_def_property_ui_text(prop, "Strength", "How powerful the effect of the brush is when applied");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_sdna(prop, NULL, "plane_offset");
+ RNA_def_property_float_default(prop, 0);
+ RNA_def_property_range(prop, -2.0f, 2.0f);
+ RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 0.001);
+ RNA_def_property_ui_text(prop, "Plane Offset", "Adjusts plane on which the brush acts towards or away from the object surface");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_sdna(prop, NULL, "plane_trim");
+ RNA_def_property_float_default(prop, 0.5f);
+ RNA_def_property_range(prop, 0, 1.0f);
+ RNA_def_property_ui_text(prop, "Plane Trim", "If a vertex is further from offset plane than this then it is not affected");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_sdna(prop, NULL, "texture_sample_bias");
+ RNA_def_property_float_default(prop, 0);
+ RNA_def_property_range(prop, -1, 1);
+ RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "normal_weight");
+ RNA_def_property_float_default(prop, 0);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Normal Weight", "How much grab will pull vertexes out of surface during a grab");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "crease_pinch_factor");
+ RNA_def_property_float_default(prop, 2.0f/3.0f);
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_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "autosmooth_factor");
+ RNA_def_property_float_default(prop, 0);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 0.001);
+ RNA_def_property_ui_text(prop, "Autosmooth", "Amount of smoothing to automatically apply to each stroke");
RNA_def_property_update(prop, 0, "rna_Brush_update");
/* flag */
@@ -214,40 +530,74 @@ static void rna_def_brush(BlenderRNA *brna)
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, "use_original_normal", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_NORMAL);
+ RNA_def_property_ui_text(prop, "Original Normal", "When locked keep using normal of surface where stroke was initiated");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
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, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
+ RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_alpha_pressure", "rna_Brush_set_use_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, "use_size_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_OFFSET_PRESSURE);
+ RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
+ RNA_def_property_ui_text(prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
+ RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_size_pressure", "rna_Brush_set_use_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, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pressure_jitter", 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, "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);
+ prop= RNA_def_property(srna, "use_pressure_spacing", 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, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERSE_SMOOTH_PRESSURE);
+ RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
+ RNA_def_property_ui_text(prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
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, "use_random_rotation", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RANDOM_ROTATION);
+ RNA_def_property_ui_text(prop, "Random Rotation", "Rotate the brush texture at random");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PLANE_TRIM);
+ RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FRONTFACE);
+ RNA_def_property_ui_text(prop, "Use Front-Face", "Brush only affects vertexes that face the viewer");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
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");
@@ -273,6 +623,38 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke dabs on top of each other");
RNA_def_property_update(prop, 0, "rna_Brush_update");
+ prop= RNA_def_property(srna, "use_space_atten", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE_ATTEN);
+ RNA_def_property_ui_text(prop, "Use Automatic Strength Adjustment", "Automatically adjusts strength to give consistent results for different spacings");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ /* adaptive space is not implemented yet */
+ prop= RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ADAPTIVE_SPACE);
+ RNA_def_property_ui_text(prop, "Adaptive Spacing", "Space daubs according to surface orientation instead of screen space");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_locked_size", "rna_Brush_set_use_locked_size");
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LOCK_SIZE);
+ RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "use_texture_overlay", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TEXTURE_OVERLAY);
+ RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_EDGE_TO_EDGE);
+ RNA_def_property_ui_text(prop, "Edge-to-edge", "Drag anchor brush from edge-to-edge");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RESTORE_MESH);
+ RNA_def_property_ui_text(prop, "Restore Mesh", "Allows a single dot to be carefully positioned");
+ 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);
@@ -290,6 +672,23 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve");
RNA_def_property_update(prop, 0, "rna_Brush_update");
+ /* paint mode flags */
+ prop= RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_SCULPT);
+ RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode");
+
+ prop= RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_VERTEX_PAINT);
+ RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode");
+
+ prop= RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_WEIGHT_PAINT);
+ RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode");
+
+ prop= RNA_def_property(srna, "use_paint_texture", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_TEXTURE_PAINT);
+ RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode");
+
/* texture */
prop= RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BrushTextureSlot");
@@ -303,6 +702,34 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Texture", "");
RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_update");
+ prop= RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
+ RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha");
+ RNA_def_property_range(prop, 1, 100);
+ RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "add_col");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "sub_col");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Subract Color", "Color of cursor when subtracting");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_CUSTOM_ICON);
+ RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file");
+ RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
+
+ prop= RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_string_sdna(prop, NULL, "icon_filepath");
+ RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon");
+ RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
+
/* clone tool */
prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
@@ -357,16 +784,19 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure");
- prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "pen_flip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
- RNA_def_property_ui_text(prop, "Time", "");
+ RNA_def_property_ui_text(prop, "Flip", "");
- prop= RNA_def_property(srna, "flip", PROP_BOOLEAN, PROP_NONE);
+ // used in uv painting
+ prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
- RNA_def_property_ui_text(prop, "Flip", "");
+ RNA_def_property_ui_text(prop, "Time", "");
/* XXX: Tool (this will be for pressing a modifier key for a different brush,
e.g. switching to a Smooth brush in the middle of the stroke */
+
+ // XXX: i don't think blender currently supports the ability to properly do a remappable modifier in the middle of a stroke
}
void RNA_def_brush(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index c4dc461ad38..9d82c472882 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -36,29 +36,20 @@
#ifdef RNA_RUNTIME
-static void rna_Camera_angle_update(Main *bmain, Scene *scene, 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(Main *bmain, Scene *scene, PointerRNA *ptr)
-{
- Camera *cam= (Camera*)ptr->id.data;
- cam->angle= 360.0f * atan(16.0f/cam->lens) / M_PI;
-}
+#include "BKE_object.h"
/* only for rad/deg conversion! can remove later */
static float rna_Camera_angle_get(PointerRNA *ptr)
{
Camera *cam= ptr->id.data;
- return cam->angle * (M_PI / 180.0);
+
+ return lens_to_angle(cam->lens);
}
static void rna_Camera_angle_set(PointerRNA *ptr, float value)
{
Camera *cam= ptr->id.data;
- cam->angle= value * (180.0 / M_PI);
+ cam->lens= angle_to_lens(value);
}
#else
@@ -93,19 +84,13 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
- RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
- RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lens field of view in degrees");
- RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL); /* only for deg/rad conversion */
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_angle_update");
-
- prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 1.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance");
@@ -115,7 +100,13 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "lens");
RNA_def_property_range(prop, 1.0f, 5000.0f);
RNA_def_property_ui_text(prop, "Lens", "Perspective Camera lens value in millimeters");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_lens_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+
+ prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
+ RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lens field of view in degrees");
+ RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL); /* only for deg/rad conversion */
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
@@ -123,7 +114,7 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "drawsize");
RNA_def_property_range(prop, 0.1f, 1000.0f);
RNA_def_property_ui_range(prop, 0.01, 100, 1, 1);
@@ -144,7 +135,7 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Shift Y", "Perspective Camera vertical shift");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "YF_dofdist");
RNA_def_property_range(prop, 0.0f, 5000.0f);
RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field");
@@ -181,7 +172,7 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_lens_unit_items);
RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface");
- prop= RNA_def_property(srna, "panorama", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_panorama", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_PANORAMA);
RNA_def_property_ui_text(prop, "Panorama", "Render the scene with a cylindrical camera for pseudo-fisheye lens effects");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 3518044a601..e40bbcbbf50 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -273,7 +273,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Air Damping", "Air has normally some thickness which slows falling things down");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "pin_cloth", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pin_cloth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL);
RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions");
RNA_def_property_update(prop, 0, "rna_cloth_update");
@@ -292,7 +292,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
/* springs */
- prop= RNA_def_property(srna, "stiffness_scaling", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stiffness_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING);
RNA_def_property_ui_text(prop, "Stiffness Scaling", "If enabled, stiffness can be scaled along a weight painted vertex group");
RNA_def_property_update(prop, 0, "rna_cloth_update");
@@ -353,7 +353,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "rest_shape_key", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "ShapeKey");
- RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get", "rna_ClothSettings_rest_shape_key_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get", "rna_ClothSettings_rest_shape_key_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Rest Shade Key", "Shape key to use the rest spring lengths from");
RNA_def_property_update(prop, 0, "rna_cloth_update");
@@ -407,12 +407,12 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
/* general collision */
- prop= RNA_def_property(srna, "enable_collision", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_ENABLED);
RNA_def_property_ui_text(prop, "Enable Collision", "Enable collisions with other objects");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "epsilon");
RNA_def_property_range(prop, 0.001f, 1.0f);
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in");
@@ -431,12 +431,12 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
/* self collision */
- prop= RNA_def_property(srna, "enable_self_collision", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_self_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_SELF);
RNA_def_property_ui_text(prop, "Enable Self Collision", "Enable self collisions");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "self_min_distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "self_distance_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "selfepsilon");
RNA_def_property_range(prop, 0.5f, 1.0f);
RNA_def_property_ui_text(prop, "Self Minimum Distance", "0.5 means no distance at all, 1.0 is maximum distance");
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index daf3f73a3d7..89f3e459105 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -26,8 +26,10 @@
#include <stdio.h>
#include "RNA_define.h"
+#include "rna_internal.h"
#include "DNA_color_types.h"
+#include "DNA_texture_types.h"
#ifdef RNA_RUNTIME
@@ -41,6 +43,7 @@
#include "BKE_colortools.h"
#include "BKE_depsgraph.h"
#include "BKE_node.h"
+#include "BKE_texture.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -269,6 +272,34 @@ static void rna_ColorRamp_update(Main *bmain, Scene *scene, PointerRNA *ptr)
}
}
+static void rna_ColorRamp_eval(struct ColorBand *coba, float position, float color[4])
+{
+ do_colorband(coba, position, color);
+}
+
+static CBData *rna_ColorRampElement_new(struct ColorBand *coba, ReportList *reports, float position)
+{
+ CBData *element= colorband_element_add(coba, position);
+
+ if(element==NULL)
+ BKE_reportf(reports, RPT_ERROR, "Unable to add element to colorband (limit %d)", MAXCOLORBAND);
+
+ return element;
+}
+
+static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *reports, CBData *element)
+{
+ int index = (int)(element - coba->data);
+ if(colorband_element_remove(coba, index) == 0)
+ BKE_report(reports, RPT_ERROR, "Element not found in element collection or last element");
+
+}
+
+static void rna_Scopes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Scopes *s= (Scopes*)ptr->data;
+ s->ok = 0;
+}
#else
@@ -299,9 +330,9 @@ static void rna_def_curvemappoint(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Handle Type", "Curve interpolation at this point: bezier or vector");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_SELECT);
- RNA_def_property_ui_text(prop, "Selected", "Selection state of the curve point");
+ RNA_def_property_ui_text(prop, "Select", "Selection state of the curve point");
}
static void rna_def_curvemap(BlenderRNA *brna)
@@ -339,7 +370,7 @@ static void rna_def_curvemapping(BlenderRNA *brna)
srna= RNA_def_struct(brna, "CurveMapping", NULL);
RNA_def_struct_ui_text(srna, "CurveMapping", "Curve mapping to map color, vector and scalar values to other values using a user defined curve");
- prop= RNA_def_property(srna, "clip", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_DO_CLIP);
RNA_def_property_ui_text(prop, "Clip", "Force the curve view to fit a defined boundary");
RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveMapping_clip_set");
@@ -390,7 +421,7 @@ static void rna_def_color_ramp_element(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
-
+
srna= RNA_def_struct(brna, "ColorRampElement", NULL);
RNA_def_struct_sdna(srna, "CBData");
RNA_def_struct_path_func(srna, "rna_ColorRampElement_path");
@@ -409,11 +440,41 @@ static void rna_def_color_ramp_element(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
}
+static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *parm;
+ FunctionRNA *func;
+
+ RNA_def_property_srna(cprop, "ColorRampElements");
+ srna= RNA_def_struct(brna, "ColorRampElements", NULL);
+ RNA_def_struct_sdna(srna, "ColorBand");
+ RNA_def_struct_path_func(srna, "rna_ColorRampElement_path");
+ RNA_def_struct_ui_text(srna, "Color Ramp Elements", "Collection of Color Ramp Elements");
+
+ /* TODO, make these functions generic in texture.c */
+ func = RNA_def_function(srna, "new", "rna_ColorRampElement_new");
+ RNA_def_function_ui_description(func, "Add element to ColorRamp");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_float(func, "position", 0.0f, 0.0f, 1.0f, "Position", "Position to add element", 0.0f, 1.0f);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "New element.");
+ RNA_def_function_return(func, parm);
+
+ func = RNA_def_function(srna, "remove", "rna_ColorRampElement_remove");
+ RNA_def_function_ui_description(func, "Delete element from ColorRamp");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+}
+
static void rna_def_color_ramp(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
-
+ FunctionRNA *func;
+
static EnumPropertyItem prop_interpolation_items[] = {
{1, "EASE", 0, "Ease", ""},
{3, "CARDINAL", 0, "Cardinal", ""},
@@ -432,23 +493,108 @@ static void rna_def_color_ramp(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ColorRampElement");
RNA_def_property_ui_text(prop, "Elements", "");
RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
-
+ rna_def_color_ramp_element_api(brna, prop);
+
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, 0, "rna_ColorRamp_update");
+
+#if 0 // use len(elements)
+ prop= RNA_def_property(srna, "total", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "tot");
+ /* needs a function to do the right thing when adding elements like colorband_add_cb() */
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_range(prop, 0, 31); /* MAXCOLORBAND = 32 */
+ RNA_def_property_ui_text(prop, "Total", "Total number of elements");
+ RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
+#endif
+
+ func = RNA_def_function(srna, "evaluate", "rna_ColorRamp_eval");
+ RNA_def_function_ui_description(func, "Evaluate ColorRamp");
+ prop= RNA_def_float(func, "position", 1.0f, 0.0f, 1.0f, "Position", "Evaluate ColorRamp at position", 0.0f, 1.0f);
+ RNA_def_property_flag(prop, PROP_REQUIRED);
+ /* return */
+ prop = RNA_def_float_color(func, "color", 4, NULL, -FLT_MAX, FLT_MAX, "Color", "Color at given position", -FLT_MAX, FLT_MAX);
+ RNA_def_property_flag(prop, PROP_THICK_WRAP);
+ RNA_def_function_output(func, prop);
}
static void rna_def_histogram(BlenderRNA *brna)
{
StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_mode_items[] = {
+ {HISTO_MODE_LUMA, "LUMA", ICON_COLOR, "Luma", ""},
+ {HISTO_MODE_RGB, "RGB", ICON_COLOR, "Red Green Blue", ""},
+ {HISTO_MODE_R, "R", ICON_COLOR, "Red", ""},
+ {HISTO_MODE_G, "G", ICON_COLOR, "Green", ""},
+ {HISTO_MODE_B, "B", ICON_COLOR, "Blue", ""},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "Histogram", NULL);
RNA_def_struct_ui_text(srna, "Histogram", "Statistical view of the levels of color in an image");
+ prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, prop_mode_items);
+ RNA_def_property_ui_text(prop, "Mode", "Channels to display when drawing the histogram");
+
}
+static void rna_def_scopes(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_wavefrm_mode_items[] = {
+ {SCOPES_WAVEFRM_LUMA, "LUMA", ICON_COLOR, "Luma", ""},
+ {SCOPES_WAVEFRM_RGB, "RGB", ICON_COLOR, "Red Green Blue", ""},
+ {SCOPES_WAVEFRM_YCC_601, "YCBCR601", ICON_COLOR, "YCbCr (ITU 601)", ""},
+ {SCOPES_WAVEFRM_YCC_709, "YCBCR709", ICON_COLOR, "YCbCr (ITU 709)", ""},
+ {SCOPES_WAVEFRM_YCC_JPEG, "YCBCRJPG", ICON_COLOR, "YCbCr (Jpeg)", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Scopes", NULL);
+ RNA_def_struct_ui_text(srna, "Scopes", "Scopes for statistical view of an image");
+
+ prop= RNA_def_property(srna, "use_full_resolution", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, "Scopes", "sample_full", 1);
+ RNA_def_property_ui_text(prop, "Full Sample", "Sample every pixel of the image");
+ RNA_def_property_update(prop, 0, "rna_Scopes_update");
+
+ prop= RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_PERCENTAGE);
+ RNA_def_property_float_sdna(prop, "Scopes", "accuracy");
+ RNA_def_property_range(prop, 0.0, 100.0);
+ RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
+ RNA_def_property_ui_text(prop, "Accuracy", "Proportion of original image source pixel lines to sample");
+ RNA_def_property_update(prop, 0, "rna_Scopes_update");
+
+ prop= RNA_def_property(srna, "histogram", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, "Scopes", "hist");
+ RNA_def_property_struct_type(prop, "Histogram");
+ RNA_def_property_ui_text(prop, "Histogram", "Histogram for viewing image statistics");
+
+ prop= RNA_def_property(srna, "waveform_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, "Scopes", "wavefrm_mode");
+ RNA_def_property_enum_items(prop, prop_wavefrm_mode_items);
+ RNA_def_property_ui_text(prop, "Waveform Mode", "");
+ RNA_def_property_update(prop, 0, "rna_Scopes_update");
+
+ prop= RNA_def_property(srna, "waveform_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ RNA_def_property_float_sdna(prop, "Scopes", "wavefrm_alpha");
+ RNA_def_property_range(prop, 0, 1);
+ RNA_def_property_ui_text(prop, "Waveform Opacity", "Opacity of the points");
+
+ prop= RNA_def_property(srna, "vectorscope_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ RNA_def_property_float_sdna(prop, "Scopes", "vecscope_alpha");
+ RNA_def_property_range(prop, 0, 1);
+ RNA_def_property_ui_text(prop, "Vectorscope Opacity", "Opacity of the points");
+}
+
+
void RNA_def_color(BlenderRNA *brna)
{
rna_def_curvemappoint(brna);
@@ -457,6 +603,7 @@ void RNA_def_color(BlenderRNA *brna)
rna_def_color_ramp_element(brna);
rna_def_color_ramp(brna);
rna_def_histogram(brna);
+ rna_def_scopes(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index c61ebf5adfc..a58807902d8 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -64,6 +64,7 @@ EnumPropertyItem constraint_type_items[] ={
{CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT_DATA, "Child Of", ""},
{CONSTRAINT_TYPE_MINMAX, "FLOOR", ICON_CONSTRAINT_DATA, "Floor", ""},
{CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", ICON_CONSTRAINT_DATA, "Follow Path", ""},
+ {CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT_DATA, "Pivot", ""},
{CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", ""},
{CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", ""},
{CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap", ""},
@@ -157,6 +158,8 @@ static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
return &RNA_SplineIKConstraint;
case CONSTRAINT_TYPE_TRANSLIKE:
return &RNA_CopyTransformsConstraint;
+ case CONSTRAINT_TYPE_PIVOT:
+ return &RNA_PivotConstraint;
default:
return &RNA_UnknownType;
}
@@ -211,7 +214,7 @@ static void rna_Constraint_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Constraint_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- ED_object_constraint_dependency_update(scene, ptr->id.data);
+ ED_object_constraint_dependency_update(bmain, scene, ptr->id.data);
}
static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -434,7 +437,7 @@ static void rna_def_constraint_python(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ConstraintTarget");
RNA_def_property_ui_text(prop, "Targets", "Target Objects");
- prop= RNA_def_property(srna, "number_of_targets", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "target_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tarnum");
RNA_def_property_ui_text(prop, "Number of Targets", "Usually only 1-3 are needed");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@@ -449,7 +452,7 @@ static void rna_def_constraint_python(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Targets", "Use the targets indicated in the constraint panel");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "script_error", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "has_script_error", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_SCRIPTERROR);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Script Error", "The linked Python script has thrown an error");
@@ -507,7 +510,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Orientation Weight", "For Tree-IK: Weight of orientation control for this target");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "chain_length", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rootbone");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones");
@@ -518,28 +521,28 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
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_dependency_update");
- prop= RNA_def_property(srna, "axis_reference", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "reference_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, constraint_ik_axisref_items);
RNA_def_property_ui_text(prop, "Axis Reference", "Constraint axis Lock options relative to Bone or Target reference");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "use_position", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_POS);
RNA_def_property_ui_text(prop, "Position", "Chain follows position of target");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "pos_lock_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_X);
RNA_def_property_ui_text(prop, "Lock X Pos", "Constraint position along X axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "pos_lock_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_Y);
RNA_def_property_ui_text(prop, "Lock Y Pos", "Constraint position along Y axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "pos_lock_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_Z);
RNA_def_property_ui_text(prop, "Lock Z Pos", "Constraint position along Z axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
@@ -549,17 +552,17 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "rot_lock_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_X);
RNA_def_property_ui_text(prop, "Lock X Rot", "Constraint rotation along X axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "rot_lock_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_Y);
RNA_def_property_ui_text(prop, "Lock Y Rot", "Constraint rotation along Y axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "rot_lock_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_Z);
RNA_def_property_ui_text(prop, "Lock Z Rot", "Constraint rotation along Z axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
@@ -635,19 +638,19 @@ static void rna_def_constraint_track_to(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "track", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "reserved1");
RNA_def_property_enum_items(prop, track_items);
RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "up", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "reserved2");
RNA_def_property_enum_items(prop, up_items);
RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "target_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_target_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TARGET_Z_UP);
RNA_def_property_ui_text(prop, "Target Z", "Target's Z axis, not World Z axis, will constraint the Up direction");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -829,7 +832,7 @@ static void rna_def_constraint_same_volume(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Maintain Volume Constraint", "Maintains a constant volume along a single scaling axis");
RNA_def_struct_sdna_from(srna, "bSameVolumeConstraint", "data");
- prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "free_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, volume_items);
RNA_def_property_ui_text(prop, "Free Axis", "The free scaling axis of the object");
@@ -903,7 +906,7 @@ static void rna_def_constraint_minmax(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Floor Location", "Location of target that object will not pass through");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_sticky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MINMAX_STICKY);
RNA_def_property_ui_text(prop, "Sticky", "Immobilize object while constrained");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -975,14 +978,14 @@ static void rna_def_constraint_action(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "End Frame", "Last frame of the Action to use");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
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);
+ prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_range(prop, -1000.f, 1000.f);
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range");
@@ -1025,13 +1028,13 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "track", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, locktrack_items);
RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "locked", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "lockflag");
RNA_def_property_enum_items(prop, lock_items);
RNA_def_property_ui_text(prop, "Locked Axis", "Axis that points upward");
@@ -1064,6 +1067,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@@ -1079,13 +1083,13 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "forward_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, forwardpath_items);
RNA_def_property_ui_text(prop, "Forward Axis", "Axis that points forward along the path");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "up", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "upflag");
RNA_def_property_enum_items(prop, pathup_items);
RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward");
@@ -1096,7 +1100,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Follow Curve", "Object will follow the heading and banking of the curve");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_fixed_position", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_fixed_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_STATIC);
RNA_def_property_ui_text(prop, "Fixed Position", "Object will stay locked to a single point somewhere along the length of the curve regardless of time");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1157,7 +1161,7 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Keep Axis", "Axis to maintain during stretch");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "original_length", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "orglength");
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Original Length", "Length at rest position");
@@ -1242,12 +1246,12 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
//float minLimit[6];
//float maxLimit[6];
- prop= RNA_def_property(srna, "disable_linked_collision", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_linked_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE_LINKED_COLLISION);
RNA_def_property_ui_text(prop, "Disable Linked Collision", "Disable collision between linked bodies");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "draw_pivot", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_pivot", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DRAW_PIVOT);
RNA_def_property_ui_text(prop, "Draw Pivot", "Display the pivot point and rotation in 3D view");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1270,7 +1274,8 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna)
RNA_def_struct_sdna_from(srna, "bClampToConstraint", "data");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "tar"); // TODO: curve only!
+ RNA_def_property_pointer_sdna(prop, NULL, "tar"); // TODO: curve only for set function!
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@@ -1281,7 +1286,7 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Main Axis", "Main axis of movement");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", CLAMPTO_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1349,7 +1354,7 @@ static void rna_def_constraint_transform(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Map To Z From", "The source axis constrained object's Z axis uses");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "extrapolate_motion", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_motion_extrapolate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "expo", CLAMPTO_CYCLIC);
RNA_def_property_ui_text(prop, "Extrapolate Motion", "Extrapolate ranges");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1436,73 +1441,73 @@ static void rna_def_constraint_location_limit(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Limit Location Constraint", "Limits the location of the constrained object");
RNA_def_struct_sdna_from(srna, "bLocLimitConstraint", "data");
- prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_minimum_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN);
RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_maximum_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX);
RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "limit_transform", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1532,43 +1537,43 @@ static void rna_def_constraint_rotation_limit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Limit Z", "Use the minimum Z value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_ANGLE);
+ prop= RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_ANGLE);
+ prop= RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_ANGLE);
+ prop= RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_ANGLE);
+ prop= RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_ANGLE);
+ prop= RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_ANGLE);
+ prop= RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "limit_transform", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1583,73 +1588,73 @@ static void rna_def_constraint_size_limit(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Limit Size Constraint", "Limits the scaling of the constrained object");
RNA_def_struct_sdna_from(srna, "bSizeLimitConstraint", "data");
- prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_minimum_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN);
RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_maximum_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX);
RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "limit_transform", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1704,7 +1709,8 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "target");
+ RNA_def_property_pointer_sdna(prop, NULL, "target"); /* TODO, mesh type */
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@@ -1766,7 +1772,7 @@ static void rna_def_constraint_damped_track(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "track", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, damptrack_items);
RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
@@ -1795,7 +1801,7 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "chain_length", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "chainlen");
RNA_def_property_range(prop, 1, 255); // TODO: this should really check the max length of the chain the constraint is attached to
RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the chain");
@@ -1812,17 +1818,17 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
/* settings */
- prop= RNA_def_property(srna, "chain_offset", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_chain_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_NO_ROOT);
RNA_def_property_ui_text(prop, "Chain Offset", "Offset the entire chain relative to the root joint");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "even_divisions", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_even_divisions", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_EVENSPLITS);
RNA_def_property_ui_text(prop, "Even Divisions", "Ignore the relative lengths of the bones when fitting to the curve");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "y_stretch", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_y_stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_SCALE_LIMITED);
RNA_def_property_ui_text(prop, "Y Stretch", "Stretch the Y axis of the bones to fit the curve");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1832,13 +1838,69 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Curve Radius", "Average radius of the endpoints is used to tweak the X and Z Scaling of the bones, on top of XZ Scale mode");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "xz_scaling_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "xz_scale_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "xzScaleMode");
RNA_def_property_enum_items(prop, splineik_xz_scale_mode);
RNA_def_property_ui_text(prop, "XZ Scale Mode", "Method used for determining the scaling of the X and Z axes of the bones");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
+static void rna_def_constraint_pivot(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem pivot_rotAxis_items[] = {
+ {PIVOTCON_AXIS_NONE, "ALWAYS_ACTIVE", 0, "Always", ""},
+ {PIVOTCON_AXIS_X_NEG, "NX", 0, "-X Rot", ""},
+ {PIVOTCON_AXIS_Y_NEG, "NY", 0, "-Y Rot", ""},
+ {PIVOTCON_AXIS_Z_NEG, "NZ", 0, "-Z Rot", ""},
+ {PIVOTCON_AXIS_X, "X", 0, "X Rot", ""},
+ {PIVOTCON_AXIS_Y, "Y", 0, "Y Rot", ""},
+ {PIVOTCON_AXIS_Z, "Z", 0, "Z Rot", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "PivotConstraint", "Constraint");
+ RNA_def_struct_ui_text(srna, "Pivot Constraint", "Rotate around a different point");
+
+ 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");
+
+ RNA_def_struct_sdna_from(srna, "bPivotConstraint", "data");
+
+ /* target-defined pivot */
+ prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "tar");
+ RNA_def_property_ui_text(prop, "Target", "Target Object, defining the position of the pivot when defined");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "subtarget");
+ RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ /* pivot offset */
+ prop= RNA_def_property(srna, "use_relative_location", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PIVOTCON_FLAG_OFFSET_ABS);
+ RNA_def_property_ui_text(prop, "Use Relative Offset", "Offset will be an absolute point in space instead of relative to the target");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+
+ prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "offset");
+ RNA_def_property_ui_text(prop, "Offset", "Offset of pivot from target (when set), or from owner's location (when Fixed Position is off), or the absolute pivot point");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+
+ /* rotation-based activation */
+ prop= RNA_def_property(srna, "rotation_range", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "rotAxis");
+ RNA_def_property_enum_items(prop, pivot_rotAxis_items);
+ RNA_def_property_ui_text(prop, "Enabled Rotation Range", "Rotation range on which pivoting should occur");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+}
+
/* base struct for constraints */
void RNA_def_constraint(BlenderRNA *brna)
{
@@ -1855,7 +1917,7 @@ void RNA_def_constraint(BlenderRNA *brna)
/* strings */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constraint_name_set");
- RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_property_ui_text(prop, "Name", "Constraint name");
RNA_def_struct_name_property(srna, prop);
/* enums */
@@ -1878,15 +1940,19 @@ void RNA_def_constraint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in");
/* flags */
- prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_OFF);
+ RNA_def_property_ui_text(prop, "Enabled", "Enable/Disable Constraint");
+
+ prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND);
RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
-
+
// XXX this is really an internal flag, but it may be useful for some tools to be able to access this...
- prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE);
RNA_def_property_ui_text(prop, "Disabled", "Constraint has invalid settings and will not be evaluated");
// TODO: setting this to true must ensure that all others in stack are turned off too...
@@ -1894,7 +1960,7 @@ void RNA_def_constraint(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "Constraint is the one being edited ");
- prop= RNA_def_property(srna, "proxy_local", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_proxy_local", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_PROXY_LOCAL);
RNA_def_property_ui_text(prop, "Proxy Local", "Constraint was added in this proxy instance (i.e. did not belong to source Armature)");
@@ -1906,12 +1972,12 @@ void RNA_def_constraint(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "error_location", 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);
+ prop= RNA_def_property(srna, "error_rotation", 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");
@@ -1943,6 +2009,7 @@ void RNA_def_constraint(BlenderRNA *brna)
rna_def_constraint_shrinkwrap(brna);
rna_def_constraint_damped_track(brna);
rna_def_constraint_spline_ik(brna);
+ rna_def_constraint_pivot(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c
index 9ee2ca1a322..6cc93d088ad 100644
--- a/source/blender/makesrna/intern/rna_context.c
+++ b/source/blender/makesrna/intern/rna_context.c
@@ -76,13 +76,19 @@ static PointerRNA rna_Context_region_get(PointerRNA *ptr)
return newptr;
}
-/*static PointerRNA rna_Context_region_data_get(PointerRNA *ptr)
+static PointerRNA rna_Context_region_data_get(PointerRNA *ptr)
{
bContext *C= (bContext*)ptr->data;
- PointerRNA newptr;
- RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionData, CTX_wm_region_data(C), &newptr);
- return newptr;
-}*/
+
+ /* only exists for one space still, no generic system yet */
+ if(CTX_wm_view3d(C)) {
+ PointerRNA newptr;
+ RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionView3D, CTX_wm_region_data(C), &newptr);
+ return newptr;
+ }
+
+ return PointerRNA_NULL;
+}
static PointerRNA rna_Context_main_get(PointerRNA *ptr)
{
@@ -148,58 +154,58 @@ void RNA_def_context(BlenderRNA *brna)
prop= RNA_def_property(srna, "manager", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "WindowManager");
- RNA_def_property_pointer_funcs(prop, "rna_Context_manager_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Context_manager_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "window", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Window");
- RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Screen");
- RNA_def_property_pointer_funcs(prop, "rna_Context_screen_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Context_screen_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "area", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Area");
- RNA_def_property_pointer_funcs(prop, "rna_Context_area_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Context_area_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "space_data", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Space");
- RNA_def_property_pointer_funcs(prop, "rna_Context_space_data_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Context_space_data_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "region", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Region");
- RNA_def_property_pointer_funcs(prop, "rna_Context_region_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Context_region_get", NULL, NULL, NULL);
- /*prop= RNA_def_property(srna, "region_data", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "region_data", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_struct_type(prop, "RegionData");
- RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL);*/
+ RNA_def_property_struct_type(prop, "RegionView3D");
+ RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL, NULL);
/* Data */
prop= RNA_def_property(srna, "main", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Main");
- RNA_def_property_pointer_funcs(prop, "rna_Context_main_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Context_main_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Scene");
- RNA_def_property_pointer_funcs(prop, "rna_Context_scene_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Context_scene_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "ToolSettings");
- RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "UserPreferences");
- RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, mode_items);
diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c
index 67c7bd0f2d8..ee0707ad0ae 100644
--- a/source/blender/makesrna/intern/rna_controller.c
+++ b/source/blender/makesrna/intern/rna_controller.c
@@ -24,14 +24,28 @@
#include <stdlib.h>
+#include "WM_types.h"
#include "RNA_define.h"
#include "rna_internal.h"
-
+#include "DNA_object_types.h"
#include "DNA_controller_types.h"
+EnumPropertyItem controller_type_items[] ={
+ {CONT_LOGIC_AND, "LOGIC_AND", 0, "And", "Logic And"},
+ {CONT_LOGIC_OR, "LOGIC_OR", 0, "Or", "Logic Or"},
+ {CONT_LOGIC_NAND, "LOGIC_NAND", 0, "Nand", "Logic Nand"},
+ {CONT_LOGIC_NOR, "LOGIC_NOR", 0, "Nor", "Logic Nor"},
+ {CONT_LOGIC_XOR, "LOGIC_XOR", 0, "Xor", "Logic Xor"},
+ {CONT_LOGIC_XNOR, "LOGIC_XNOR", 0, "Xnor", "Logic Xnor"},
+ {CONT_EXPRESSION, "EXPRESSION", 0, "Expression", ""},
+ {CONT_PYTHON, "PYTHON", 0, "Python Script", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
+#include "BKE_sca.h"
+
static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
{
bController *controller= (bController*)ptr->data;
@@ -58,21 +72,82 @@ static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
}
}
+static void rna_Controller_type_set(struct PointerRNA *ptr, int value)
+{
+ bController *cont= (bController *)ptr->data;
+ if (value != cont->type)
+ {
+ cont->type = value;
+ init_controller(cont);
+ }
+}
+
+static int rna_Controller_state_number_get(struct PointerRNA *ptr)
+{
+ bController *cont= (bController *)ptr->data;
+ int bit;
+
+ for (bit=0; bit<32; bit++) {
+ if (cont->state_mask & (1<<bit))
+ return bit+1;
+ }
+ return 0;
+}
+
+static void rna_Controller_state_number_set(struct PointerRNA *ptr, const int value)
+{
+ bController *cont= (bController *)ptr->data;
+ if (value < 1 || value > OB_MAX_STATES)
+ return;
+
+ cont->state_mask = (1 << (value - 1));
+}
+
+#if 0 /* editable is set to false, comment for now. */
+static void rna_Controller_state_get(PointerRNA *ptr, int *values)
+{
+ bController *cont= (bController *)ptr->data;
+ int i;
+
+ memset(values, 0, sizeof(int)*OB_MAX_STATES);
+ for(i=0; i<OB_MAX_STATES; i++)
+ values[i] = (cont->state_mask & (1<<i));
+}
+
+static void rna_Controller_state_set(PointerRNA *ptr, const int *values)
+{
+ bController *cont= (bController *)ptr->data;
+ int i, tot= 0;
+
+ /* ensure we always have some state selected */
+ for(i=0; i<OB_MAX_STATES; i++)
+ if(values[i])
+ tot++;
+
+ if(tot==0)
+ return;
+
+ /* only works for one state at once */
+ if(tot>1)
+ return;
+
+ for(i=0; i<OB_MAX_STATES; i++) {
+ if(values[i]) cont->state_mask |= (1<<i);
+ else cont->state_mask &= ~(1<<i);
+ }
+}
+#endif
+
#else
void RNA_def_controller(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem controller_type_items[] ={
- {CONT_LOGIC_AND, "LOGIC_AND", 0, "Logic And", ""},
- {CONT_LOGIC_OR, "LOGIC_OR", 0, "Logic Or", ""},
- {CONT_LOGIC_NAND, "LOGIC_NAND", 0, "Logic Nand", ""},
- {CONT_LOGIC_NOR, "LOGIC_NOR", 0, "Logic Nor", ""},
- {CONT_LOGIC_XOR, "LOGIC_XOR", 0, "Logic Xor", ""},
- {CONT_LOGIC_XNOR, "LOGIC_XNOR", 0, "Logic Xnor", ""},
- {CONT_EXPRESSION, "EXPRESSION", 0, "Expression", ""},
- {CONT_PYTHON, "PYTHON", 0, "Python Script", ""},
+
+ static EnumPropertyItem python_controller_modes[] ={
+ {CONT_PY_SCRIPT, "SCRIPT", 0, "Script", ""},
+ {CONT_PY_MODULE, "MODULE", 0, "Module", ""},
{0, NULL, 0, NULL, NULL}};
/* Controller */
@@ -81,15 +156,49 @@ void RNA_def_controller(BlenderRNA *brna)
RNA_def_struct_refine_func(srna, "rna_Controller_refine");
RNA_def_struct_ui_text(srna, "Controller", "Game engine logic brick to process events, connecting sensors to actuators");
+ RNA_api_controller(srna);
+
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- /* type is not editable, would need to do proper data free/alloc */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_type_set", NULL);
RNA_def_property_enum_items(prop, controller_type_items);
RNA_def_property_ui_text(prop, "Type", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_SHOW);
+ RNA_def_property_ui_text(prop, "Expanded", "Set controller expanded in the user interface");
+ RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "use_priority", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PRIO);
+ RNA_def_property_ui_text(prop, "Priority", "Mark controller for execution before all non-marked controllers (good for startup scripts)");
+ RNA_def_property_ui_icon(prop, ICON_BOOKMARKS, 1);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ /* State */
+
+ // array of OB_MAX_STATES
+ //prop= RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ //RNA_def_property_array(prop, OB_MAX_STATES);
+ //RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ //RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)");
+ //RNA_def_property_boolean_funcs(prop, "rna_Controller_state_get", "rna_Controller_state_set");
+ //RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ // number of the state
+ prop= RNA_def_property(srna, "states", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "state_mask");
+ RNA_def_property_range(prop, 1, OB_MAX_STATES);
+ RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)");
+ RNA_def_property_int_funcs(prop, "rna_Controller_state_number_get", "rna_Controller_state_number_set", NULL);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Expression Controller */
srna= RNA_def_struct(brna, "ExpressionController", "Controller");
@@ -100,24 +209,32 @@ void RNA_def_controller(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "str");
RNA_def_property_string_maxlength(prop, 127);
RNA_def_property_ui_text(prop, "Expression", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Python Controller */
srna= RNA_def_struct(brna, "PythonController", "Controller" );
RNA_def_struct_sdna_from(srna, "bPythonCont", "data");
RNA_def_struct_ui_text(srna, "Python Controller", "Controller executing a python script");
+ prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, python_controller_modes);
+ RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Text");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text", "Text datablock with the python script");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Module", "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used");
- RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "debug", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_debug", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PY_DEBUG);
RNA_def_property_ui_text(prop, "D", "Continuously reload the module from disk for editing external modules without restarting");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Other Controllers */
srna= RNA_def_struct(brna, "AndController", "Controller");
diff --git a/source/blender/makesrna/intern/rna_controller_api.c b/source/blender/makesrna/intern/rna_controller_api.c
new file mode 100644
index 00000000000..dab2ce8c3a1
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_controller_api.c
@@ -0,0 +1,81 @@
+/**
+ * $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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2010 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s):
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "WM_types.h"
+#include "RNA_define.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_sca.h"
+#include "DNA_sensor_types.h"
+#include "DNA_controller_types.h"
+#include "DNA_actuator_types.h"
+
+static void rna_Controller_link(bController *cont, bSensor *sens, bActuator *act)
+{
+ if(sens)
+ link_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks, sizeof(bController *));
+ if(act)
+ link_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks, sizeof(bActuator *));
+}
+
+static void rna_Controller_unlink(bController *cont, bSensor *sens, bActuator *act)
+{
+ if(sens)
+ unlink_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks);
+ if(act)
+ unlink_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks);
+}
+
+#else
+
+void RNA_api_controller(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "link", "rna_Controller_link");
+ RNA_def_function_ui_description(func, "Link the controller with a sensor/actuator.");
+ parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to link the controller to.");
+ RNA_def_property_update(parm, NC_LOGIC, NULL);
+ parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to link the controller to.");
+ RNA_def_property_update(parm, NC_LOGIC, NULL);
+
+ func= RNA_def_function(srna, "unlink", "rna_Controller_unlink");
+ RNA_def_function_ui_description(func, "Unlink the controller from a sensor/actuator.");
+ parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to unlink the controller from.");
+ RNA_def_property_update(parm, NC_LOGIC, NULL);
+ parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to unlink the controller from.");
+ RNA_def_property_update(parm, NC_LOGIC, NULL);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index c0ad35eb7c3..f5eace91831 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -29,6 +29,7 @@
#include "rna_internal.h"
#include "DNA_curve_types.h"
+#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_scene_types.h"
@@ -36,6 +37,9 @@
#include "WM_types.h"
+#include "BKE_curve.h"
+#include "ED_curve.h"
+
EnumPropertyItem beztriple_handle_type_items[] = {
{HD_FREE, "FREE", 0, "Free", ""},
{HD_AUTO, "AUTO", 0, "Auto", ""},
@@ -59,6 +63,8 @@ EnumPropertyItem curve_type_items[] = {
#ifdef RNA_RUNTIME
+#include "BLI_math.h"
+
#include "DNA_object_types.h"
#include "BKE_curve.h"
@@ -69,6 +75,8 @@ EnumPropertyItem curve_type_items[] = {
#include "MEM_guardedalloc.h"
+#include "ED_curve.h" /* for BKE_curve_nurbs */
+
static StructRNA *rna_Curve_refine(PointerRNA *ptr)
{
Curve *cu= (Curve*)ptr->data;
@@ -139,6 +147,40 @@ static int rna_Curve_texspace_editable(PointerRNA *ptr)
return (cu->texflag & CU_AUTOSPACE)? 0: PROP_EDITABLE;
}
+static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values)
+{
+ Curve *cu= (Curve *)ptr->data;
+
+ if (!cu->bb)
+ tex_space_curve(cu);
+
+ copy_v3_v3(values, cu->loc);
+}
+
+static void rna_Curve_texspace_loc_set(PointerRNA *ptr, const float *values)
+{
+ Curve *cu= (Curve *)ptr->data;
+
+ copy_v3_v3(cu->loc, values);
+}
+
+static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values)
+{
+ Curve *cu= (Curve *)ptr->data;
+
+ if (!cu->bb)
+ tex_space_curve(cu);
+
+ copy_v3_v3(values, cu->size);
+}
+
+static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values)
+{
+ Curve *cu= (Curve *)ptr->data;
+
+ copy_v3_v3(cu->size, values);
+}
+
static void rna_Curve_material_index_range(PointerRNA *ptr, int *min, int *max)
{
Curve *cu= (Curve*)ptr->id.data;
@@ -157,7 +199,8 @@ static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int
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;
+ ListBase *nurbs= BKE_curve_nurbs(cu);
+ Nurb *nu= nurbs->first;
if(value==CU_3D) {
cu->flag |= CU_3D;
@@ -179,10 +222,10 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
}
-
static int rna_Nurb_length(PointerRNA *ptr)
{
Nurb *nu= (Nurb*)ptr->data;
+ if(nu->type == CU_BEZIER) return 0;
return nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu;
}
@@ -212,7 +255,7 @@ static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
rna_Curve_update_data(bmain, scene, ptr);
}
@@ -243,6 +286,20 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value)
}
}
+static int rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
+{
+ Curve *cu= (Curve*)ptr->id.data;
+ Object *ob= (Object*)value.data;
+
+ if (ob) {
+ if (ob->type == OB_CURVE && ob->data != cu) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
{
Curve *cu= (Curve*)ptr->id.data;
@@ -273,11 +330,9 @@ static void rna_Curve_taperObject_set(PointerRNA *ptr, PointerRNA value)
static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Curve *cu= (Curve*)ptr->id.data;
- Nurb *nu=NULL;
-
- if (cu->editnurb) nu= cu->editnurb->first;
- else nu=cu->nurb.first;
-
+ ListBase *nurbs= BKE_curve_nurbs(cu);
+ Nurb *nu= nurbs->first;
+
while(nu) {
nu->resolu= cu->resolu;
nu= nu->next;
@@ -289,16 +344,15 @@ static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, Pointe
static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Curve *cu= (Curve*)ptr->id.data;
- Nurb *nu=NULL;
-
- if (cu->editnurb) nu= cu->editnurb->first;
- else nu=cu->nurb.first;
-
+ ListBase *nurbs= BKE_curve_nurbs(cu);
+ Nurb *nu=nurbs->first;
+
+
while(nu) {
nu->resolv= cu->resolv;
nu= nu->next;
}
-
+
rna_Curve_update_data(bmain, scene, ptr);
}
@@ -306,13 +360,13 @@ static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, Pointe
void rna_Curve_body_get(PointerRNA *ptr, char *value)
{
Curve *cu= (Curve*)ptr->id.data;
- strcpy(value, cu->str);
+ BLI_strncpy(value, cu->str, cu->len+1);
}
int rna_Curve_body_length(PointerRNA *ptr)
{
Curve *cu= (Curve*)ptr->id.data;
- return strlen(cu->str);
+ return cu->len;
}
/* TODO - check UTF & python play nice */
@@ -321,8 +375,7 @@ void rna_Curve_body_set(PointerRNA *ptr, const char *value)
int len= strlen(value);
Curve *cu= (Curve*)ptr->id.data;
- cu->pos = len;
- cu->len = len;
+ cu->len= cu->pos = len;
if(cu->str) MEM_freeN(cu->str);
if(cu->strinfo) MEM_freeN(cu->strinfo);
@@ -364,7 +417,7 @@ static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr)
rna_Curve_update_data(bmain, scene, ptr);
}
-static void rna_Curve_spline_points_add(ID *id, Nurb *nu, bContext *C, ReportList *reports, int number)
+static void rna_Curve_spline_points_add(ID *id, Nurb *nu, ReportList *reports, int number)
{
if(nu->type == CU_BEZIER) {
BKE_report(reports, RPT_ERROR, "Bezier spline can't have points added");
@@ -378,11 +431,11 @@ static void rna_Curve_spline_points_add(ID *id, Nurb *nu, bContext *C, ReportLis
/* update */
makeknots(nu, 1);
- rna_Curve_update_data_id(CTX_data_main(C), CTX_data_scene(C), id);
+ rna_Curve_update_data_id(NULL, NULL, id);
}
}
-static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, bContext *C, ReportList *reports, int number)
+static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, ReportList *reports, int number)
{
if(nu->type != CU_BEZIER) {
BKE_report(reports, RPT_ERROR, "Only bezier splines can be added");
@@ -395,7 +448,7 @@ static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, bContext *C, Report
/* update */
makeknots(nu, 1);
- rna_Curve_update_data_id(CTX_data_main(C), CTX_data_scene(C), id);
+ rna_Curve_update_data_id(NULL, NULL, id);
}
}
@@ -429,14 +482,10 @@ static Nurb *rna_Curve_spline_new(Curve *cu, int type)
static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, Nurb *nu)
{
- /* todo, check we're in the list */
int found= 0;
- if(cu->editnurb) {
- found= BLI_remlink_safe(cu->editnurb, nu);
- }
- else {
- found= BLI_remlink_safe(&cu->nurb, nu);
- }
+ ListBase *nurbs= BKE_curve_nurbs(cu);
+
+ found= BLI_remlink_safe(nurbs, nu);
if(!found) {
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" does not contain spline given", cu->id.name+2);
@@ -451,11 +500,10 @@ static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
{
Curve *cu= (Curve*)ptr->data;
Nurb *nu;
+ ListBase *nurbs= BKE_curve_nurbs(cu);
- if(cu->editnurb)
- nu= BLI_findlink(cu->editnurb, cu->actnu);
- else
- nu= BLI_findlink(&cu->nurb, cu->actnu); // currently set to -1, should be changed to be allowed outside of editmode.
+ // for curve outside editmode will set to -1, should be changed to be allowed outside of editmode.
+ nu= BLI_findlink(nurbs, cu->actnu);
if(nu)
return rna_pointer_inherit_refine(ptr, &RNA_Spline, nu);
@@ -467,14 +515,25 @@ static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value)
{
Curve *cu= (Curve*)ptr->data;
Nurb *nu= value.data;
+ ListBase *nubase= BKE_curve_nurbs(cu);
/* -1 is ok for an unset index */
if(nu==NULL)
cu->actnu= -1;
- else if(cu->editnurb)
- cu->actnu= BLI_findindex(cu->editnurb, nu);
else
- cu->actnu= BLI_findindex(&cu->nurb, nu);
+ cu->actnu= BLI_findindex(nubase, nu);
+}
+
+static char *rna_TextBox_path(PointerRNA *ptr)
+{
+ Curve *cu= (Curve*)ptr->id.data;
+ TextBox *tb= ptr->data;
+ int index= (int)(tb - cu->tb);
+
+ if (index >= 0 && index < cu->totbox)
+ return BLI_sprintfN("textboxes[%d]", index);
+ else
+ return BLI_strdup("");
}
#else
@@ -489,14 +548,14 @@ static void rna_def_bpoint(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "SplinePoint", "Spline point without handles");
/* Boolean values */
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
- RNA_def_property_ui_text(prop, "Selected", "Selection status");
+ RNA_def_property_ui_text(prop, "Select", "Selection status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
- RNA_def_property_ui_text(prop, "Hidden", "Visibility status");
+ RNA_def_property_ui_text(prop, "Hide", "Visibility status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Vector value */
@@ -542,41 +601,41 @@ static void rna_def_beztriple(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Bezier Curve Point", "Bezier curve point with two handles");
/* Boolean values */
- prop= RNA_def_property(srna, "selected_handle1", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
RNA_def_property_ui_text(prop, "Handle 1 selected", "Handle 1 selection status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "selected_handle2", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f3", 0);
RNA_def_property_ui_text(prop, "Handle 2 selected", "Handle 2 selection status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "selected_control_point", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f2", 0);
RNA_def_property_ui_text(prop, "Control Point selected", "Control point selection status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
- RNA_def_property_ui_text(prop, "Hidden", "Visibility status");
+ RNA_def_property_ui_text(prop, "Hide", "Visibility status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Enums */
- prop= RNA_def_property(srna, "handle1_type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h1");
RNA_def_property_enum_items(prop, beztriple_handle_type_items);
RNA_def_property_ui_text(prop, "Handle 1 Type", "Handle types");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "handle2_type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h2");
RNA_def_property_enum_items(prop, beztriple_handle_type_items);
RNA_def_property_ui_text(prop, "Handle 2 Type", "Handle types");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Vector values */
- prop= RNA_def_property(srna, "handle1", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_BezTriple_handle1_get", "rna_BezTriple_handle1_set", NULL);
RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
@@ -588,7 +647,7 @@ static void rna_def_beztriple(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "handle2", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_BezTriple_handle2_get", "rna_BezTriple_handle2_set", NULL);
RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle");
@@ -619,7 +678,7 @@ static void rna_def_path(BlenderRNA *brna, StructRNA *srna)
PropertyRNA *prop;
/* number values */
- prop= RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "path_duration", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pathlen");
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_ui_text(prop, "Path Length", "The number of frames that are needed to traverse the path, defining the maximum value for the 'Evaluation Time' setting");
@@ -640,7 +699,12 @@ static void rna_def_path(BlenderRNA *brna, StructRNA *srna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STRETCH);
RNA_def_property_ui_text(prop, "Stretch", "Option for curve-deform: makes deformed child to stretch along entire path");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
-
+
+ prop= RNA_def_property(srna, "use_deform_bounds", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CU_DEFORM_BOUNDS_OFF);
+ RNA_def_property_ui_text(prop, "Bounds Clamp", "Use the mesh bounds to clamp the deformation");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
prop= RNA_def_property(srna, "use_time_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_OFFS_PATHDIST);
RNA_def_property_ui_text(prop, "Offset Path Distance", "Children will use TimeOffs value as path distance offset");
@@ -657,14 +721,9 @@ static void rna_def_nurbs(BlenderRNA *brna, StructRNA *srna)
PropertyRNA *prop;
/* flags */
- prop= RNA_def_property(srna, "uv_orco", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_map_on_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
- RNA_def_property_ui_text(prop, "UV Orco", "Forces to use UV coordinates for texture mapping 'orco'");
- RNA_def_property_update(prop, 0, "rna_Curve_update_data");
-
- prop= RNA_def_property(srna, "vertex_normal_flip", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CU_NOPUNOFLIP);
- RNA_def_property_ui_text(prop, "Vertex Normal Flip", "Flip vertex normals towards the camera during render");
+ RNA_def_property_ui_text(prop, "Map Along Length", "Generate texture mapping coordinates following the curve direction, rather than the local bounding box");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
@@ -681,32 +740,39 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
{0, NULL, 0, NULL, NULL}};
/* Enums */
- prop= RNA_def_property(srna, "spacemode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "spacemode");
RNA_def_property_enum_items(prop, prop_align_items);
RNA_def_property_ui_text(prop, "Text Align", "Text align from the object center");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* number values */
- prop= RNA_def_property(srna, "text_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fsize");
RNA_def_property_range(prop, 0.0001f, 10000.0f);
- RNA_def_property_ui_range(prop, 0.01, 10, 1, 1);
+ RNA_def_property_ui_range(prop, 0.01, 10, 1, 3);
RNA_def_property_ui_text(prop, "Font size", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "line_dist", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "small_caps_scale", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "smallcaps_scale");
+ RNA_def_property_ui_range(prop, 0, 1.0, 1, 2);
+ RNA_def_property_ui_text(prop, "Small Caps", "Scale of small capitals");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
+ prop= RNA_def_property(srna, "space_line", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "linedist");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Distance between lines of text", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "word_spacing", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "space_word", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "wordspace");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Spacing between words", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "space_character", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spacing");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Global spacing between characters", "");
@@ -730,19 +796,19 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object origin");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "ul_position", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "underline_position", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ulpos");
RNA_def_property_range(prop, -0.2f, 0.8f);
RNA_def_property_ui_text(prop, "Underline Position", "Vertical position of underline");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "ul_height", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "underline_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ulheight");
RNA_def_property_range(prop, -0.2f, 0.8f);
RNA_def_property_ui_text(prop, "Underline Thickness", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "textboxes", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "text_boxes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "tb", "totbox");
RNA_def_property_struct_type(prop, "TextBox");
RNA_def_property_ui_text(prop, "Textboxes", "");
@@ -760,15 +826,20 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "str");
- RNA_def_property_ui_text(prop, "Body Text", "contence of this text object");
+ RNA_def_property_ui_text(prop, "Body Text", "contents of this text object");
RNA_def_property_string_funcs(prop, "rna_Curve_body_get", "rna_Curve_body_length", "rna_Curve_body_set");
RNA_def_property_string_maxlength(prop, 8192); /* note that originally str did not have a limit! */
- RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
+ prop= RNA_def_property(srna, "body_format", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "strinfo", "len");
+ RNA_def_property_struct_type(prop, "TextCharacterFormat");
+ RNA_def_property_ui_text(prop, "Character Info", "Stores the style of each character");
/* pointers */
- prop= RNA_def_property(srna, "text_on_curve", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "follow_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "textoncurve");
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_otherObject_poll");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text on Curve", "Curve deforming text object");
RNA_def_property_update(prop, 0, "rna_Curve_update_deps");
@@ -785,7 +856,7 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* flags */
- prop= RNA_def_property(srna, "fast", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_fast_edit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FAST);
RNA_def_property_ui_text(prop, "Fast", "Don't fill polygons while editing");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
@@ -823,6 +894,8 @@ static void rna_def_textbox(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox Height", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
+ RNA_def_struct_path_func(srna, "rna_TextBox_path");
}
static void rna_def_charinfo(BlenderRNA *brna)
@@ -835,29 +908,30 @@ static void rna_def_charinfo(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Text Character Format", "Text character formatting settings");
/* flags */
- prop= RNA_def_property(srna, "style", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STYLE);
- RNA_def_property_ui_text(prop, "Style", "");
- RNA_def_property_update(prop, 0, "rna_Curve_update_data");
-
- prop= RNA_def_property(srna, "bold", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BOLD);
+ prop= RNA_def_property(srna, "use_bold", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_BOLD);
RNA_def_property_ui_text(prop, "Bold", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "italic", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_ITALIC);
+ prop= RNA_def_property(srna, "use_italic", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_ITALIC);
RNA_def_property_ui_text(prop, "Italic", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "underline", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UNDERLINE);
+ prop= RNA_def_property(srna, "use_underline", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_UNDERLINE);
RNA_def_property_ui_text(prop, "Underline", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_WRAP);
+ /* probably there is no reason to expose this */
+ /* prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_WRAP);
RNA_def_property_ui_text(prop, "Wrap", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data"); */
+
+ prop= RNA_def_property(srna, "use_small_caps", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_SMALLCAPS);
+ RNA_def_property_ui_text(prop, "Small Caps", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
@@ -903,7 +977,7 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "add", "rna_Curve_spline_points_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline.");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
+ RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
parm= RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
/*
@@ -911,7 +985,7 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a spline from a curve.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
}
@@ -930,7 +1004,7 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline.");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
+ RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
parm= RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
/*
@@ -938,7 +1012,7 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a spline from a curve.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
}
@@ -967,11 +1041,11 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a spline from a curve.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
- RNA_def_property_pointer_funcs(prop, "rna_Curve_active_spline_get", "rna_Curve_active_spline_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Curve_active_spline_get", "rna_Curve_active_spline_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Spline", "Active curve spline");
/* Could call: ED_base_object_activate(C, scene->basact);
@@ -1002,7 +1076,6 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_struct_refine_func(srna, "rna_Curve_refine");
rna_def_animdata_common(srna);
- rna_def_texmat_common(srna, "rna_Curve_texspace_editable");
prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "key");
@@ -1014,12 +1087,12 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Splines", "Collection of splines in this curve data object");
rna_def_curve_splines(brna, prop);
- prop= RNA_def_property(srna, "draw_handles", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_HANDLES);
RNA_def_property_ui_text(prop, "Draw Handles", "Display bezier handles in editmode");
RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
- prop= RNA_def_property(srna, "draw_normals", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_NORMALS);
RNA_def_property_ui_text(prop, "Draw Normals", "Display 3D curve normals in editmode");
RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
@@ -1034,22 +1107,22 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Bevel Resolution", "Bevel resolution when depth is non-zero and no specific bevel object has been defined");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "width");
- RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 0);
+ RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Width", "Scale the original width (1.0) based on given factor");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ext1");
- RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 0);
+ RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_text(prop, "Extrude", "Amount of curve extrusion when not using a bevel object");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ext2");
- RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 0);
+ RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Bevel Depth", "Bevel depth when not using a bevel object");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
@@ -1092,7 +1165,7 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bevel Object", "Curve object name that defines the bevel shape");
RNA_def_property_update(prop, 0, "rna_Curve_update_deps");
- RNA_def_property_pointer_funcs(prop, "rna_Curve_bevelObject_get", "rna_Curve_bevelObject_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Curve_bevelObject_get", "rna_Curve_bevelObject_set", NULL, "rna_Curve_otherObject_poll");
prop= RNA_def_property(srna, "taper_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
@@ -1100,7 +1173,7 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Taper Object", "Curve object name that defines the taper (width)");
RNA_def_property_update(prop, 0, "rna_Curve_update_deps");
- RNA_def_property_pointer_funcs(prop, "rna_Curve_taperObject_get", "rna_Curve_taperObject_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Curve_taperObject_get", "rna_Curve_taperObject_set", NULL, "rna_Curve_otherObject_poll");
/* Flags */
@@ -1111,12 +1184,12 @@ static void rna_def_curve(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "use_fill_front", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FRONT);
RNA_def_property_ui_text(prop, "Front", "Draw filled front for extruded/beveled curves");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "back", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_fill_back", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BACK);
RNA_def_property_ui_text(prop, "Back", "Draw filled back for extruded/beveled curves");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
@@ -1134,19 +1207,56 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Twist Smooth", "Smoothing iteration for tangents");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_deform_fill", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_fill_deform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_DEFORM_FILL);
RNA_def_property_ui_text(prop, "Fill deformed", "Fill curve after applying deformation");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
+ /* texture space */
+ prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "texflag", CU_AUTOSPACE);
+ RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object");
+
+ prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location");
+ RNA_def_property_editable_func(prop, "rna_Curve_texspace_editable");
+ RNA_def_property_float_funcs(prop, "rna_Curve_texspace_loc_get", "rna_Curve_texspace_loc_set", NULL);
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
+ prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
+ RNA_def_property_editable_func(prop, "rna_Curve_texspace_editable");
+ RNA_def_property_float_funcs(prop, "rna_Curve_texspace_size_get", "rna_Curve_texspace_size_set", NULL);
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
+ /* not supported yet
+ prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
+ RNA_def_property_float(prop, NULL, "rot");
+ RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
+ RNA_def_property_editable_func(prop, texspace_editable);
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");*/
+
+ prop= RNA_def_property(srna, "use_map_on_length", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
+ RNA_def_property_ui_text(prop, "Map Along Length", "Generate texture mapping coordinates following the curve direction, rather than the local bounding box");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
+ /* materials */
+ prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
+ RNA_def_property_struct_type(prop, "Material");
+ RNA_def_property_ui_text(prop, "Materials", "");
}
static void rna_def_curve_nurb(BlenderRNA *brna)
{
static EnumPropertyItem spline_interpolation_items[] = {
- {BEZT_IPO_CONST, "LINEAR", 0, "Linear", ""},
- {BEZT_IPO_LIN, "CARDINAL", 0, "Cardinal", ""},
- {BEZT_IPO_BEZ, "BSPLINE", 0, "BSpline", ""},
- {BEZT_IPO_BEZ, "EASE", 0, "Ease", ""},
+ {KEY_LINEAR, "LINEAR", 0, "Linear", ""},
+ {KEY_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
+ {KEY_BSPLINE, "BSPLINE", 0, "BSpline", ""},
+ {KEY_CU_EASE, "EASE", 0, "Ease", ""}, /* todo, define somewhere, not one of BEZT_IPO_* */
{0, NULL, 0, NULL, NULL}};
StructRNA *srna;
@@ -1189,13 +1299,13 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "The interpolation type for this curve element");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "point_count_u", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "point_count_u", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
RNA_def_property_int_sdna(prop, NULL, "pntsu");
RNA_def_property_ui_text(prop, "Points U", "Total number points for the curve or surface in the U direction");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "point_count_v", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "point_count_v", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
RNA_def_property_int_sdna(prop, NULL, "pntsv");
RNA_def_property_ui_text(prop, "Points V", "Total number points for the surface on the V direction");
@@ -1229,40 +1339,40 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Resolution V", "Surface subdivisions per segment");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "cyclic_u", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cyclic_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic U", "Make this curve or surface a closed loop in the U direction");
RNA_def_property_update(prop, 0, "rna_Nurb_update_handle_data"); /* only needed for cyclic_u because cyclic_v cant do bezier */
- prop= RNA_def_property(srna, "cyclic_v", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cyclic_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic V", "Make this surface a closed loop in the V direction");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Note, endpoint and bezier flags should never be on at the same time! */
- prop= RNA_def_property(srna, "endpoint_u", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_endpoint_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_ENDPOINT);
RNA_def_property_ui_text(prop, "Endpoint U", "Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
- prop= RNA_def_property(srna, "endpoint_v", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_endpoint_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_ENDPOINT);
RNA_def_property_ui_text(prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
- prop= RNA_def_property(srna, "bezier_u", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_bezier_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_BEZIER);
RNA_def_property_ui_text(prop, "Bezier U", "Make this nurbs curve or surface act like a bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
- prop= RNA_def_property(srna, "bezier_v", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_bezier_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_BEZIER);
RNA_def_property_ui_text(prop, "Bezier V", "Make this nurbs surface act like a bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
- prop= RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_SMOOTH);
RNA_def_property_ui_text(prop, "Smooth", "Smooth the normals of the surface or beveled curve");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index d0a8763baa7..0ac77382c04 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -476,7 +476,7 @@ void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
if(srna->flag & STRUCT_RUNTIME) {
if(RNA_struct_py_type_get(srna)) {
- fprintf(stderr, "StructRNA \"%s\" freed while holding a python reference\n", srna->name);
+ fprintf(stderr, "RNA_struct_free '%s' freed while holding a python reference\n", srna->identifier);
}
}
@@ -670,7 +670,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
if(DefRNA.preprocess) {
RNA_def_property_struct_type(prop, "Struct");
- RNA_def_property_pointer_funcs(prop, "rna_builtin_type_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_builtin_type_get", NULL, NULL, NULL);
}
else {
#ifdef RNA_RUNTIME
@@ -737,7 +737,7 @@ void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const cha
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
{
if(prop->type != PROP_STRING) {
- fprintf(stderr, "RNA_def_struct_name_property: %s.%s, must be a string property.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_struct_name_property: \"%s.%s\", must be a string property.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
}
else
@@ -781,10 +781,10 @@ void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
if(refine) srna->refine= (StructRefineFunc)refine;
}
-void RNA_def_struct_idproperties_func(StructRNA *srna, const char *idproperties)
+void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
{
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_struct_idproperties_func: only during preprocessing.\n");
+ fprintf(stderr, "RNA_def_struct_idprops_func: only during preprocessing.\n");
return;
}
@@ -847,7 +847,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
char error[512];
if (rna_validate_identifier(identifier, error, 1) == 0) {
- fprintf(stderr, "RNA_def_property: property identifier \"%s\" - %s\n", identifier, error);
+ fprintf(stderr, "RNA_def_property: property identifier \"%s.%s\" - %s\n", srna->identifier, identifier, error);
DefRNA.error= 1;
}
@@ -855,7 +855,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
/* XXX - toto, detect supertype collisions */
if(rna_findlink(&dcont->properties, identifier)) {
- fprintf(stderr, "RNA_def_property: duplicate identifier \"%s\"\n", identifier);
+ fprintf(stderr, "RNA_def_property: duplicate identifier \"%s.%s\"\n", srna->identifier, identifier);
DefRNA.error= 1;
}
@@ -913,7 +913,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
case PROP_COLLECTION:
break;
default:
- fprintf(stderr, "RNA_def_property: %s.%s, invalid property type.\n", srna->identifier, identifier);
+ fprintf(stderr, "RNA_def_property: \"%s.%s\", invalid property type.\n", srna->identifier, identifier);
DefRNA.error= 1;
return NULL;
}
@@ -1009,13 +1009,13 @@ void RNA_def_property_array(PropertyRNA *prop, int length)
StructRNA *srna= DefRNA.laststruct;
if(length<0) {
- fprintf(stderr, "RNA_def_property_array: %s.%s, array length must be zero of greater.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array length must be zero of greater.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
if(length>RNA_MAX_ARRAY_LENGTH) {
- fprintf(stderr, "RNA_def_property_array: %s.%s, array length must be smaller than %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH);
+ fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array length must be smaller than %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH);
DefRNA.error= 1;
return;
}
@@ -1029,7 +1029,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length)
prop->arraydimension= 1;
break;
default:
- fprintf(stderr, "RNA_def_property_array: %s.%s, only boolean/int/float can be array.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_array: \"%s.%s\", only boolean/int/float can be array.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1041,7 +1041,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, int length[]
int i;
if (dimension < 1 || dimension > RNA_MAX_ARRAY_DIMENSION) {
- fprintf(stderr, "RNA_def_property_multi_array: %s.%s, array dimension must be between 1 and %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION);
+ fprintf(stderr, "RNA_def_property_multi_array: \"%s.%s\", array dimension must be between 1 and %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION);
DefRNA.error= 1;
return;
}
@@ -1052,7 +1052,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, int length[]
case PROP_FLOAT:
break;
default:
- fprintf(stderr, "RNA_def_property_multi_array: %s.%s, only boolean/int/float can be array.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_multi_array: \"%s.%s\", only boolean/int/float can be array.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1107,7 +1107,7 @@ void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double
break;
}
default:
- fprintf(stderr, "RNA_def_property_ui_range: %s.%s, invalid type for ui range.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_ui_range: \"%s.%s\", invalid type for ui range.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1135,7 +1135,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max)
break;
}
default:
- fprintf(stderr, "RNA_def_property_range: %s.%s, invalid type for range.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_range: \"%s.%s\", invalid type for range.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1146,7 +1146,7 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_struct_type %s.%s: only during preprocessing.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_struct_type \"%s.%s\": only during preprocessing.\n", srna->identifier, prop->identifier);
return;
}
@@ -1162,7 +1162,7 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
break;
}
default:
- fprintf(stderr, "RNA_def_property_struct_type: %s.%s, invalid type for struct type.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_struct_type: \"%s.%s\", invalid type for struct type.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1193,7 +1193,7 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type)
break;
}
default:
- fprintf(stderr, "RNA_def_property_struct_runtime: %s.%s, invalid type for struct type.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_struct_runtime: \"%s.%s\", invalid type for struct type.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1228,7 +1228,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
break;
}
default:
- fprintf(stderr, "RNA_def_property_enum_items: %s.%s, invalid type for struct type.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_enum_items: \"%s.%s\", invalid type for struct type.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1245,7 +1245,7 @@ void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
break;
}
default:
- fprintf(stderr, "RNA_def_property_string_maxlength: %s.%s, type is not string.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_string_maxlength: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1262,7 +1262,7 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, int value)
break;
}
default:
- fprintf(stderr, "RNA_def_property_boolean_default: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_boolean_default: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1279,7 +1279,7 @@ void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array)
break;
}
default:
- fprintf(stderr, "RNA_def_property_boolean_default: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_boolean_default: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1296,7 +1296,7 @@ void RNA_def_property_int_default(PropertyRNA *prop, int value)
break;
}
default:
- fprintf(stderr, "RNA_def_property_int_default: %s.%s, type is not int.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_int_default: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1313,7 +1313,7 @@ void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
break;
}
default:
- fprintf(stderr, "RNA_def_property_int_default: %s.%s, type is not int.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_int_default: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1330,7 +1330,7 @@ void RNA_def_property_float_default(PropertyRNA *prop, float value)
break;
}
default:
- fprintf(stderr, "RNA_def_property_float_default: %s.%s, type is not float.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_float_default: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1347,7 +1347,7 @@ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
break;
}
default:
- fprintf(stderr, "RNA_def_property_float_default: %s.%s, type is not float.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_float_default: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1364,7 +1364,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
break;
}
default:
- fprintf(stderr, "RNA_def_property_string_default: %s.%s, type is not string.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_string_default: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1390,7 +1390,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
eprop->defaultvalue= eprop->item[0].value;
}
else {
- fprintf(stderr, "RNA_def_property_enum_default: %s.%s, default is not in items.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_enum_default: \"%s.%s\", default is not in items.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
}
}
@@ -1398,7 +1398,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
break;
}
default:
- fprintf(stderr, "RNA_def_property_enum_default: %s.%s, type is not enum.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_enum_default: \"%s.%s\", type is not enum.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1437,7 +1437,7 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru
return dp;
}
else {
- fprintf(stderr, "rna_def_property_sdna: %s.%s not found.\n", structname, propname);
+ fprintf(stderr, "rna_def_property_sdna: \"%s.%s\" not found.\n", structname, propname);
DefRNA.error= 1;
return NULL;
}
@@ -1475,7 +1475,7 @@ void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, co
}
if(prop->type != PROP_BOOLEAN) {
- fprintf(stderr, "RNA_def_property_boolean_sdna: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_boolean_sdna: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1508,7 +1508,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const
}
if(prop->type != PROP_INT) {
- fprintf(stderr, "RNA_def_property_int_sdna: %s.%s, type is not int.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_int_sdna: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1546,7 +1546,7 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons
}
if(prop->type != PROP_FLOAT) {
- fprintf(stderr, "RNA_def_property_float_sdna: %s.%s, type is not float.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_float_sdna: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1565,7 +1565,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const
}
if(prop->type != PROP_ENUM) {
- fprintf(stderr, "RNA_def_property_enum_sdna: %s.%s, type is not enum.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_enum_sdna: \"%s.%s\", type is not enum.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1576,7 +1576,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const
prop->totarraylength= 0;
if(!DefRNA.silent) {
- fprintf(stderr, "RNA_def_property_enum_sdna: %s.%s, array not supported for enum type.\n", structname, propname);
+ fprintf(stderr, "RNA_def_property_enum_sdna: \"%s.%s\", array not supported for enum type.\n", structname, propname);
DefRNA.error= 1;
}
}
@@ -1607,7 +1607,7 @@ void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, con
}
if(prop->type != PROP_STRING) {
- fprintf(stderr, "RNA_def_property_string_sdna: %s.%s, type is not string.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_string_sdna: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1632,7 +1632,7 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co
}
if(prop->type != PROP_POINTER) {
- fprintf(stderr, "RNA_def_property_pointer_sdna: %s.%s, type is not pointer.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_pointer_sdna: \"%s.%s\", type is not pointer.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1643,7 +1643,7 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co
prop->totarraylength= 0;
if(!DefRNA.silent) {
- fprintf(stderr, "RNA_def_property_pointer_sdna: %s.%s, array not supported for pointer type.\n", structname, propname);
+ fprintf(stderr, "RNA_def_property_pointer_sdna: \"%s.%s\", array not supported for pointer type.\n", structname, propname);
DefRNA.error= 1;
}
}
@@ -1662,7 +1662,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
}
if(prop->type != PROP_COLLECTION) {
- fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s, type is not collection.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_collection_sdna: \"%s.%s\", type is not collection.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1673,7 +1673,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
prop->totarraylength= 0;
if(!DefRNA.silent) {
- fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s, array of collections not supported.\n", structname, propname);
+ fprintf(stderr, "RNA_def_property_collection_sdna: \"%s.%s\", array of collections not supported.\n", structname, propname);
DefRNA.error= 1;
}
}
@@ -1714,7 +1714,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
}
else {
if(!DefRNA.silent) {
- fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s not found.\n", structname, lengthpropname);
+ fprintf(stderr, "RNA_def_property_collection_sdna: \"%s.%s\" not found.\n", structname, lengthpropname);
DefRNA.error= 1;
}
}
@@ -1794,7 +1794,7 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch
break;
}
default:
- fprintf(stderr, "RNA_def_property_boolean_funcs: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_boolean_funcs: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1825,7 +1825,7 @@ void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *
break;
}
default:
- fprintf(stderr, "RNA_def_property_int_funcs: %s.%s, type is not int.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_int_funcs: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1856,7 +1856,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char
break;
}
default:
- fprintf(stderr, "RNA_def_property_float_funcs: %s.%s, type is not float.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_float_funcs: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1881,7 +1881,7 @@ void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char
break;
}
default:
- fprintf(stderr, "RNA_def_property_enum_funcs: %s.%s, type is not enum.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_enum_funcs: \"%s.%s\", type is not enum.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1906,13 +1906,13 @@ void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const cha
break;
}
default:
- fprintf(stderr, "RNA_def_property_string_funcs: %s.%s, type is not string.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_string_funcs: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
}
-void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *typef)
+void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *typef, const char *poll)
{
StructRNA *srna= DefRNA.laststruct;
@@ -1928,10 +1928,11 @@ void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const ch
if(get) pprop->get= (PropPointerGetFunc)get;
if(set) pprop->set= (PropPointerSetFunc)set;
if(typef) pprop->typef= (PropPointerTypeFunc)typef;
+ if(poll) pprop->poll= (PropPointerPollFunc)poll;
break;
}
default:
- fprintf(stderr, "RNA_def_property_pointer_funcs: %s.%s, type is not pointer.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_pointer_funcs: \"%s.%s\", type is not pointer.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1960,7 +1961,7 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, con
break;
}
default:
- fprintf(stderr, "RNA_def_property_collection_funcs: %s.%s, type is not collection.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "RNA_def_property_collection_funcs: \"%s.%s\", type is not collection.\n", srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -2200,6 +2201,17 @@ PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identi
return prop;
}
+PropertyRNA *RNA_def_float_vector_xyz(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value,
+ float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
+{
+ PropertyRNA *prop;
+
+ prop= RNA_def_float_vector(cont_, identifier, len, default_value, hardmin, hardmax, ui_name, ui_description, softmin, softmax);
+ prop->subtype = PROP_XYZ;
+
+ return prop;
+}
+
PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
{
@@ -2422,11 +2434,11 @@ FunctionRNA *RNA_def_function_runtime(StructRNA *srna, const char *identifier, C
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
{
if (ret->flag & PROP_DYNAMIC) {
- fprintf(stderr, "RNA_def_function_return: %s.%s, dynamic values are not allowed as strict returns, use RNA_def_function_output instead.\n", func->identifier, ret->identifier);
+ fprintf(stderr, "RNA_def_function_return: \"%s.%s\", dynamic values are not allowed as strict returns, use RNA_def_function_output instead.\n", func->identifier, ret->identifier);
return;
}
else if (ret->arraydimension) {
- fprintf(stderr, "RNA_def_function_return: %s.%s, arrays are not allowed as strict returns, use RNA_def_function_output instead.\n", func->identifier, ret->identifier);
+ fprintf(stderr, "RNA_def_function_return: \"%s.%s\", arrays are not allowed as strict returns, use RNA_def_function_output instead.\n", func->identifier, ret->identifier);
return;
}
@@ -2722,5 +2734,41 @@ void RNA_def_property_free_pointers(PropertyRNA *prop)
}
}
}
+
+void RNA_def_property_free(StructOrFunctionRNA *cont_, PropertyRNA *prop)
+{
+ ContainerRNA *cont= cont_;
+
+ if(prop->flag & PROP_RUNTIME) {
+ if(cont->prophash)
+ BLI_ghash_remove(cont->prophash, (void*)prop->identifier, NULL, NULL);
+
+ RNA_def_property_free_pointers(prop);
+ rna_freelinkN(&cont->properties, prop);
+ }
+ else {
+ RNA_def_property_free_pointers(prop);
+ }
+}
+
+/* note: only intended for removing dynamic props */
+int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *identifier)
+{
+ ContainerRNA *cont= cont_;
+ PropertyRNA *prop;
+
+ for(prop= cont->properties.first; prop; prop= prop->next) {
+ if(strcmp(prop->identifier, identifier)==0) {
+ if(prop->flag & PROP_RUNTIME) {
+ RNA_def_property_free(cont_, prop);
+ return 1;
+ }
+ else {
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
#endif
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 7f85f0f5e2d..a55c3f10095 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -110,7 +110,7 @@ static void rna_ChannelDriver_update_data(Main *bmain, Scene *scene, PointerRNA
driver->flag &= ~DRIVER_FLAG_INVALID;
// TODO: this really needs an update guard...
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
DAG_id_flush_update(id, OB_RECALC_OB|OB_RECALC_DATA);
WM_main_add_notifier(NC_SCENE|ND_FRAME, scene);
@@ -155,6 +155,13 @@ static void rna_DriverTarget_update_name(Main *bmain, Scene *scene, PointerRNA *
/* ----------- */
+/* note: this function exists only to avoid id refcounting */
+static void rna_DriverTarget_id_set(PointerRNA *ptr, PointerRNA value)
+{
+ DriverTarget *dtar= (DriverTarget*)ptr->data;
+ dtar->id= value.data;
+}
+
static StructRNA *rna_DriverTarget_id_typef(PointerRNA *ptr)
{
DriverTarget *dtar= (DriverTarget*)ptr->data;
@@ -337,6 +344,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value)
/* already belongs to group? */
if (fcu->grp == value.data) {
/* nothing to do */
+ printf("ERROR: F-Curve already belongs to the group\n");
return;
}
@@ -345,6 +353,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value)
*/
if (act == NULL) {
/* can't change the grouping of F-Curve when it doesn't belong to an action */
+ printf("ERROR: cannot assign F-Curve to group, since F-Curve is not attached to any ID\n");
return;
}
@@ -376,9 +385,13 @@ DriverVar *rna_Driver_new_variable(ChannelDriver *driver)
return driver_add_new_variable(driver);
}
-void rna_Driver_remove_variable(ChannelDriver *driver, DriverVar *dvar)
+void rna_Driver_remove_variable(ChannelDriver *driver, ReportList *reports, DriverVar *dvar)
{
- /* call the API function for this */
+ if(BLI_findindex(&driver->variables, dvar) == -1) {
+ BKE_report(reports, RPT_ERROR, "Variable does not exist in this driver.");
+ return;
+ }
+
driver_free_variable(driver, dvar);
}
@@ -396,14 +409,18 @@ static void rna_FCurve_active_modifier_set(PointerRNA *ptr, PointerRNA value)
set_active_fmodifier(&fcu->modifiers, (FModifier *)value.data);
}
-static FModifier *rna_FCurve_modifiers_new(FCurve *fcu, bContext *C, int type)
+static FModifier *rna_FCurve_modifiers_new(FCurve *fcu, int type)
{
return add_fmodifier(&fcu->modifiers, type);
}
-static int rna_FCurve_modifiers_remove(FCurve *fcu, bContext *C, int index)
+static void rna_FCurve_modifiers_remove(FCurve *fcu, ReportList *reports, FModifier *fcm)
{
- return remove_fmodifier_index(&fcu->modifiers, index);
+ if(BLI_findindex(&fcu->modifiers, fcm) == -1) {
+ BKE_reportf(reports, RPT_ERROR, "FCurveModifier '%s' not found in fcurve.", fcm->name);
+ return;
+ }
+ remove_fmodifier(&fcu->modifiers, fcm);
}
static void rna_FModifier_active_set(PointerRNA *ptr, int value)
@@ -537,6 +554,11 @@ static void rna_FKeyframe_points_remove(FCurve *fcu, ReportList *reports, BezTri
delete_fcurve_key(fcu, index, !do_fast);
}
+static void rna_fcurve_range(FCurve *fcu, float range[2])
+{
+ calc_fcurve_range(fcu, range, range+1);
+}
+
#else
static void rna_def_fmodifier_generator(BlenderRNA *brna)
@@ -554,23 +576,23 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
RNA_def_struct_sdna_from(srna, "FMod_Generator", "data");
/* define common props */
- prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
// XXX this has a special validation func
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, generator_mode_items);
RNA_def_property_ui_text(prop, "Mode", "Type of generator to use");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* order of the polynomial */
// XXX this has a special validation func
prop= RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (number of coefficients - 1)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* coefficients array */
prop= RNA_def_property(srna, "coefficients", PROP_FLOAT, PROP_NONE);
@@ -604,31 +626,31 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
/* coefficients */
prop= RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* flags */
- prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "function_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, "Type", "Type of built-in function to use");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------- */
@@ -646,21 +668,21 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna)
* - for now, these are allowed to go past each other, so that we can have inverted action
* - technically, the range is limited by the settings in the envelope-modifier data, not here...
*/
- prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* Frame */
prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
// TODO:
// - selection flags (not implemented in UI yet though)
@@ -685,17 +707,17 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna)
prop= RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "midval");
RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "default_minimum", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "default_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "default_maximum", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "default_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------- */
@@ -717,24 +739,28 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
RNA_def_struct_sdna_from(srna, "FMod_Cycles", "data");
/* before */
- prop= RNA_def_property(srna, "before_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode_before", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "before_mode");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Before Mode", "Cycling mode to use before first keyframe");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "before_cycles", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "cycles_before", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "before_cycles");
RNA_def_property_ui_text(prop, "Before Cycles", "Maximum number of cycles to allow before first keyframe. (0 = infinite)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* after */
- prop= RNA_def_property(srna, "after_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mode_after", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "after_mode");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "After Mode", "Cycling mode to use after last keyframe");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "after_cycles", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "cycles_after", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "after_cycles");
RNA_def_property_ui_text(prop, "After Cycles", "Maximum number of cycles to allow after last keyframe. (0 = infinite)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------- */
@@ -760,49 +786,49 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Limits F-Modifier", "Limits the time/value ranges of the modified F-Curve");
RNA_def_struct_sdna_from(srna, "FMod_Limits", "data");
- prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.xmin");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_minx_range");
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.ymin");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_miny_range");
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.xmax");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxx_range");
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.ymax");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxy_range");
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------- */
@@ -823,30 +849,31 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Noise F-Modifier", "Gives randomness to the modified F-Curve");
RNA_def_struct_sdna_from(srna, "FMod_Noise", "data");
- prop= RNA_def_property(srna, "modification", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "modification");
RNA_def_property_enum_items(prop, prop_modification_items);
- RNA_def_property_ui_text(prop, "Modification", "Method of modifying the existing F-Curve");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_ui_text(prop, "Blend Type", "Method of modifying the existing F-Curve");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "size");
- RNA_def_property_ui_text(prop, "Size", "Scaling (in time) of the noise");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_ui_text(prop, "Scale", "Scaling (in time) of the noise");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strength");
RNA_def_property_ui_text(prop, "Strength", "Amplitude of the noise - the amount that it modifies the underlying curve");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "phase");
RNA_def_property_ui_text(prop, "Phase", "A random seed for the noise effect");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_ui_text(prop, "Depth", "Amount of fine level detail present in the noise");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
@@ -862,36 +889,37 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna)
RNA_def_struct_sdna_from(srna, "FMod_Stepped", "data");
/* properties */
- prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame_step", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "step_size");
RNA_def_property_ui_text(prop, "Step Size", "Number of frames to hold each value");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_ui_text(prop, "Offset", "Reference number of frames before frames get held. Use to get hold for '1-3' vs '5-7' holding patterns");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "use_frame_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_BEFORE);
RNA_def_property_ui_text(prop, "Use Start Frame", "Restrict modifier to only act after its 'start' frame");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "use_frame_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_AFTER);
RNA_def_property_ui_text(prop, "Use End Frame", "Restrict modifier to only act before its 'end' frame");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "start_frame");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_start_frame_range");
RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if applicable)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "end_frame");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_end_frame_range");
RNA_def_property_ui_text(prop, "End Frame", "Frame that modifier's influence ends (if applicable)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------- */
@@ -921,20 +949,20 @@ static void rna_def_fmodifier(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "F-Curve Modifier Type");
/* settings */
- prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "F-Curve Modifier's panel is expanded in UI");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
- prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_MUTED);
RNA_def_property_ui_text(prop, "Muted", "F-Curve Modifier will not be evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_ui_icon(prop, ICON_MUTE_IPO_OFF, 1);
- prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_DISABLED);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FMODIFIER_FLAG_DISABLED);
RNA_def_property_ui_text(prop, "Disabled", "F-Curve Modifier has invalid settings and will not be evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
@@ -974,7 +1002,8 @@ static void rna_def_drivertarget(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ID");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable");
- RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_DriverTarget_id_typef");
+ /* note: custom set function is ONLY to avoid rna setting a user for this. */
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_DriverTarget_id_set", "rna_DriverTarget_id_typef", NULL);
RNA_def_property_ui_text(prop, "ID", "ID-block that the specific property used can be found from (id_type property must be set first)");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
@@ -1004,7 +1033,7 @@ static void rna_def_drivertarget(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "Driver variable type");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
- prop= RNA_def_property(srna, "use_local_space_transforms", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_space_transform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", DTAR_FLAG_LOCALSPACE);
RNA_def_property_ui_text(prop, "Local Space", "Use transforms in Local Space (as opposed to the worldspace default)");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
@@ -1073,10 +1102,11 @@ static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop
/* remove variable */
func= RNA_def_function(srna, "remove", "rna_Driver_remove_variable");
- RNA_def_function_ui_description(func, "Remove an existing variable from the driver.");
- /* target to remove */
- parm= RNA_def_pointer(func, "var", "DriverVariable", "", "Variable to remove from the driver.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_function_ui_description(func, "Remove an existing variable from the driver.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ /* target to remove */
+ parm= RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
static void rna_def_channeldriver(BlenderRNA *brna)
@@ -1120,8 +1150,8 @@ static void rna_def_channeldriver(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Debug Info", "Show intermediate values for the driver calculations to allow debugging of drivers");
/* State Info (for Debugging) */
- prop= RNA_def_property(srna, "invalid", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", DRIVER_FLAG_INVALID);
+ prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", DRIVER_FLAG_INVALID);
RNA_def_property_ui_text(prop, "Invalid", "Driver could not be evaluated in past, so should be skipped");
@@ -1141,17 +1171,17 @@ static void rna_def_fpoint(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "F-Curve Sample", "Sample point for F-Curve");
/* Boolean values */
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
- RNA_def_property_ui_text(prop, "Selected", "Selection status");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ RNA_def_property_ui_text(prop, "Select", "Selection status");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
/* Vector value */
- prop= RNA_def_property(srna, "point", PROP_FLOAT, PROP_XYZ);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
@@ -1168,29 +1198,29 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Keyframe", "Bezier curve point with two handles defining a Keyframe on an F-Curve");
/* Boolean values */
- prop= RNA_def_property(srna, "selected_handle1", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
RNA_def_property_ui_text(prop, "Handle 1 selected", "Handle 1 selection status");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "selected_handle2", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f3", 0);
RNA_def_property_ui_text(prop, "Handle 2 selected", "Handle 2 selection status");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f2", 0);
- RNA_def_property_ui_text(prop, "Selected", "Control point selection status");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ RNA_def_property_ui_text(prop, "Select", "Control point selection status");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
/* Enums */
- prop= RNA_def_property(srna, "handle1_type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h1");
RNA_def_property_enum_items(prop, beztriple_handle_type_items);
RNA_def_property_ui_text(prop, "Handle 1 Type", "Handle types");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- prop= RNA_def_property(srna, "handle2_type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h2");
RNA_def_property_enum_items(prop, beztriple_handle_type_items);
RNA_def_property_ui_text(prop, "Handle 2 Type", "Handle types");
@@ -1209,23 +1239,23 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
/* Vector values */
- prop= RNA_def_property(srna, "handle1", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle1_get", "rna_FKeyframe_handle1_set", NULL);
RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_ctrlpoint_get", "rna_FKeyframe_ctrlpoint_set", NULL);
RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "handle2", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle2_get", "rna_FKeyframe_handle2_set", NULL);
RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
@@ -1246,13 +1276,12 @@ static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
/* Collection active property */
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "FModifier");
- RNA_def_property_pointer_funcs(prop, "rna_FCurve_active_modifier_get", "rna_FCurve_active_modifier_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_FCurve_active_modifier_get", "rna_FCurve_active_modifier_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active F-Curve Modifier", "Active F-Curve Modifier");
/* Constraint collection */
func= RNA_def_function(srna, "new", "rna_FCurve_modifiers_new");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Add a constraint to this object");
/* return type */
parm= RNA_def_pointer(func, "fmodifier", "FModifier", "", "New fmodifier.");
@@ -1262,14 +1291,11 @@ static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "remove", "rna_FCurve_modifiers_remove");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a modifier from this fcurve.");
- /* return type */
- parm= RNA_def_boolean(func, "success", 0, "Success", "Removed the constraint successfully.");
- RNA_def_function_return(func, parm);
- /* object to add */
- parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "", 0, INT_MAX);
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* modifier to remove */
+ parm= RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
/* fcurve.keyframe_points */
@@ -1313,7 +1339,9 @@ static void rna_def_fcurve(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
-
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
static EnumPropertyItem prop_mode_extend_items[] = {
{FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", 0, "Constant", ""},
{FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", 0, "Linear", ""},
@@ -1344,7 +1372,7 @@ static void rna_def_fcurve(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "grp");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Group", "Action Group that this F-Curve belongs to");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_FCurve_group_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_FCurve_group_set", NULL, NULL);
RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* Path + Array Index */
@@ -1369,35 +1397,35 @@ static void rna_def_fcurve(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* Flags */
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_SELECTED);
- RNA_def_property_ui_text(prop, "Selected", "F-Curve is selected for editing");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ RNA_def_property_ui_text(prop, "Select", "F-Curve is selected for editing");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_PROTECTED);
- RNA_def_property_ui_text(prop, "Locked", "F-Curve's settings cannot be edited");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_ui_text(prop, "Lock", "F-Curve's settings cannot be edited");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_MUTED);
RNA_def_property_ui_text(prop, "Muted", "F-Curve is not evaluated");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "auto_clamped_handles", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_handle_clamp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_AUTO_HANDLES);
RNA_def_property_ui_text(prop, "Auto Clamped Handles", "All auto-handles for F-Curve are clamped");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- prop= RNA_def_property(srna, "visible", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_VISIBLE);
- RNA_def_property_ui_text(prop, "Visible", "F-Curve and its keyframes are shown in the Graph Editor graphs");
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_VISIBLE);
+ RNA_def_property_ui_text(prop, "Hide", "F-Curve and its keyframes are hidden in the Graph Editor graphs");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
-
+
/* State Info (for Debugging) */
- prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_DISABLED);
- RNA_def_property_ui_text(prop, "Disabled", "F-Curve could not be evaluated in past, so should be skipped when evaluating");
+ prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_DISABLED);
+ RNA_def_property_ui_text(prop, "Valid", "False when F-Curve could not be evaluated in past, so should be skipped when evaluating");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
/* Collections */
@@ -1415,8 +1443,23 @@ static void rna_def_fcurve(BlenderRNA *brna)
prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "FModifier");
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the shape of the F-Curve");
-
rna_def_fcurve_modifiers(brna, prop);
+
+ /* Functions */
+ func= RNA_def_function(srna, "evaluate", "evaluate_fcurve"); /* calls the C/API direct */
+ RNA_def_function_ui_description(func, "Evaluate fcurve.");
+ parm= RNA_def_float(func, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame", "Evaluate fcurve at given frame", -FLT_MAX, FLT_MAX);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return value */
+ parm= RNA_def_float(func, "position", 0, -FLT_MAX, FLT_MAX, "Position", "FCurve position", -FLT_MAX, FLT_MAX);
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "range", "rna_fcurve_range");
+ RNA_def_function_ui_description(func, "Get the time extents for F-Curve.");
+ /* return value */
+ parm= RNA_def_float_vector(func, "range", 2, NULL, -FLT_MAX, FLT_MAX, "Range", "Min/Max values", -FLT_MAX, FLT_MAX);
+ RNA_def_property_flag(parm, PROP_THICK_WRAP);
+ RNA_def_function_output(func, parm);
}
/* *********************** */
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index 0782ee4fb84..68060e2cfe3 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -105,6 +105,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
psys->part= part;
psys->pointcache= BKE_ptcache_add(&psys->ptcaches);
psys->flag |= PSYS_ENABLED;
+ sprintf(psys->name, "FluidParticles");
BLI_addtail(&ob->particlesystem,psys);
/* add modifier */
@@ -227,11 +228,11 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
RNA_def_property_enum_items(prop, quality_items);
RNA_def_property_ui_text(prop, "Render Display Mode", "How to display the mesh for rendering");
- prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE);
RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse fluid frames");
- prop= RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_maxlength(prop, 240);
RNA_def_property_string_sdna(prop, NULL, "surfdataPath");
RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in");
@@ -249,21 +250,21 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
RNA_def_property_range(prop, -1000.1, 1000.1);
RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction");
- prop= RNA_def_property(srna, "override_time", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_time_override", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_OVERRIDE_TIME);
RNA_def_property_ui_text(prop, "Override Time", "Use a custom start and end time (in seconds) instead of the scene's timeline");
prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "animStart");
RNA_def_property_range(prop, 0, 100);
- RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame");
+ RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame (in seconds)");
prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "animEnd");
RNA_def_property_range(prop, 0, 100);
- RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame");
+ RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame (in seconds)");
- prop= RNA_def_property(srna, "real_world_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "simulation_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "realsize");
RNA_def_property_range(prop, 0.001, 10);
RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in metres");
@@ -299,7 +300,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
rna_def_fluidsim_slip(srna);
- prop= RNA_def_property(srna, "surface_smoothing", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "surface_smooth", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "surfaceSmoothing");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0, 5.0);
@@ -311,7 +312,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Surface Subdivisions", "Number of isosurface subdivisions. This is necessary for the inclusion of particles into the surface generation. Warning - can lead to longer computation times!");
- prop= RNA_def_property(srna, "generate_speed_vectors", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_speed_vectors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "domainNovecgen", 0);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Generate Speed Vectors", "Generate speed vectors for vector blur");
@@ -347,7 +348,7 @@ static void rna_def_fluidsim_volume(StructRNA *srna)
RNA_def_property_enum_items(prop, volume_type_items);
RNA_def_property_ui_text(prop, "Volume Initialization", "Volume initialization type");
- prop= RNA_def_property(srna, "export_animated_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_animated_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "domainNovecgen", 0);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Export Animated Mesh", "Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it");
@@ -357,9 +358,9 @@ static void rna_def_fluidsim_active(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_ACTIVE);
- RNA_def_property_ui_text(prop, "Active", "Object contributes to the fluid simulation");
+ RNA_def_property_ui_text(prop, "Enabled", "Object contributes to the fluid simulation");
}
static void rna_def_fluidsim_fluid(BlenderRNA *brna)
@@ -419,7 +420,7 @@ static void rna_def_fluidsim_inflow(BlenderRNA *brna)
RNA_def_property_range(prop, -1000.1, 1000.1);
RNA_def_property_ui_text(prop, "Inflow Velocity", "Initial velocity of fluid");
- prop= RNA_def_property(srna, "local_coordinates", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSINFLOW_LOCALCOORD);
RNA_def_property_ui_text(prop, "Local Coordinates", "Use local coordinates for inflow. (e.g. for rotating objects)");
@@ -446,15 +447,15 @@ static void rna_def_fluidsim_particle(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Particle Fluid Simulation Settings", "Fluid simulation settings for objects storing fluid particles generated by the simulation");
- prop= RNA_def_property(srna, "drops", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_drops", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_DROP);
RNA_def_property_ui_text(prop, "Drops", "Show drop particles");
- prop= RNA_def_property(srna, "floats", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_floats", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_FLOAT);
RNA_def_property_ui_text(prop, "Floats", "Show floating foam particles");
- prop= RNA_def_property(srna, "tracer", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_tracer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_TRACER);
RNA_def_property_ui_text(prop, "Tracer", "Show tracer particles");
@@ -468,7 +469,7 @@ static void rna_def_fluidsim_particle(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Alpha Influence", "Amount of particle alpha change, inverse of size influence: 0=off (all same alpha), 1=full. (large particles get lower alphas, smaller ones higher values)");
- prop= RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_maxlength(prop, 240);
RNA_def_property_string_sdna(prop, NULL, "surfdataPath");
RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store and load particles from");
@@ -522,7 +523,7 @@ static void rna_def_fluidsim_control(BlenderRNA *brna)
RNA_def_property_range(prop, 5.0, 100.0);
RNA_def_property_ui_text(prop, "Quality", "Specifies the quality which is used for object sampling. (higher = better but slower)");
- prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse control object movement");
@@ -559,7 +560,7 @@ void RNA_def_fluidsim(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_FluidSettings_update_type");
//prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
- //RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by fluid simulation settings");
+ //RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by fluid simulation settings");
/* types */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index a541015139f..c03af99ccb0 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -131,13 +131,13 @@ static void rna_def_gpencil_frame(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears");
/* Flags */
- prop= RNA_def_property(srna, "paint_lock", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_PAINT); // XXX should it be editable?
RNA_def_property_ui_text(prop, "Paint Lock", "Frame is being edited (painted on)");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT);
- RNA_def_property_ui_text(prop, "Selected", "Frame is selected for editing in the DopeSheet");
+ RNA_def_property_ui_text(prop, "Select", "Frame is selected for editing in the DopeSheet");
}
static void rna_def_gpencil_layer(BlenderRNA *brna)
@@ -151,7 +151,7 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
/* Name */
prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
- RNA_def_property_ui_text(prop, "Info", "Description of layer");
+ RNA_def_property_ui_text(prop, "Info", "Layer name");
RNA_def_struct_name_property(srna, prop);
/* Frames */
@@ -169,17 +169,17 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
/* Drawing Color */
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Color", "Color that all sketches in this layer are drawn with");
+ RNA_def_property_ui_text(prop, "Color", "Color for all strokes in this layer");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "color[3]");
RNA_def_property_range(prop, 0.3, 1.0f);
- RNA_def_property_ui_text(prop, "Opacity", "Visibility of strokes");
+ RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* Line Thickness */
- prop= RNA_def_property(srna, "line_thickness", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "line_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "thickness");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)");
@@ -191,37 +191,37 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Onion Skinning", "Ghost frames on either side of frame");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- prop= RNA_def_property(srna, "max_ghost_range", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "ghost_range_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gstep");
RNA_def_property_range(prop, 0, 120);
- RNA_def_property_ui_text(prop, "Max Ghost Range", "Maximum number of frames on either side of the active frame to show. (0 = just show the 'first' available sketch on either side)");
+ RNA_def_property_ui_text(prop, "Max Ghost Range", "Maximum number of frames on either side of the active frame to show (0 = show the 'first' available sketch on either side)");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* Flags */
prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
- RNA_def_property_ui_text(prop, "Hide", "Layer doesn't get drawn");
+ RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED);
- RNA_def_property_ui_text(prop, "Locked", "Layer is protected from further editing and/or frame changes");
+ RNA_def_property_ui_text(prop, "Locked", "Protect layer from further editing and/or frame changes");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- prop= RNA_def_property(srna, "frame_lock", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_FRAMELOCK);
- RNA_def_property_ui_text(prop, "Frame Locked", "Current frame displayed by layer cannot be changed");
+ RNA_def_property_ui_text(prop, "Frame Locked", "Lock current frame displayed by layer");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set");
- RNA_def_property_ui_text(prop, "Active", "Layer is 'active' layer being edited");
+ RNA_def_property_ui_text(prop, "Active", "Set active layer for editing");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT);
- RNA_def_property_ui_text(prop, "Selected", "Layer is selected for editing in the DopeSheet");
+ RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the DopeSheet");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
// XXX keep this option?
@@ -237,10 +237,10 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem draw_mode_items[] = {
- {GP_DATA_VIEWALIGN, "CURSOR", 0, "Cursor", ""},
- {0, "VIEW", 0, "View", ""}, /* weired, GP_DATA_VIEWALIGN is inverted */
- {GP_DATA_VIEWALIGN|GP_DATA_DEPTH_VIEW, "SURFACE", 0, "Surface", ""},
- {GP_DATA_VIEWALIGN|GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", ""},
+ {GP_DATA_VIEWALIGN, "CURSOR", 0, "Cursor", "Draw stroke at the 3D cursor"},
+ {0, "VIEW", 0, "View", "Stick stroke to the view "}, /* weired, GP_DATA_VIEWALIGN is inverted */
+ {GP_DATA_VIEWALIGN|GP_DATA_DEPTH_VIEW, "SURFACE", 0, "Surface", "Stick stroke to surfaces"},
+ {GP_DATA_VIEWALIGN|GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "GreasePencil", "ID");
@@ -252,7 +252,7 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
RNA_def_property_struct_type(prop, "GPencilLayer");
- RNA_def_property_ui_text(prop, "Layers", "Similar to layers in Photoshop");
+ RNA_def_property_ui_text(prop, "Layers", "");
/* Flags */
prop= RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE);
@@ -262,7 +262,7 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_DEPTH_STROKE_ENDPOINTS);
- RNA_def_property_ui_text(prop, "Only Endpoints", "When snapping the stroke to existing lines, only use the first and last parts of the line");
+ RNA_def_property_ui_text(prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping");
}
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c
index e16d586b5fa..bd1b7c96998 100644
--- a/source/blender/makesrna/intern/rna_group.c
+++ b/source/blender/makesrna/intern/rna_group.c
@@ -110,13 +110,14 @@ void RNA_def_group(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Group", "ID");
RNA_def_struct_ui_text(srna, "Group", "Group of Object datablocks");
RNA_def_struct_ui_icon(srna, ICON_GROUP);
+ RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); /* this is done on save/load in readfile.c, removed if no objects are in the group */
prop= RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "dupli_ofs");
RNA_def_property_ui_text(prop, "Dupli Offset", "Offset from the origin to use when instancing as DupliGroup");
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
- prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER);
+ prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Dupli Layers", "Layers visible when this groups is instanced as a dupli");
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index 7fc9673f3e5..7dffa4aec74 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -33,6 +33,7 @@
#include "DNA_scene_types.h"
#include "BKE_context.h"
+#include "BKE_depsgraph.h"
#include "BKE_image.h"
#include "WM_types.h"
@@ -78,6 +79,7 @@ static void rna_Image_source_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Image *ima= ptr->id.data;
BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE);
+ DAG_id_flush_update(&ima->id, 0);
}
static void rna_Image_fields_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -105,6 +107,7 @@ static void rna_Image_reload_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Image *ima= ptr->id.data;
BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
+ DAG_id_flush_update(&ima->id, 0);
}
static void rna_Image_generated_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -220,23 +223,25 @@ static void rna_def_imageuser(BlenderRNA *brna)
srna= RNA_def_struct(brna, "ImageUser", NULL);
RNA_def_struct_ui_text(srna, "Image User", "Parameters defining how an Image datablock is used by another datablock");
- prop= RNA_def_property(srna, "auto_refresh", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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);
+ prop= RNA_def_property(srna, "use_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);
+ prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "frames");
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);
+ prop= RNA_def_property(srna, "frame_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_ImageUser_update");
@@ -249,7 +254,7 @@ static void rna_def_imageuser(BlenderRNA *brna)
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_range(prop, 1, 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");
@@ -293,15 +298,15 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image");
RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Filename", "Image/Movie file name");
+ RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
/* eek. this is horrible but needed so we can save to a new name without blanking the data :( */
- prop= RNA_def_property(srna, "filename_raw", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Filename", "Image/Movie file name (without data refreshing)");
+ RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)");
prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, image_type_items);
@@ -331,22 +336,17 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
/* booleans */
- prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, "rna_Image_fields_update");
- prop= RNA_def_property(srna, "antialias", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANTIALI);
- RNA_def_property_ui_text(prop, "Anti-alias", "Toggles image anti-aliasing, only works with solid colors");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
-
- prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL);
RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
- prop= RNA_def_property(srna, "dirty", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved");
@@ -384,30 +384,30 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "animated", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_animation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM);
RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
- prop= RNA_def_property(srna, "animation_start", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "twsta");
RNA_def_property_range(prop, 0, 128);
RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
- prop= RNA_def_property(srna, "animation_end", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "twend");
RNA_def_property_range(prop, 0, 128);
RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
- prop= RNA_def_property(srna, "animation_speed", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "animspeed");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "tiles", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_tiles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES);
RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
@@ -424,16 +424,22 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "clamp_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_clamp_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U);
RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "clamp_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_clamp_y", PROP_BOOLEAN, PROP_NONE);
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);
+ prop= RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "bindcode");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode");
+ 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)
@@ -443,7 +449,7 @@ static void rna_def_image(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
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);
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index aa2ed58623e..70438ae3d8c 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -33,6 +33,8 @@
#include "RNA_define.h"
+#include "BIF_gl.h"
+
#ifdef RNA_RUNTIME
#include "BKE_image.h"
@@ -75,6 +77,8 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports
if (!BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) {
BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path);
}
+
+ BKE_image_release_ibuf(image, lock);
} else {
BKE_reportf(reports, RPT_ERROR, "Scene not in context, couldn't get save parameters");
}
@@ -127,30 +131,45 @@ static void rna_Image_update(Image *image, ReportList *reports)
IMB_rect_from_float(ibuf);
}
-static void rna_Image_gl_load(Image *image, ReportList *reports)
+static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int mag)
{
ImBuf *ibuf;
unsigned int *bind = &image->bindcode;
+ int error = GL_NO_ERROR;
if(*bind)
- return;
+ return error;
ibuf= BKE_image_get_ibuf(image, NULL);
- if(ibuf == NULL || ibuf->rect == NULL) {
+ if(ibuf == NULL || ibuf->rect == NULL ) {
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2);
- return;
+ return (int)GL_INVALID_OPERATION;
}
/* could be made into a function? */
- glGenTextures( 1, ( GLuint * ) bind );
- glBindTexture( GL_TEXTURE_2D, *bind );
-
- gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
+ glGenTextures(1, (GLuint*)bind);
+ glBindTexture(GL_TEXTURE_2D, *bind);
+
+ if (filter != GL_NEAREST && filter != GL_LINEAR)
+ error = (int)gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_INT, ibuf->rect);
+
+ if (!error) {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, image->tpageflag & IMA_CLAMP_U ? GL_CLAMP : GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, image->tpageflag & IMA_CLAMP_V ? GL_CLAMP : GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (GLint)filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (GLint)mag);
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
+ error = (int)glGetError();
+ }
+
+ if (error) {
+ glDeleteTextures(1, (GLuint*)bind);
+ image->bindcode = 0;
+ }
+
+ return error;
}
static void rna_Image_gl_free(Image *image)
@@ -171,7 +190,7 @@ void RNA_api_image(StructRNA *srna)
func= RNA_def_function(srna, "save_render", "rna_Image_save_render");
RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_string(func, "path", "", 0, "", "Save path.");
+ parm= RNA_def_string(func, "filepath", "", 0, "", "Save path.");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from");
@@ -189,6 +208,11 @@ void RNA_api_image(StructRNA *srna)
func= RNA_def_function(srna, "gl_load", "rna_Image_gl_load");
RNA_def_function_ui_description(func, "Load the image into OpenGL graphics memory");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter", "The texture minifying function", -INT_MAX, INT_MAX);
+ parm= RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification", "The texture magnification function", -INT_MAX, INT_MAX);
+ /* return value */
+ parm= RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX);
+ RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "gl_free", "rna_Image_gl_free");
RNA_def_function_ui_description(func, "Free the image from OpenGL graphics memory");
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 433d5ff2904..669fc5d3871 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -34,6 +34,7 @@
struct ID;
struct IDProperty;
struct SDNA;
+struct Sequence;
/* Data structures used during define */
@@ -188,9 +189,9 @@ void rna_ID_name_get(struct PointerRNA *ptr, char *value);
int rna_ID_name_length(struct PointerRNA *ptr);
void rna_ID_name_set(struct PointerRNA *ptr, const char *value);
struct StructRNA *rna_ID_refine(struct PointerRNA *ptr);
-struct IDProperty *rna_ID_idproperties(struct PointerRNA *ptr, int create);
+struct IDProperty *rna_ID_idprops(struct PointerRNA *ptr, int create);
void rna_ID_fake_user_set(struct PointerRNA *ptr, int value);
-struct IDProperty *rna_IDPropertyGroup_idproperties(struct PointerRNA *ptr, int create);
+struct IDProperty *rna_IDPropertyGroup_idprops(struct PointerRNA *ptr, int create);
void rna_IDPropertyGroup_unregister(const struct bContext *C, struct StructRNA *type);
struct StructRNA *rna_IDPropertyGroup_register(const struct bContext *C, struct ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free);
struct StructRNA* rna_IDPropertyGroup_refine(struct PointerRNA *ptr);
@@ -204,11 +205,19 @@ void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, ch
PointerRNA rna_object_shapekey_index_get(struct ID *id, int value);
int rna_object_shapekey_index_set(struct ID *id, PointerRNA value, int current);
-void rna_Object_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
-void rna_Object_update_data(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
+/* named internal so as not to conflict with obj.update() rna func */
+void rna_Object_internal_update_data(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
void rna_Mesh_update_draw(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
void rna_TextureSlot_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
+/* basic poll functions for object types */
+int rna_Armature_object_poll(struct PointerRNA *ptr, struct PointerRNA value);
+int rna_Camera_object_poll(struct PointerRNA *ptr, struct PointerRNA value);
+int rna_Curve_object_poll(struct PointerRNA *ptr, struct PointerRNA value);
+int rna_Lattice_object_poll(struct PointerRNA *ptr, struct PointerRNA value);
+int rna_Mesh_object_poll(struct PointerRNA *ptr, struct PointerRNA value);
+
+
char *rna_TextureSlot_path(struct PointerRNA *ptr);
/* API functions */
@@ -227,12 +236,17 @@ 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_object_base(struct StructRNA *srna);
void RNA_api_pose_channel(struct StructRNA *srna);
void RNA_api_scene(struct StructRNA *srna);
void RNA_api_scene_render(struct StructRNA *srna);
+void RNA_api_sequence_strip(StructRNA *srna);
void RNA_api_text(struct StructRNA *srna);
void RNA_api_ui_layout(struct StructRNA *srna);
void RNA_api_wm(struct StructRNA *srna);
+void RNA_api_sensor(struct StructRNA *srna);
+void RNA_api_controller(struct StructRNA *srna);
+void RNA_api_actuator(struct StructRNA *srna);
/* main collection functions */
void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop);
@@ -249,7 +263,7 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop);
-void RNA_def_main_vfonts(BlenderRNA *brna, PropertyRNA *cprop);
+void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop);
@@ -338,6 +352,7 @@ PointerRNA rna_pointer_inherit_refine(struct PointerRNA *ptr, struct StructRNA *
int rna_parameter_size(struct PropertyRNA *parm);
int rna_parameter_size_alloc(struct PropertyRNA *parm);
+
#endif /* RNA_INTERNAL_H */
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index 7737d6094bc..216533a8708 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -87,6 +87,7 @@ typedef EnumPropertyItem *(*PropEnumItemFunc)(struct bContext *C, struct Pointer
typedef PointerRNA (*PropPointerGetFunc)(struct PointerRNA *ptr);
typedef StructRNA* (*PropPointerTypeFunc)(struct PointerRNA *ptr);
typedef void (*PropPointerSetFunc)(struct PointerRNA *ptr, const PointerRNA value);
+typedef int (*PropPointerPollFunc)(struct PointerRNA *ptr, const PointerRNA value);
typedef void (*PropCollectionBeginFunc)(struct CollectionPropertyIterator *iter, struct PointerRNA *ptr);
typedef void (*PropCollectionNextFunc)(struct CollectionPropertyIterator *iter);
typedef void (*PropCollectionEndFunc)(struct CollectionPropertyIterator *iter);
@@ -257,6 +258,7 @@ typedef struct PointerPropertyRNA {
PropPointerGetFunc get;
PropPointerSetFunc set;
PropPointerTypeFunc typef;
+ PropPointerPollFunc poll; /* unlike operators, 'set' can still run if poll fails, used for filtering display */
struct StructRNA *type;
} PointerPropertyRNA;
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index 7e9aebeffa4..970c825d30b 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -363,13 +363,13 @@ static void rna_def_keydata(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "handle_1_co", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_1_co_get", "rna_ShapeKeyBezierPoint_handle_1_co_set", NULL);
RNA_def_property_ui_text(prop, "Handle 1 Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "handle_2_co", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_2_co_get", "rna_ShapeKeyBezierPoint_handle_2_co_set", NULL);
RNA_def_property_ui_text(prop, "Handle 2 Location", "");
@@ -433,7 +433,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
prop= RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ShapeKey");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", "rna_ShapeKey_relative_key_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", "rna_ShapeKey_relative_key_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
@@ -488,7 +488,7 @@ static void rna_def_key(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "from");
RNA_def_property_ui_text(prop, "User", "Datablock using these shape keys");
- prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", KEY_RELATIVE);
RNA_def_property_ui_text(prop, "Relative", "Makes shape keys relative");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index fb5242f64f4..c6660450914 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -159,7 +159,7 @@ static void rna_def_lamp_mtex(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Lamp Texture Slot", "Texture slot for textures in a Lamp datablock");
- prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
@@ -170,12 +170,12 @@ static void rna_def_lamp_mtex(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates");
- prop= RNA_def_property(srna, "map_color", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "map_shadow", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
@@ -275,6 +275,7 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
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_range(prop, 2.0f, 10.0f, 1, 2);
RNA_def_property_ui_text(prop, "Atmosphere Turbidity", "Sky turbidity");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
@@ -361,22 +362,22 @@ static void rna_def_lamp(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Color", "Light color");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_own_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, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
@@ -411,7 +412,7 @@ static void rna_def_lamp_falloff(StructRNA *srna)
RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "sphere", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_draw_update");
@@ -419,13 +420,13 @@ static void rna_def_lamp_falloff(StructRNA *srna)
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_ui_text(prop, "Linear Attenuation", "Linear distance attenuation");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_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_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attenuation");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
}
@@ -467,12 +468,12 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
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);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_ray_sampling_method", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "shadow_ray_sample_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");
@@ -504,7 +505,7 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows)");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_layer", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
@@ -540,17 +541,17 @@ static void rna_def_area_lamp(BlenderRNA *brna)
rna_def_lamp_shadow(srna, 0, 1);
- prop= RNA_def_property(srna, "umbra", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "dither", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "jitter", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
@@ -612,12 +613,12 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
rna_def_lamp_falloff(srna);
rna_def_lamp_shadow(srna, 1, 0);
- prop= RNA_def_property(srna, "square", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_update");
@@ -707,12 +708,12 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Shadow Buffer Type", "Type of shadow buffer");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "auto_clip_start", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "auto_clip_end", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Lamp_draw_update");
@@ -740,7 +741,7 @@ static void rna_def_sun_lamp(BlenderRNA *brna)
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_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Sky Settings", "Sky related settings for sun lamps");
rna_def_lamp_sky_settings(brna);
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c
index e56cb2659f7..f27a1ef86c0 100644
--- a/source/blender/makesrna/intern/rna_lattice.c
+++ b/source/blender/makesrna/intern/rna_lattice.c
@@ -41,6 +41,7 @@
#include "BKE_depsgraph.h"
#include "BKE_lattice.h"
#include "BKE_main.h"
+#include "BKE_deform.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -78,8 +79,8 @@ static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRN
Lattice *lt= (Lattice*)ptr->data;
int tot= lt->pntsu*lt->pntsv*lt->pntsw;
- if(lt->editlatt && lt->editlatt->def)
- rna_iterator_array_begin(iter, (void*)lt->editlatt->def, sizeof(BPoint), tot, 0, NULL);
+ if(lt->editlatt && lt->editlatt->latt->def)
+ rna_iterator_array_begin(iter, (void*)lt->editlatt->latt->def, sizeof(BPoint), tot, 0, NULL);
else if(lt->def)
rna_iterator_array_begin(iter, (void*)lt->def, sizeof(BPoint), tot, 0, NULL);
else
@@ -110,7 +111,7 @@ static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
if(ob->data == lt) {
resizelattice(lt, newu, newv, neww, ob);
if(lt->editlatt)
- resizelattice(lt->editlatt, newu, newv, neww, ob);
+ resizelattice(lt->editlatt->latt, newu, newv, neww, ob);
break;
}
}
@@ -119,13 +120,13 @@ static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
if(!ob) {
resizelattice(lt, newu, newv, neww, NULL);
if(lt->editlatt)
- resizelattice(lt->editlatt, newu, newv, neww, NULL);
+ resizelattice(lt->editlatt->latt, newu, newv, neww, NULL);
}
rna_Lattice_update_data(bmain, scene, ptr);
}
-static void rna_Lattice_outside_set(PointerRNA *ptr, int value)
+static void rna_Lattice_use_outside_set(PointerRNA *ptr, int value)
{
Lattice *lt= ptr->data;
@@ -135,28 +136,51 @@ static void rna_Lattice_outside_set(PointerRNA *ptr, int value)
outside_lattice(lt);
if(lt->editlatt) {
- if(value) lt->editlatt->flag |= LT_OUTSIDE;
- else lt->editlatt->flag &= ~LT_OUTSIDE;
+ if(value) lt->editlatt->latt->flag |= LT_OUTSIDE;
+ else lt->editlatt->latt->flag &= ~LT_OUTSIDE;
- outside_lattice(lt->editlatt);
+ outside_lattice(lt->editlatt->latt);
}
}
+static int rna_Lattice_size_editable(PointerRNA *ptr)
+{
+ Lattice *lt= (Lattice*)ptr->data;
+
+ return lt->key == NULL;
+}
+
static void rna_Lattice_points_u_set(PointerRNA *ptr, int value)
{
- ((Lattice*)ptr->data)->opntsu= CLAMPIS(value, 1, 64);
+ Lattice *lt= (Lattice*)ptr->data;
+
+ lt->opntsu= CLAMPIS(value, 1, 64);
}
static void rna_Lattice_points_v_set(PointerRNA *ptr, int value)
{
- ((Lattice*)ptr->data)->opntsv= CLAMPIS(value, 1, 64);
+ Lattice *lt= (Lattice*)ptr->data;
+
+ lt->opntsv= CLAMPIS(value, 1, 64);
}
static void rna_Lattice_points_w_set(PointerRNA *ptr, int value)
{
- ((Lattice*)ptr->data)->opntsw= CLAMPIS(value, 1, 64);
+ Lattice *lt= (Lattice*)ptr->data;
+
+ lt->opntsw= CLAMPIS(value, 1, 64);
}
+static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value)
+{
+ Lattice *lt= ptr->data;
+ strcpy(lt->vgroup, value);
+
+ if(lt->editlatt)
+ strcpy(lt->editlatt->latt->vgroup, value);
+}
+
+
#else
static void rna_def_latticepoint(BlenderRNA *brna)
@@ -174,7 +198,7 @@ static void rna_def_latticepoint(BlenderRNA *brna)
RNA_def_property_float_funcs(prop, "rna_LatticePoint_co_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Location", "");
- prop= RNA_def_property(srna, "deformed_co", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "co_deform", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Deformed Location", "");
@@ -205,22 +229,25 @@ static void rna_def_lattice(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "pntsu");
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_u_set", NULL);
RNA_def_property_range(prop, 1, 64);
- RNA_def_property_ui_text(prop, "U", "Points in U direction");
+ RNA_def_property_ui_text(prop, "U", "Points in U direction (can't be changed when there are shape keys)");
RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
+ RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
prop= RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pntsv");
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_v_set", NULL);
RNA_def_property_range(prop, 1, 64);
- RNA_def_property_ui_text(prop, "V", "Points in V direction");
+ RNA_def_property_ui_text(prop, "V", "Points in V direction (can't be changed when there are shape keys)");
RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
+ RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
prop= RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pntsw");
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_w_set", NULL);
RNA_def_property_range(prop, 1, 64);
- RNA_def_property_ui_text(prop, "W", "Points in W direction");
+ RNA_def_property_ui_text(prop, "W", "Points in W direction (can't be changed when there are shape keys)");
RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
+ RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
prop= RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "typeu");
@@ -240,11 +267,17 @@ static void rna_def_lattice(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Interpolation Type W", "");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
- prop= RNA_def_property(srna, "outside", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_outside", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_outside_set");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_use_outside_set");
RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
+
+ prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "vgroup");
+ RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group to apply the influence of the lattice");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Lattice_vg_name_set");
+ RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "key");
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index 7a680e00c8b..b59f23d3e1f 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -50,21 +50,25 @@ static void rna_Main_debug_set(PointerRNA *ptr, const int value)
G.f &= ~G_DEBUG;
}
+static int rna_Main_is_dirty_get(PointerRNA *ptr)
+{
+ return !G.relbase_valid;
+}
-static void rna_Main_filename_get(PointerRNA *ptr, char *value)
+static void rna_Main_filepath_get(PointerRNA *ptr, char *value)
{
Main *bmain= (Main*)ptr->data;
BLI_strncpy(value, bmain->name, sizeof(bmain->name));
}
-static int rna_Main_filename_length(PointerRNA *ptr)
+static int rna_Main_filepath_length(PointerRNA *ptr)
{
Main *bmain= (Main*)ptr->data;
return strlen(bmain->name);
}
#if 0
-static void rna_Main_filename_set(PointerRNA *ptr, const char *value)
+static void rna_Main_filepath_set(PointerRNA *ptr, const char *value)
{
Main *bmain= (Main*)ptr->data;
BLI_strncpy(bmain->name, value, sizeof(bmain->name));
@@ -143,13 +147,11 @@ static void rna_Main_camera_begin(CollectionPropertyIterator *iter, PointerRNA *
rna_iterator_listbase_begin(iter, &bmain->camera, NULL);
}
-#if 0
static void rna_Main_key_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Main *bmain= (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->key, NULL);
}
-#endif
static void rna_Main_world_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
@@ -169,7 +171,7 @@ static void rna_Main_script_begin(CollectionPropertyIterator *iter, PointerRNA *
rna_iterator_listbase_begin(iter, &bmain->script, NULL);
}
-static void rna_Main_vfont_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+static void rna_Main_font_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Main *bmain= (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->vfont, NULL);
@@ -267,6 +269,7 @@ void RNA_def_main(BlenderRNA *brna)
PropertyRNA *prop;
CollectionDefFunc *func;
+ /* plural must match idtypes in readblenentry.c */
MainCollectionDef lists[]= {
{"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks.", RNA_def_main_cameras},
{"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks.", RNA_def_main_scenes},
@@ -282,19 +285,19 @@ void RNA_def_main(BlenderRNA *brna)
{"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks.", RNA_def_main_lattices},
{"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks.", RNA_def_main_curves} ,
{"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks.", RNA_def_main_metaballs},
- {"vfonts", "VectorFont", "rna_Main_vfont_begin", "Vector Fonts", "Vector font datablocks.", RNA_def_main_vfonts},
+ {"fonts", "VectorFont", "rna_Main_font_begin", "Vector Fonts", "Vector font datablocks.", RNA_def_main_fonts},
{"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks.", RNA_def_main_textures},
{"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks.", RNA_def_main_brushes},
{"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", RNA_def_main_worlds},
{"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", RNA_def_main_groups},
-/* {"keys", "Key", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL}, */
+ {"shape_keys", "Key", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL},
{"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED).", NULL},
{"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", RNA_def_main_texts},
{"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", RNA_def_main_sounds},
{"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", RNA_def_main_armatures},
{"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", RNA_def_main_actions},
{"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", RNA_def_main_particles},
- {"gpencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks.", RNA_def_main_gpencil},
+ {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks.", RNA_def_main_gpencil},
{NULL, NULL, NULL, NULL, NULL, NULL}};
int i;
@@ -303,11 +306,16 @@ void RNA_def_main(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Main", "Main data structure representing a .blend file and all its datablocks");
RNA_def_struct_ui_icon(srna, ICON_BLENDER);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_maxlength(prop, 240);
- RNA_def_property_string_funcs(prop, "rna_Main_filename_get", "rna_Main_filename_length", "rna_Main_filename_set");
+ RNA_def_property_string_funcs(prop, "rna_Main_filepath_get", "rna_Main_filepath_length", "rna_Main_filepath_set");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file");
+
+ prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_Main_is_dirty_get", NULL);
+ RNA_def_property_ui_text(prop, "File is Saved", "Has the current session been saved to disk as a .blend file");
prop= RNA_def_property(srna, "debug", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Main_debug_get", "rna_Main_debug_set");
@@ -335,7 +343,7 @@ void RNA_def_main(BlenderRNA *brna)
prop= RNA_def_property(srna, "test", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Test");
- RNA_def_property_pointer_funcs(prop, "rna_Test_test_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Test_test_get", NULL, NULL, NULL);
RNA_define_verify_sdna(1);
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index d70962568e5..72ed625e5aa 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <errno.h>
#include "RNA_define.h"
#include "RNA_access.h"
@@ -50,6 +51,13 @@
#include "BKE_text.h"
#include "BKE_action.h"
#include "BKE_group.h"
+#include "BKE_brush.h"
+#include "BKE_lattice.h"
+#include "BKE_mball.h"
+#include "BKE_world.h"
+#include "BKE_particle.h"
+#include "BKE_font.h"
+#include "BKE_node.h"
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
@@ -61,6 +69,13 @@
#include "DNA_text_types.h"
#include "DNA_texture_types.h"
#include "DNA_group_types.h"
+#include "DNA_brush_types.h"
+#include "DNA_lattice_types.h"
+#include "DNA_meta_types.h"
+#include "DNA_world_types.h"
+#include "DNA_particle_types.h"
+#include "DNA_vfont_types.h"
+#include "DNA_node_types.h"
#include "ED_screen.h"
@@ -190,6 +205,23 @@ void rna_Main_materials_remove(Main *bmain, ReportList *reports, struct Material
/* XXX python now has invalid pointer? */
}
+// XXX, commended for now, need to see how this can be used with node groups.
+struct bNodeTree *rna_Main_nodetree_new(Main *bmain, int type)
+{
+ bNodeTree *tree = ntreeAddTree(type);
+ tree->id.us--;
+ return tree;
+}
+void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, struct bNodeTree *tree)
+{
+ if(ID_REAL_USERS(tree) <= 0)
+ free_libblock(&bmain->nodetree, tree);
+ else
+ BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d.", tree->id.name+2, ID_REAL_USERS(tree));
+
+ /* XXX python now has invalid pointer? */
+}
+
Mesh *rna_Main_meshes_new(Main *bmain, char* name)
{
Mesh *me= add_mesh(name);
@@ -222,16 +254,24 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
/* XXX python now has invalid pointer? */
}
-Image *rna_Main_images_new(Main *bmain, char* name, int width, int height, int float_buffer)
+Image *rna_Main_images_new(Main *bmain, char* name, int width, int height, int alpha, int float_buffer)
{
float color[4]= {0.0, 0.0, 0.0, 1.0};
- Image *image= BKE_add_image_size(width, height, name, float_buffer, 0, color);
+ Image *image= BKE_add_image_size(width, height, name, alpha ? 32:24, float_buffer, 0, color);
image->id.us--;
return image;
}
-Image *rna_Main_images_load(Main *bmain, char *filename)
+Image *rna_Main_images_load(Main *bmain, ReportList *reports, char *filepath)
{
- return BKE_add_image_file(filename, 0);
+ Image *ima;
+
+ errno= 0;
+ ima= BKE_add_image_file(filepath, 0);
+
+ if(!ima)
+ BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported image format");
+
+ return ima;
}
void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
{
@@ -243,6 +283,20 @@ void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
/* XXX python now has invalid pointer? */
}
+Lattice *rna_Main_lattices_new(Main *bmain, char* name)
+{
+ Lattice *lt= add_lattice(name);
+ lt->id.us--;
+ return lt;
+}
+void rna_Main_lattices_remove(Main *bmain, ReportList *reports, struct Lattice *lt)
+{
+ if(ID_REAL_USERS(lt) <= 0)
+ free_libblock(&bmain->latt, lt);
+ else
+ BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d.", lt->id.name+2, ID_REAL_USERS(lt));
+}
+
Curve *rna_Main_curves_new(Main *bmain, char* name, int type)
{
Curve *cu= add_curve(name, type);
@@ -257,9 +311,47 @@ void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu)
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d.", cu->id.name+2, ID_REAL_USERS(cu));
}
-Tex *rna_Main_textures_new(Main *bmain, char* name)
+MetaBall *rna_Main_metaballs_new(Main *bmain, char* name)
+{
+ MetaBall *mb= add_mball(name);
+ mb->id.us--;
+ return mb;
+}
+void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall *mb)
+{
+ if(ID_REAL_USERS(mb) <= 0)
+ free_libblock(&bmain->mball, mb);
+ else
+ BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d.", mb->id.name+2, ID_REAL_USERS(mb));
+}
+
+VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, char *filepath)
+{
+ VFont *font;
+
+ errno= 0;
+ font= load_vfont(filepath);
+
+ if(!font)
+ BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported font format");
+
+ return font;
+
+}
+void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont)
+{
+ if(ID_REAL_USERS(vfont) <= 0)
+ free_libblock(&bmain->vfont, vfont);
+ else
+ BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d.", vfont->id.name+2, ID_REAL_USERS(vfont));
+
+ /* XXX python now has invalid pointer? */
+}
+
+Tex *rna_Main_textures_new(Main *bmain, char* name, int type)
{
Tex *tex= add_texture(name);
+ tex_set_type(tex, type);
tex->id.us--;
return tex;
}
@@ -271,6 +363,34 @@ void rna_Main_textures_remove(Main *bmain, ReportList *reports, struct Tex *tex)
BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d.", tex->id.name+2, ID_REAL_USERS(tex));
}
+Brush *rna_Main_brushes_new(Main *bmain, char* name)
+{
+ Brush *brush = add_brush(name);
+ brush->id.us--;
+ return brush;
+}
+void rna_Main_brushes_remove(Main *bmain, ReportList *reports, struct Brush *brush)
+{
+ if(ID_REAL_USERS(brush) <= 0)
+ free_libblock(&bmain->brush, brush);
+ else
+ BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d.", brush->id.name+2, ID_REAL_USERS(brush));
+}
+
+World *rna_Main_worlds_new(Main *bmain, char* name)
+{
+ World *world = add_world(name);
+ world->id.us--;
+ return world;
+}
+void rna_Main_worlds_remove(Main *bmain, ReportList *reports, struct World *world)
+{
+ if(ID_REAL_USERS(world) <= 0)
+ free_libblock(&bmain->world, world);
+ else
+ BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d.", world->id.name+2, ID_REAL_USERS(world));
+}
+
Group *rna_Main_groups_new(Main *bmain, char* name)
{
return add_group(name);
@@ -278,7 +398,6 @@ Group *rna_Main_groups_new(Main *bmain, char* name)
void rna_Main_groups_remove(Main *bmain, ReportList *reports, Group *group)
{
unlink_group(group);
- group->id.us= 0;
free_libblock(&bmain->group, group);
/* XXX python now has invalid pointer? */
}
@@ -293,11 +412,16 @@ void rna_Main_texts_remove(Main *bmain, ReportList *reports, Text *text)
free_libblock(&bmain->text, text);
/* XXX python now has invalid pointer? */
}
-Text *rna_Main_texts_load(Main *bmain, ReportList *reports, char* path)
+
+Text *rna_Main_texts_load(Main *bmain, ReportList *reports, char* filepath)
{
- Text *txt= add_text(path, bmain->name);
- if(txt==NULL)
- BKE_reportf(reports, RPT_ERROR, "Couldn't load text from path \"%s\".", path);
+ Text *txt;
+
+ errno= 0;
+ txt= add_text(filepath, bmain->name);
+
+ if(!txt)
+ BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to load text");
return txt;
}
@@ -335,6 +459,22 @@ void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act)
/* XXX python now has invalid pointer? */
}
+ParticleSettings *rna_Main_particles_new(Main *bmain, char* name)
+{
+ ParticleSettings *part = psys_new_settings(name, bmain);
+ part->id.us--;
+ return part;
+}
+void rna_Main_particles_remove(Main *bmain, ReportList *reports, ParticleSettings *part)
+{
+ if(ID_REAL_USERS(part) <= 0)
+ free_libblock(&bmain->particle, part);
+ else
+ BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d.", part->id.name+2, ID_REAL_USERS(part));
+
+ /* XXX python now has invalid pointer? */
+}
+
#else
void RNA_api_main(StructRNA *srna)
@@ -348,7 +488,7 @@ void RNA_api_main(StructRNA *srna)
/*
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.");
+ parm= RNA_def_string(func, "filepath", "", 0, "", "File path 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);
@@ -378,7 +518,7 @@ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a camera from the current blendfile.");
parm= RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
@@ -401,10 +541,9 @@ void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_function_ui_description(func, "Remove a scene from the current blendfile.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
@@ -430,10 +569,10 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_objects_remove");
+ RNA_def_function_ui_description(func, "Remove a object from the current blendfile.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_function_ui_description(func, "Remove a object from the current blendfile.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
@@ -458,11 +597,39 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a material from the current blendfile.");
parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
{
+ StructRNA *srna;
+// FunctionRNA *func;
+// PropertyRNA *parm;
+
+/* static EnumPropertyItem node_nodetree_items[] = {
+ {0, "SHADER", 0, "Shader", ""},
+ {1, "COMPOSITE", 0, "Composite", ""},
+ {2, "TEXTURE", 0, "Texture", ""},
+ {0, NULL, 0, NULL, NULL}}; */
+
+ RNA_def_property_srna(cprop, "MainNodeTrees");
+ srna= RNA_def_struct(brna, "MainNodeTrees", NULL);
+ RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees");
+
+#if 0 // need to see some examples of using these functions before enabling.
+ func= RNA_def_function(srna, "new", "rna_Main_nodetree_new");
+ RNA_def_function_ui_description(func, "Add a new node tree to the main database");
+ parm= RNA_def_enum(func, "type", node_nodetree_items, 0, "Type", "The type of curve object to add");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock.");
+ RNA_def_function_return(func, parm);
+ func= RNA_def_function(srna, "remove", "rna_Main_nodetree_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile.");
+ parm= RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+#endif
}
void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -486,7 +653,7 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile.");
parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -510,7 +677,7 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile.");
parm= RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -540,14 +707,16 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image.", 0, INT_MAX);
parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image.", 0, INT_MAX);
+ parm= RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel");
parm= RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color");
/* return type */
parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "load", "rna_Main_images_load");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Load a new image into the main database");
- parm= RNA_def_string(func, "filename", "File Name", 0, "", "path of the file to load.");
+ parm= RNA_def_string(func, "filepath", "File Path", 0, "", "path of the file to load.");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
@@ -557,12 +726,32 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove an image from the current blendfile.");
parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+ RNA_def_property_srna(cprop, "MainLattices");
+ srna= RNA_def_struct(brna, "MainLattices", NULL);
+ RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
+
+ func= RNA_def_function(srna, "new", "rna_Main_lattices_new");
+ RNA_def_function_ui_description(func, "Add a new lattice to the main database");
+ parm= RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_Main_lattices_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile.");
+ parm= RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -578,7 +767,7 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Add a new curve to the main database");
parm= RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock.");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve object to add");
+ parm= RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
parm= RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock.");
@@ -588,15 +777,56 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a curve from the current blendfile.");
parm= RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "MainMetaBalls");
+ srna= RNA_def_struct(brna, "MainMetaBalls", NULL);
+ RNA_def_struct_ui_text(srna, "Main MetaBall", "Collection of metaballs");
+ func= RNA_def_function(srna, "new", "rna_Main_metaballs_new");
+ RNA_def_function_ui_description(func, "Add a new metaball to the main database");
+ parm= RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_Main_metaballs_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile.");
+ parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
-void RNA_def_main_vfonts(BlenderRNA *brna, PropertyRNA *cprop)
+void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "MainFonts");
+ srna= RNA_def_struct(brna, "MainFonts", NULL);
+ RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
+
+ func= RNA_def_function(srna, "load", "rna_Main_fonts_load");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Load a new font into the main database");
+ parm= RNA_def_string(func, "filepath", "File Path", 0, "", "path of the font to load.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock.");
+ RNA_def_function_return(func, parm);
+ func= RNA_def_function(srna, "remove", "rna_Main_fonts_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a font from the current blendfile.");
+ parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -612,6 +842,8 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Add a new texture to the main database");
parm= RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock.");
RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_enum(func, "type", texture_type_items, 0, "Type", "The type of texture to add");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock.");
RNA_def_function_return(func, parm);
@@ -620,16 +852,58 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a texture from the current blendfile.");
parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "MainBrushes");
+ srna= RNA_def_struct(brna, "MainBrushes", NULL);
+ RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
+
+ func= RNA_def_function(srna, "new", "rna_Main_brushes_new");
+ RNA_def_function_ui_description(func, "Add a new brush to the main database");
+ parm= RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock.");
+ RNA_def_function_return(func, parm);
+ func= RNA_def_function(srna, "remove", "rna_Main_brushes_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a brush from the current blendfile.");
+ parm= RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
+
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "MainWorlds");
+ srna= RNA_def_struct(brna, "MainWorlds", NULL);
+ RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds");
+ func= RNA_def_function(srna, "new", "rna_Main_worlds_new");
+ RNA_def_function_ui_description(func, "Add a new world to the main database");
+ parm= RNA_def_string(func, "name", "World", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "world", "World", "", "New world datablock.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_Main_worlds_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a world from the current blendfile.");
+ parm= RNA_def_pointer(func, "world", "World", "", "World to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
+
void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
@@ -652,7 +926,7 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a group from the current blendfile.");
parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -676,13 +950,13 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a text from the current blendfile.");
parm= RNA_def_pointer(func, "text", "Text", "", "Text to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* load func */
func= RNA_def_function(srna, "load", "rna_Main_texts_load");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
- parm= RNA_def_string(func, "path", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock.");
+ parm= RNA_def_string(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock.");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock.");
@@ -714,7 +988,7 @@ void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a armature from the current blendfile.");
parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -738,11 +1012,31 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a action from the current blendfile.");
parm= RNA_def_pointer(func, "action", "Action", "", "Action to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "MainParticles");
+ srna= RNA_def_struct(brna, "MainParticles", NULL);
+ RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
+
+ func= RNA_def_function(srna, "new", "rna_Main_particles_new");
+ RNA_def_function_ui_description(func, "Add a new particle settings instance to the main database");
+ parm= RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock.");
+ RNA_def_function_return(func, parm);
+ func= RNA_def_function(srna, "remove", "rna_Main_particles_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile.");
+ parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
{
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 4d47737038a..46a89ccce40 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -186,7 +186,7 @@ static void rna_MaterialStrand_end_size_range(PointerRNA *ptr, float *min, float
}
}
-static int rna_MaterialTextureSlot_enabled_get(PointerRNA *ptr)
+static int rna_MaterialTextureSlot_use_get(PointerRNA *ptr)
{
Material *ma= (Material*)ptr->id.data;
MTex *mtex= (MTex*)ptr->data;
@@ -199,7 +199,7 @@ static int rna_MaterialTextureSlot_enabled_get(PointerRNA *ptr)
return 0;
}
-static void rna_MaterialTextureSlot_enabled_set(PointerRNA *ptr, int value)
+static void rna_MaterialTextureSlot_use_set(PointerRNA *ptr, int value)
{
Material *ma= (Material*)ptr->id.data;
MTex *mtex= (MTex*)ptr->data;
@@ -323,7 +323,7 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Material Texture Slot", "Texture slot for textures in a Material datablock");
- prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Material_texture_coordinates_itemf");
@@ -342,99 +342,99 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "UV Layer", "UV layer to use for mapping with UV texture coordinates");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "from_dupli", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "from_original", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_colordiff", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_map_color_diffuse", 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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_normal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_colorspec", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_map_color_spec", 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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_mirror", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_specular", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_ambient", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_hardness", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_raymir", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_emit", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_translucency", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_displacement", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_warp", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "x_mapping", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mapping_x", 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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "y_mapping", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mapping_y", 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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "z_mapping", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "mapping_z", 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", "");
@@ -469,13 +469,13 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Warp Factor", "Amount texture affects texture coordinates of next channels");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "colorspec_factor", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "specular_color_factor", PROP_FLOAT, PROP_NONE);
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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "colordiff_factor", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "diffuse_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, "Diffuse Color Factor", "Amount texture affects diffuse color");
@@ -536,54 +536,54 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Material_update");
/* volume material */
- prop= RNA_def_property(srna, "map_coloremission", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_map_color_emission", 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 color of emission");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_colorreflection", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_map_color_reflection", 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);
+ prop= RNA_def_property(srna, "use_map_color_transmission", 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);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_emission", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_scattering", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_map_scatter", 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);
+ prop= RNA_def_property(srna, "use_map_reflect", 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);
+ prop= RNA_def_property(srna, "color_emission_factor", PROP_FLOAT, PROP_NONE);
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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "colorreflection_factor", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "reflection_color_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, "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);
+ prop= RNA_def_property(srna, "transmission_color_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");
@@ -615,14 +615,14 @@ static void rna_def_material_mtex(BlenderRNA *brna)
/* 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");
+ prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_MaterialTextureSlot_use_get", "rna_MaterialTextureSlot_use_set");
RNA_def_property_ui_text(prop, "Enabled", "Enable this material texture slot");
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)");
+ prop= RNA_def_property(srna, "use_old_bump", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "texflag", MTEX_NEW_BUMP);
+ RNA_def_property_ui_text(prop, "Old Bump", "Use old bump mapping (backwards compatibility option)");
RNA_def_property_update(prop, 0, "rna_Material_update");
}
@@ -799,7 +799,7 @@ static void rna_def_material_diffuse(StructRNA *srna)
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_ui_text(prop, "Diffuse Fresnel Factor", "Blending factor of Fresnel");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "darkness", PROP_FLOAT, PROP_NONE);
@@ -823,7 +823,7 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Raytrace Mirror", "Raytraced reflection settings for a Material datablock");
- prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use", 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, 0, "rna_Material_update");
@@ -870,7 +870,7 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
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");
@@ -935,7 +935,7 @@ static void rna_def_material_raytra(BlenderRNA *brna)
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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
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");
@@ -947,7 +947,7 @@ static void rna_def_material_raytra(BlenderRNA *brna)
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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "limit", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "depth_max", 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)");
@@ -984,7 +984,7 @@ static void rna_def_material_volume(BlenderRNA *brna)
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Volume", "Volume rendering settings for a Material datablock");
- prop= RNA_def_property(srna, "step_calculation", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "step_method", PROP_ENUM, PROP_NONE);
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");
@@ -997,18 +997,18 @@ static void rna_def_material_volume(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Step Size", "Distance between subsequent volume depth samples");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "lighting_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "light_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shade_type");
RNA_def_property_enum_items(prop, prop_lighting_items);
RNA_def_property_ui_text(prop, "Lighting Mode", "Method of shading, attenuating, and scattering light through the volume");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "external_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_external_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_RECV_EXT_SHADOW); /* use bitflags */
RNA_def_property_ui_text(prop, "External Shadows", "Receive shadows from sources outside the volume (temporary)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "light_cache", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
@@ -1038,7 +1038,7 @@ static void rna_def_material_volume(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Intensity", "Multiplier for multiple scattered light energy");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "depth_cutoff", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "depth_threshold", 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");
@@ -1132,19 +1132,19 @@ static void rna_def_material_halo(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Add", "Sets the strength of the add effect");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "rings", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "ring_count", 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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "line_number", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "line_count", 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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "star_tips", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "star_tip_count", 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");
@@ -1156,7 +1156,7 @@ static void rna_def_material_halo(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Seed", "Randomizes ring dimension and line location");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "flare_mode", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
@@ -1167,7 +1167,7 @@ static void rna_def_material_halo(BlenderRNA *brna)
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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "flare_subsize", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "flare_subflare_size", 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");
@@ -1185,48 +1185,48 @@ static void rna_def_material_halo(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Flare Seed", "Specifies an offset in the flare seed table");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "flares_sub", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "flare_subflare_count", 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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ring", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "lines", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "star", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "texture", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "vertex_normal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "xalpha", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_extreme_alpha", 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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "shaded", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "soft", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
@@ -1254,7 +1254,7 @@ static void rna_def_material_sss(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Color", "Scattering color");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "error_tolerance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "error_threshold", 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)");
@@ -1296,7 +1296,7 @@ static void rna_def_material_sss(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Back", "Back scattering weight");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use", 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, 0, "rna_Material_update");
@@ -1352,7 +1352,7 @@ static void rna_def_material_specularity(StructRNA *srna)
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_ui_text(prop, "Specular Toon Smooth", "Smoothness of specular toon area");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_slope", PROP_FLOAT, PROP_NONE);
@@ -1372,12 +1372,12 @@ static void rna_def_material_strand(BlenderRNA *brna)
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Strand", "Strand settings for a Material datablock");
- prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "surface_diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
@@ -1388,7 +1388,7 @@ static void rna_def_material_strand(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Blend Distance", "Worldspace distance over which to blend in the surface normal");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "blender_units", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
@@ -1407,7 +1407,7 @@ static void rna_def_material_strand(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Tip Size", "End size of strands in pixels or Blender units");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "min_size", PROP_FLOAT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "size_min", 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");
@@ -1441,14 +1441,14 @@ static void rna_def_material_physics(BlenderRNA *brna)
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Physics", "Physics settings for a Material datablock");
- prop= RNA_def_property(srna, "align_to_normal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_normal_align", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dynamode", MA_FH_NOR);
RNA_def_property_ui_text(prop, "Align to Normal", "Align dynamic game objects along the surface normal, when inside the physics distance area");
prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "friction");
RNA_def_property_range(prop, 0, 100);
- RNA_def_property_ui_text(prop, "Friction", "Coulomb friction coeffecient, when inside the physics distance area");
+ RNA_def_property_ui_text(prop, "Friction", "Coulomb friction coefficient, when inside the physics distance area");
prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fh");
@@ -1465,7 +1465,7 @@ static void rna_def_material_physics(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 20);
RNA_def_property_ui_text(prop, "Distance", "Distance of the physics area");
- prop= RNA_def_property(srna, "damp", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xyfrict");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Damping", "Damping of the spring force, when inside the physics distance area");
@@ -1508,7 +1508,7 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_enum_funcs(prop, NULL, "rna_Material_type_set", NULL);
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "transparency", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
@@ -1543,12 +1543,12 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Translucency", "Amount of diffuse shading on the back side");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "cubic", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "object_color", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
@@ -1563,7 +1563,7 @@ 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_FACTOR);
+ prop= RNA_def_property(srna, "shadow_cast_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, in use for Irregular and Deep shadow buffer");
@@ -1578,32 +1578,32 @@ void RNA_def_material(BlenderRNA *brna)
/* flags */
- prop= RNA_def_property(srna, "light_group_exclusive", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "traceable", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_raytrace", 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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "shadows", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "shadeless", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "vertex_color_light", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "vertex_color_paint", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
@@ -1613,7 +1613,7 @@ void RNA_def_material(BlenderRNA *brna)
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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "z_offset", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "offset_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zoffs");
RNA_def_property_ui_text(prop, "Z Offset", "Gives faces an artificial offset in the Z buffer for Z transparency");
RNA_def_property_update(prop, 0, "rna_Material_update");
@@ -1623,57 +1623,57 @@ void RNA_def_material(BlenderRNA *brna)
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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "face_texture", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "face_texture_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "cast_shadows_only", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 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)");
+ prop= RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", MA_NOMIST);
+ RNA_def_property_ui_text(prop, "Use Mist", "Use mist with this material (in world settings)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "receive_transparent_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ray_shadow_bias", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "full_oversampling", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "cast_buffer_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "cast_approximate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cast_approximate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_APPROX_OCCLUSION);
RNA_def_property_ui_text(prop, "Cast Approximate", "Allow this material to cast shadows when using approximate ambient occlusion.");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Material_update");
@@ -1682,13 +1682,13 @@ void RNA_def_material(BlenderRNA *brna)
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_pointer_funcs(prop, "rna_Material_mirror_get", NULL, 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_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_pointer_funcs(prop, "rna_Material_transp_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Raytrace Transparency", "Raytraced transparency settings for the material");
prop= RNA_def_property(srna, "volume", PROP_POINTER, PROP_NONE);
@@ -1700,25 +1700,25 @@ void RNA_def_material(BlenderRNA *brna)
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_pointer_funcs(prop, "rna_Material_halo_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Halo", "Halo settings for the material");
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_pointer_funcs(prop, "rna_Material_sss_get", NULL, 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_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_pointer_funcs(prop, "rna_Material_strand_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Strand", "Strand settings for the material");
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_pointer_funcs(prop, "rna_Material_physics_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Physics", "Game physics settings");
/* nodetree */
@@ -1735,7 +1735,7 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_node_material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_pointer_funcs(prop, "rna_Material_active_node_material_get", "rna_Material_active_node_material_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Material_active_node_material_get", "rna_Material_active_node_material_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Material", "Active node material");
RNA_def_property_update(prop, NC_MATERIAL, NULL);
@@ -1781,7 +1781,7 @@ void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeg
prop= RNA_def_property(srna, "active_texture", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL);
+ RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed");
RNA_def_property_update(prop, 0, update);
diff --git a/source/blender/makesrna/intern/rna_material_api.c b/source/blender/makesrna/intern/rna_material_api.c
index 03eba157bf3..d271b3b374c 100644
--- a/source/blender/makesrna/intern/rna_material_api.c
+++ b/source/blender/makesrna/intern/rna_material_api.c
@@ -42,7 +42,7 @@
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)
+static void rna_Material_add_texture(Material *ma, Tex *tex, int texco, int mapto)
{
int i;
MTex *mtex;
@@ -71,8 +71,8 @@ static void rna_Material_add_texture(Material *ma, Tex *tex, int mapto, int texc
if (tex)
id_us_plus(&tex->id);
- mtex->texco= mapto;
- mtex->mapto= texco;
+ mtex->texco= texco;
+ mtex->mapto= mapto;
}
#else
@@ -119,8 +119,9 @@ void RNA_api_material(StructRNA *srna)
RNA_def_function_ui_description(func, "Add a texture to material's free texture slot.");
parm= RNA_def_pointer(func, "texture", "Texture", "Texture", "Texture to add.");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "texture_coordinates", prop_texture_coordinates_items, TEXCO_UV, "", "Source of texture coordinate information."); /* optional */
+ parm= RNA_def_enum(func, "texture_coords", 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 */
+ RNA_def_property_flag(parm, PROP_ENUM_FLAG);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index ce8001c8ecd..741b5cbab81 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -33,6 +33,8 @@
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
+#include "WM_types.h"
+
#ifdef RNA_RUNTIME
#include "DNA_scene_types.h"
@@ -46,6 +48,8 @@
#include "BKE_mesh.h"
#include "BKE_utildefines.h"
+#include "ED_mesh.h" /* XXX Bad level call */
+
#include "WM_api.h"
#include "WM_types.h"
@@ -53,22 +57,29 @@ static void rna_Mesh_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ID *id= ptr->id.data;
- DAG_id_flush_update(id, OB_RECALC_DATA);
- WM_main_add_notifier(NC_GEOM|ND_DATA, id);
+ /* cheating way for importers to avoid slow updates */
+ if(id->us > 0) {
+ DAG_id_flush_update(id, OB_RECALC_DATA);
+ WM_main_add_notifier(NC_GEOM|ND_DATA, id);
+ }
}
static void rna_Mesh_update_select(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ID *id= ptr->id.data;
-
- WM_main_add_notifier(NC_GEOM|ND_SELECT, id);
+ /* cheating way for importers to avoid slow updates */
+ if(id->us > 0) {
+ WM_main_add_notifier(NC_GEOM|ND_SELECT, id);
+ }
}
void rna_Mesh_update_draw(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ID *id= ptr->id.data;
-
- WM_main_add_notifier(NC_GEOM|ND_DATA, id);
+ /* cheating way for importers to avoid slow updates */
+ if(id->us > 0) {
+ WM_main_add_notifier(NC_GEOM|ND_DATA, id);
+ }
}
static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value)
@@ -224,6 +235,40 @@ static int rna_Mesh_texspace_editable(PointerRNA *ptr)
return (me->texflag & AUTOSPACE)? 0: PROP_EDITABLE;
}
+static void rna_Mesh_texspace_loc_get(PointerRNA *ptr, float *values)
+{
+ Mesh *me= (Mesh *)ptr->data;
+
+ if (!me->bb)
+ tex_space_mesh(me);
+
+ copy_v3_v3(values, me->loc);
+}
+
+static void rna_Mesh_texspace_loc_set(PointerRNA *ptr, const float *values)
+{
+ Mesh *me= (Mesh *)ptr->data;
+
+ copy_v3_v3(me->loc, values);
+}
+
+static void rna_Mesh_texspace_size_get(PointerRNA *ptr, float *values)
+{
+ Mesh *me= (Mesh *)ptr->data;
+
+ if (!me->bb)
+ tex_space_mesh(me);
+
+ copy_v3_v3(values, me->size);
+}
+
+static void rna_Mesh_texspace_size_set(PointerRNA *ptr, const float *values)
+{
+ Mesh *me= (Mesh *)ptr->data;
+
+ copy_v3_v3(me->size, values);
+}
+
static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me= (Mesh*)ptr->id.data;
@@ -458,6 +503,22 @@ static void rna_Mesh_active_uv_texture_index_range(PointerRNA *ptr, int *min, in
*max= MAX2(0, *max);
}
+static PointerRNA rna_Mesh_active_mtface_get(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->data;
+ EditMesh *em= BKE_mesh_get_editmesh(me);
+ MTFace *tf;
+
+ if (em && EM_texFaceCheck(em))
+ {
+ tf = EM_get_active_mtface(em, NULL, NULL, 1);
+
+ return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFace, tf);
+ }
+
+ return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFace, NULL);
+}
+
static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values)
{
MTFace *mtface= (MTFace*)ptr->data;
@@ -527,8 +588,7 @@ static int rna_CustomDataData_numverts(PointerRNA *ptr, int type)
Mesh *me= (Mesh*)ptr->id.data;
CustomData *fdata= rna_mesh_fdata(me);
CustomDataLayer *cdl;
- int a;
- size_t b;
+ int a, b;
for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
if(cdl->type == type) {
@@ -925,8 +985,7 @@ static char *rna_CustomDataData_path(PointerRNA *ptr, char *collection, int type
Mesh *me= (Mesh*)ptr->id.data;
CustomData *fdata= rna_mesh_fdata(me);
CustomDataLayer *cdl;
- int a;
- size_t b;
+ int a, b;
for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
if(cdl->type == type) {
@@ -966,7 +1025,7 @@ static char *rna_MeshIntPropertyLayer_path(PointerRNA *ptr)
static char *rna_MeshIntProperty_path(PointerRNA *ptr)
{
- return rna_CustomDataData_path(ptr, "int_layers", CD_MCOL);
+ return rna_CustomDataData_path(ptr, "layers_int", CD_MCOL);
}
static char *rna_MeshFloatPropertyLayer_path(PointerRNA *ptr)
@@ -976,7 +1035,7 @@ static char *rna_MeshFloatPropertyLayer_path(PointerRNA *ptr)
static char *rna_MeshFloatProperty_path(PointerRNA *ptr)
{
- return rna_CustomDataData_path(ptr, "float_layers", CD_MCOL);
+ return rna_CustomDataData_path(ptr, "layers_float", CD_MCOL);
}
static char *rna_MeshStringPropertyLayer_path(PointerRNA *ptr)
@@ -986,7 +1045,7 @@ static char *rna_MeshStringPropertyLayer_path(PointerRNA *ptr)
static char *rna_MeshStringProperty_path(PointerRNA *ptr)
{
- return rna_CustomDataData_path(ptr, "string_layers", CD_MCOL);
+ return rna_CustomDataData_path(ptr, "layers_string", CD_MCOL);
}
static int rna_Mesh_tot_vert_get(PointerRNA *ptr)
@@ -1005,6 +1064,34 @@ static int rna_Mesh_tot_face_get(PointerRNA *ptr)
return me->edit_mesh ? me->edit_mesh->totfacesel : 0;
}
+static CustomDataLayer *rna_Mesh_vertex_color_new(struct Mesh *me, struct bContext *C, char *name)
+{
+ CustomData *fdata;
+ CustomDataLayer *cdl= NULL;
+ int index;
+
+ if(ED_mesh_color_add(C, NULL, NULL, me, name, FALSE)) {
+ fdata= rna_mesh_fdata(me);
+ index= CustomData_get_named_layer_index(fdata, CD_MCOL, name);
+ cdl= (index == -1)? NULL: &fdata->layers[index];
+ }
+ return cdl;
+}
+
+static CustomDataLayer *rna_Mesh_uv_texture_new(struct Mesh *me, struct bContext *C, char *name)
+{
+ CustomData *fdata;
+ CustomDataLayer *cdl= NULL;
+ int index;
+
+ if(ED_mesh_uv_texture_add(C, NULL, NULL, me, name, FALSE)) {
+ fdata= rna_mesh_fdata(me);
+ index= CustomData_get_named_layer_index(fdata, CD_MTFACE, name);
+ cdl= (index == -1)? NULL: &fdata->layers[index];
+ }
+ return cdl;
+}
+
#else
static void rna_def_mvert_group(BlenderRNA *brna)
@@ -1052,14 +1139,14 @@ static void rna_def_mvert(BlenderRNA *brna)
RNA_def_property_float_funcs(prop, "rna_MeshVertex_normal_get", "rna_MeshVertex_normal_set", NULL);
RNA_def_property_ui_text(prop, "Normal", "Vertex Normal");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
- RNA_def_property_ui_text(prop, "Selected", "");
+ RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
- RNA_def_property_ui_text(prop, "Hidden", "");
+ RNA_def_property_ui_text(prop, "Hide", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE);
@@ -1089,7 +1176,7 @@ static void rna_def_medge(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_MeshEdge_path");
RNA_def_struct_ui_icon(srna, ICON_EDGESEL);
- prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "v1");
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
@@ -1105,34 +1192,32 @@ static void rna_def_medge(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
- RNA_def_property_ui_text(prop, "Selected", "");
+ RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
- RNA_def_property_ui_text(prop, "Hidden", "");
+ RNA_def_property_ui_text(prop, "Hide", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "seam", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_seam", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SEAM);
RNA_def_property_ui_text(prop, "Seam", "Seam edge for UV unwrapping");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "sharp", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_edge_sharp", PROP_BOOLEAN, PROP_NONE);
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);
+ prop= RNA_def_property(srna, "is_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);
+ prop= RNA_def_property(srna, "is_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");
prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
@@ -1153,7 +1238,7 @@ static void rna_def_mface(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_FACESEL);
// XXX allows creating invalid meshes
- prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED);
RNA_def_property_array(prop, 4);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_MeshFace_verts_get_length");
@@ -1161,7 +1246,7 @@ static void rna_def_mface(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "vertices_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");
@@ -1172,17 +1257,17 @@ static void rna_def_mface(BlenderRNA *brna)
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshFace_material_index_range");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FACE_SEL);
- RNA_def_property_ui_text(prop, "Selected", "");
+ RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
- RNA_def_property_ui_text(prop, "Hidden", "");
+ RNA_def_property_ui_text(prop, "Hide", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH);
RNA_def_property_ui_text(prop, "Smooth", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
@@ -1259,83 +1344,84 @@ static void rna_def_mtface(BlenderRNA *brna)
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tpage");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "tex", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_image", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TEX);
RNA_def_property_ui_text(prop, "Tex", "Render face with texture");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "light", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_LIGHT);
RNA_def_property_ui_text(prop, "Light", "Use light for face");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "invisible", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_INVISIBLE);
RNA_def_property_ui_text(prop, "Invisible", "Make face invisible");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "collision", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_DYNAMIC);
RNA_def_property_ui_text(prop, "Collision", "Use face for collision and ray-sensor detection");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "shared", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_blend_shared", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHAREDCOL);
RNA_def_property_ui_text(prop, "Shared", "Blend vertex colors across face when vertices are shared");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "twoside", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_twoside", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TWOSIDE);
- RNA_def_property_ui_text(prop, "Twoside", "Render face twosided");
+ RNA_def_property_ui_text(prop, "Two-side", "Render face two-sided");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "object_color", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_object_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_OBCOL);
RNA_def_property_ui_text(prop, "Object Color", "Use ObColor instead of vertex colors");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD);
RNA_def_property_ui_text(prop, "Halo", "Screen aligned billboard");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "billboard", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_billboard", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD2);
RNA_def_property_ui_text(prop, "Billboard", "Billboard with Z-axis constraint");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "shadow", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_shadow_cast", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHADOW);
RNA_def_property_ui_text(prop, "Shadow", "Face is used for shadow");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_bitmap_text", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BMFONT);
RNA_def_property_ui_text(prop, "Text", "Enable bitmap text on face");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "alpha_sort", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_alpha_sort", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_ALPHASORT);
RNA_def_property_ui_text(prop, "Alpha Sort", "Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "transp", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "transp");
RNA_def_property_enum_items(prop, transp_items);
RNA_def_property_ui_text(prop, "Transparency", "Transparency blending mode");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "uv_selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "UV Selected", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "uv_pinned", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "pin_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "unwrap", TF_PIN1);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "UV Pinned", "");
@@ -1546,50 +1632,52 @@ static void rna_def_mproperties(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
-void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
+/* mesh.vertices */
+static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop)
{
- PropertyRNA *prop;
+ StructRNA *srna;
+// PropertyRNA *prop;
- /* texture space */
- prop= RNA_def_property(srna, "auto_texspace", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "texflag", AUTOSPACE);
- RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object");
+ FunctionRNA *func;
+ PropertyRNA *parm;
- prop= RNA_def_property(srna, "texspace_loc", PROP_FLOAT, PROP_TRANSLATION);
- RNA_def_property_float_sdna(prop, NULL, "loc");
- RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location");
- RNA_def_property_editable_func(prop, texspace_editable);
- RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
+ RNA_def_property_srna(cprop, "MeshVertices");
+ srna= RNA_def_struct(brna, "MeshVertices", NULL);
+ RNA_def_struct_sdna(srna, "Mesh");
+ RNA_def_struct_ui_text(srna, "Mesh Vertices", "Collection of mesh vertices");
- prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
- RNA_def_property_float_sdna(prop, NULL, "size");
- RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
- RNA_def_property_editable_func(prop, texspace_editable);
- RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
+ func= RNA_def_function(srna, "add", "ED_mesh_vertices_add");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX);
+}
- /* not supported yet
- prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
- RNA_def_property_float(prop, NULL, "rot");
- RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
- RNA_def_property_editable_func(prop, texspace_editable);
- RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/
+/* mesh.edges */
+static void rna_def_mesh_edges(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+// PropertyRNA *prop;
- /* materials */
- prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
- RNA_def_property_struct_type(prop, "Material");
- RNA_def_property_ui_text(prop, "Materials", "");
-}
+ FunctionRNA *func;
+ PropertyRNA *parm;
+ RNA_def_property_srna(cprop, "MeshEdges");
+ srna= RNA_def_struct(brna, "MeshEdges", NULL);
+ RNA_def_struct_sdna(srna, "Mesh");
+ RNA_def_struct_ui_text(srna, "Mesh Edges", "Collection of mesh edges");
+
+ func= RNA_def_function(srna, "add", "ED_mesh_edges_add");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX);
+}
-/* scene.objects */
+/* mesh.faces */
static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
PropertyRNA *prop;
-// FunctionRNA *func;
-// PropertyRNA *parm;
+ FunctionRNA *func;
+ PropertyRNA *parm;
RNA_def_property_srna(cprop, "MeshFaces");
srna= RNA_def_struct(brna, "MeshFaces", NULL);
@@ -1599,6 +1687,120 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop)
prop= RNA_def_property(srna, "active", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "act_face");
RNA_def_property_ui_text(prop, "Active Face", "The active face for this mesh");
+
+ prop= RNA_def_property(srna, "active_tface", PROP_POINTER, PROP_UNSIGNED);
+ RNA_def_property_struct_type(prop, "MeshTextureFace");
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_mtface_get", NULL, NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Texture Face", "Active Texture Face");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ func= RNA_def_function(srna, "add", "ED_mesh_faces_add");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX);
+}
+
+/* mesh.vertex_colors */
+static void rna_def_vertex_colors(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "VertexColors");
+ srna= RNA_def_struct(brna, "VertexColors", NULL);
+ RNA_def_struct_sdna(srna, "Mesh");
+ RNA_def_struct_ui_text(srna, "Vertex Colors", "Collection of vertex colors");
+
+ func= RNA_def_function(srna, "new", "rna_Mesh_vertex_color_new");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_function_ui_description(func, "Add a vertex color layer to Mesh.");
+ parm= RNA_def_string(func, "name", "UVTex", 0, "", "UV Texture name.");
+ parm= RNA_def_pointer(func, "layer", "MeshColorLayer", "", "The newly created layer.");
+ RNA_def_function_return(func, parm);
+
+/*
+ func= RNA_def_function(srna, "remove", "rna_Mesh_vertex_color_remove");
+ RNA_def_function_ui_description(func, "Remove a vertex color layer.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+*/
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
+ RNA_def_property_struct_type(prop, "MeshColorLayer");
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_vertex_color_get", "rna_Mesh_active_vertex_color_set", NULL, NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_active_vertex_color_index_get", "rna_Mesh_active_vertex_color_index_set", "rna_Mesh_active_vertex_color_index_range");
+ RNA_def_property_ui_text(prop, "Active Vertex Color Index", "Active vertex color index");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+}
+
+/* mesh.uv_layers */
+static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "UVTextures");
+ srna= RNA_def_struct(brna, "UVTextures", NULL);
+ RNA_def_struct_sdna(srna, "Mesh");
+ RNA_def_struct_ui_text(srna, "UV Textures", "Collection of uv textures");
+
+ func= RNA_def_function(srna, "new", "rna_Mesh_uv_texture_new");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_function_ui_description(func, "Add a UV texture layer to Mesh.");
+ parm= RNA_def_string(func, "name", "UVTex", 0, "", "UV Texture name.");
+ parm= RNA_def_pointer(func, "layer", "MeshTextureFaceLayer", "", "The newly created layer.");
+ RNA_def_function_return(func, parm);
+
+/*
+ func= RNA_def_function(srna, "remove", "rna_Mesh_uv_layers_remove");
+ RNA_def_function_ui_description(func, "Remove a vertex color layer.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+*/
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
+ RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_uv_texture_get", "rna_Mesh_active_uv_texture_set", NULL, NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Active UV Texture", "Active UV texture");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_active_uv_texture_index_get", "rna_Mesh_active_uv_texture_index_set", "rna_Mesh_active_uv_texture_index_range");
+ RNA_def_property_ui_text(prop, "Active UV Texture Index", "Active UV texture index");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+}
+
+/* mesh.materials */
+static void rna_def_mesh_materials(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ // PropertyRNA *prop;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "MeshMaterials");
+ srna= RNA_def_struct(brna, "MeshMaterials", NULL);
+ RNA_def_struct_sdna(srna, "Mesh");
+ RNA_def_struct_ui_text(srna, "Mesh Materials", "Collection of materials");
+
+ func= RNA_def_function(srna, "link", "ED_mesh_material_link");
+ 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);
+
+ /* TODO, unlink? */
}
@@ -1611,15 +1813,17 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Mesh", "Mesh datablock defining geometric surfaces");
RNA_def_struct_ui_icon(srna, ICON_MESH_DATA);
- prop= RNA_def_property(srna, "verts", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "vertices", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mvert", "totvert");
RNA_def_property_struct_type(prop, "MeshVertex");
RNA_def_property_ui_text(prop, "Vertices", "Vertices of the mesh");
+ rna_def_mesh_vertices(brna, prop);
prop= RNA_def_property(srna, "edges", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "medge", "totedge");
RNA_def_property_struct_type(prop, "MeshEdge");
RNA_def_property_ui_text(prop, "Edges", "Edges of the mesh");
+ rna_def_mesh_edges(brna, prop);
prop= RNA_def_property(srna, "faces", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mface", "totface");
@@ -1636,7 +1840,7 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "texture_mesh", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
- RNA_def_property_ui_text(prop, "Texture Mesh", "Use another mesh for texture indicies (vertex indicies must be aligned)");
+ RNA_def_property_ui_text(prop, "Texture Mesh", "Use another mesh for texture indices (vertex indices must be aligned)");
/* UV textures */
prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE);
@@ -1644,22 +1848,11 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", 0, 0, 0, "rna_Mesh_uv_textures_length", 0, 0);
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
RNA_def_property_ui_text(prop, "UV Textures", "");
-
- prop= RNA_def_property(srna, "active_uv_texture", PROP_POINTER, PROP_UNSIGNED);
- RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_uv_texture_get", "rna_Mesh_active_uv_texture_set", NULL);
- RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Active UV Texture", "Active UV texture");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "active_uv_texture_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_active_uv_texture_index_get", "rna_Mesh_active_uv_texture_index_set", "rna_Mesh_active_uv_texture_index_range");
- RNA_def_property_ui_text(prop, "Active UV Texture Index", "Active UV texture index");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+ rna_def_uv_textures(brna, prop);
prop= RNA_def_property(srna, "uv_texture_clone", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_clone_get", "rna_Mesh_uv_texture_clone_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_clone_get", "rna_Mesh_uv_texture_clone_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Clone UV Texture", "UV texture to be used as cloning source");
@@ -1669,7 +1862,7 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "uv_texture_stencil", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_stencil_get", "rna_Mesh_uv_texture_stencil_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_stencil_get", "rna_Mesh_uv_texture_stencil_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mask UV Texture", "UV texture to mask the painted area");
@@ -1684,51 +1877,36 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", 0, 0, 0, "rna_Mesh_vertex_colors_length", 0, 0);
RNA_def_property_struct_type(prop, "MeshColorLayer");
RNA_def_property_ui_text(prop, "Vertex Colors", "");
+ rna_def_vertex_colors(brna, prop);
- prop= RNA_def_property(srna, "active_vertex_color", PROP_POINTER, PROP_UNSIGNED);
- RNA_def_property_struct_type(prop, "MeshColorLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_vertex_color_get", "rna_Mesh_active_vertex_color_set", NULL);
- RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "active_vertex_color_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_active_vertex_color_index_get", "rna_Mesh_active_vertex_color_index_set", "rna_Mesh_active_vertex_color_index_range");
- RNA_def_property_ui_text(prop, "Active Vertex Color Index", "Active vertex color index");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "float_layers", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "layers_float", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", 0, 0, 0, "rna_Mesh_float_layers_length", 0, 0);
RNA_def_property_struct_type(prop, "MeshFloatPropertyLayer");
RNA_def_property_ui_text(prop, "Float Property Layers", "");
- prop= RNA_def_property(srna, "int_layers", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "layers_int", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", 0, 0, 0, "rna_Mesh_int_layers_length", 0, 0);
RNA_def_property_struct_type(prop, "MeshIntPropertyLayer");
RNA_def_property_ui_text(prop, "Int Property Layers", "");
- prop= RNA_def_property(srna, "string_layers", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "layers_string", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", 0, 0, 0, "rna_Mesh_string_layers_length", 0, 0);
RNA_def_property_struct_type(prop, "MeshStringPropertyLayer");
RNA_def_property_ui_text(prop, "String Property Layers", "");
- prop= RNA_def_property(srna, "autosmooth", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_smooth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_AUTOSMOOTH);
RNA_def_property_ui_text(prop, "Auto Smooth", "Treats all set-smoothed faces with angles less than the specified angle as 'smooth' during render");
- prop= RNA_def_property(srna, "autosmooth_angle", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "auto_smooth_angle", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "smoothresh");
RNA_def_property_range(prop, 1, 80);
RNA_def_property_ui_text(prop, "Auto Smooth Angle", "Defines maximum angle between face normals that 'Auto Smooth' will operate on");
- prop= RNA_def_property(srna, "vertex_normal_flip", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ME_NOPUNOFLIP);
- RNA_def_property_ui_text(prop, "Vertex Normal Flip", "Flip vertex normals towards the camera during render");
-
- prop= RNA_def_property(srna, "double_sided", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_double_sided", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_TWOSIDED);
RNA_def_property_ui_text(prop, "Double Sided", "Render/display the mesh with double or single sided lighting");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
@@ -1742,65 +1920,99 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "key");
RNA_def_property_ui_text(prop, "Shape Keys", "");
+ /* texture space */
+ prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "texflag", AUTOSPACE);
+ RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object");
+
+ prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location");
+ RNA_def_property_editable_func(prop, "rna_Mesh_texspace_editable");
+ RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_loc_get", "rna_Mesh_texspace_loc_set", NULL);
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
+
+ prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
+ RNA_def_property_editable_func(prop, "rna_Mesh_texspace_editable");
+ RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_size_get", "rna_Mesh_texspace_size_set", NULL);
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
+
+ /* not supported yet
+ prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
+ RNA_def_property_float(prop, NULL, "rot");
+ RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
+ RNA_def_property_editable_func(prop, texspace_editable);
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/
+
+ /* materials */
+ prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
+ RNA_def_property_struct_type(prop, "Material");
+ RNA_def_property_ui_text(prop, "Materials", "");
+ rna_def_mesh_materials(brna, prop);
+
/* Mesh Draw Options for Edit Mode*/
- prop= RNA_def_property(srna, "draw_edges", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEDGES);
- RNA_def_property_ui_text(prop, "Draw Edges", "Displays selected edges using hilights in the 3D view and UV editor");
+ RNA_def_property_ui_text(prop, "Draw Edges", "Displays selected edges using highlights in the 3D view and UV editor");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "all_edges", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_ALLEDGES);
RNA_def_property_ui_text(prop, "All Edges", "Displays all edges for wireframe in all view modes in the 3D view");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "draw_faces", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES);
RNA_def_property_ui_text(prop, "Draw Faces", "Displays all faces as shades in the 3D view and UV editor");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "draw_normals", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWNORMALS);
RNA_def_property_ui_text(prop, "Draw Normals", "Displays face normals as lines");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "draw_vertex_normals", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_normal_vertex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_VNORMALS);
RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Displays vertex normals as lines");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "draw_creases", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWCREASES);
RNA_def_property_ui_text(prop, "Draw Creases", "Displays creases created for subsurf weighting");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "draw_bevel_weights", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_edge_bevel_weight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWBWEIGHTS);
RNA_def_property_ui_text(prop, "Draw Bevel Weights", "Displays weights created for the Bevel modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "draw_seams", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_edge_seams", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSEAMS);
RNA_def_property_ui_text(prop, "Draw Seams", "Displays UV unwrapping seams");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "draw_sharp", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_edge_sharp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSHARP);
RNA_def_property_ui_text(prop, "Draw Sharp", "Displays sharp edges, used with the EdgeSplit modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "draw_edge_lenght", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGELEN);
- RNA_def_property_ui_text(prop, "Edge Length", "Displays selected edge lengths");
+ RNA_def_property_ui_text(prop, "Edge Length", "Displays selected edge lengths, Using global values when set in the transform panel");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "draw_edge_angle", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_extra_edge_angle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGEANG);
- RNA_def_property_ui_text(prop, "Edge Angles", "Displays the angles in the selected edges in degrees");
+ RNA_def_property_ui_text(prop, "Edge Angles", "Displays the angles in the selected edges in degrees, Using global values when set in the transform panel");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "draw_face_area", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_FACEAREA);
- RNA_def_property_ui_text(prop, "Face Area", "Displays the area of selected faces");
+ RNA_def_property_ui_text(prop, "Face Area", "Displays the area of selected faces, Using global values when set in the transform panel");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
/* editflag */
@@ -1847,7 +2059,6 @@ static void rna_def_mesh(BlenderRNA *brna)
/* pointers */
rna_def_animdata_common(srna);
- rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
RNA_api_mesh(srna);
}
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index 1657e0e64d7..eaf18920c85 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -37,15 +37,6 @@
#ifdef RNA_RUNTIME
-static void rna_Mesh_uv_texture_add(struct Mesh *me, struct bContext *C)
-{
- ED_mesh_uv_texture_add(C, NULL, NULL, me);
-}
-
-static void rna_Mesh_vertex_color_add(struct Mesh *me, struct bContext *C)
-{
- ED_mesh_color_add(C, NULL, NULL, me);
-}
#else
@@ -59,36 +50,12 @@ void RNA_api_mesh(StructRNA *srna)
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);
- RNA_def_property_flag(parm, PROP_REQUIRED);
- 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, "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, "add_vertex_color", "rna_Mesh_vertex_color_add");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- RNA_def_function_ui_description(func, "Add a vertex color 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_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges.");
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 76c64c374f2..e364b075024 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -33,6 +33,10 @@
#ifdef RNA_RUNTIME
+#include "BLI_math.h"
+
+#include "MEM_guardedalloc.h"
+
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
@@ -46,36 +50,107 @@
static int rna_Meta_texspace_editable(PointerRNA *ptr)
{
MetaBall *mb= (MetaBall*)ptr->data;
- return (mb->texflag & AUTOSPACE)? 0: PROP_EDITABLE;
+ return (mb->texflag & MB_AUTOSPACE)? 0: PROP_EDITABLE;
+}
+
+static void rna_Meta_texspace_loc_get(PointerRNA *ptr, float *values)
+{
+ MetaBall *mb= (MetaBall*)ptr->data;
+
+ /* tex_space_mball() needs object.. ugh */
+
+ copy_v3_v3(values, mb->loc);
+}
+
+static void rna_Meta_texspace_loc_set(PointerRNA *ptr, const float *values)
+{
+ MetaBall *mb= (MetaBall*)ptr->data;
+
+ copy_v3_v3(mb->loc, values);
}
+static void rna_Meta_texspace_size_get(PointerRNA *ptr, float *values)
+{
+ MetaBall *mb= (MetaBall*)ptr->data;
+
+ /* tex_space_mball() needs object.. ugh */
+
+ copy_v3_v3(values, mb->size);
+}
+
+static void rna_Meta_texspace_size_set(PointerRNA *ptr, const float *values)
+{
+ MetaBall *mb= (MetaBall*)ptr->data;
+
+ copy_v3_v3(mb->size, values);
+}
+
+
static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
MetaBall *mb= ptr->id.data;
Object *ob;
- for(ob=bmain->object.first; ob; ob= ob->id.next)
- if(ob->data == mb)
- copy_mball_properties(scene, ob);
+ /* cheating way for importers to avoid slow updates */
+ if(mb->id.us > 0) {
+ for(ob=bmain->object.first; ob; ob= ob->id.next)
+ if(ob->data == mb)
+ copy_mball_properties(scene, ob);
+
+ DAG_id_flush_update(&mb->id, OB_RECALC_DATA);
+ WM_main_add_notifier(NC_GEOM|ND_DATA, mb);
+ }
+}
+
+static MetaElem *rna_MetaBall_elements_new(MetaBall *mb, int type)
+{
+ MetaElem *ml= add_metaball_element(mb, type);
+
+ /* cheating way for importers to avoid slow updates */
+ if(mb->id.us > 0) {
+ DAG_id_flush_update(&mb->id, OB_RECALC_DATA);
+ WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id);
+ }
+
+ return ml;
+}
+
+static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, MetaElem *ml)
+{
+ int found= 0;
+
+ found= BLI_remlink_safe(&mb->elems, ml);
- DAG_id_flush_update(&mb->id, OB_RECALC_DATA);
- WM_main_add_notifier(NC_GEOM|ND_DATA, mb);
+ if(!found) {
+ BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" does not contain spline given", mb->id.name+2);
+ return;
+ }
+
+ MEM_freeN(ml);
+ /* invalidate pointer!, no can do */
+
+ /* cheating way for importers to avoid slow updates */
+ if(mb->id.us > 0) {
+ DAG_id_flush_update(&mb->id, OB_RECALC_DATA);
+ WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id);
+ }
}
#else
+static EnumPropertyItem metaelem_type_items[] = {
+ {MB_BALL, "BALL", ICON_META_BALL, "Ball", ""},
+ {MB_TUBE, "TUBE", ICON_META_TUBE, "Tube", ""},
+ {MB_PLANE, "PLANE", ICON_META_PLANE, "Plane", ""},
+ {MB_ELIPSOID, "ELLIPSOID", ICON_META_ELLIPSOID, "Ellipsoid", ""}, // NOTE: typo at original definition!
+ {MB_CUBE, "CUBE", ICON_META_CUBE, "Cube", ""},
+ {0, NULL, 0, NULL, NULL}};
+
static void rna_def_metaelement(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] = {
- {MB_BALL, "BALL", ICON_META_BALL, "Ball", ""},
- {MB_TUBE, "TUBE", ICON_META_TUBE, "Tube", ""},
- {MB_PLANE, "PLANE", ICON_META_PLANE, "Plane", ""},
- {MB_ELIPSOID, "ELLIPSOID", ICON_META_ELLIPSOID, "Ellipsoid", ""}, // NOTE: typo at original definition!
- {MB_CUBE, "CUBE", ICON_META_CUBE, "Cube", ""},
- {0, NULL, 0, NULL, NULL}};
-
+
srna= RNA_def_struct(brna, "MetaElement", NULL);
RNA_def_struct_sdna(srna, "MetaElem");
RNA_def_struct_ui_text(srna, "Meta Element", "Blobby element in a MetaBall datablock");
@@ -83,12 +158,12 @@ static void rna_def_metaelement(BlenderRNA *brna)
/* enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_enum_items(prop, metaelem_type_items);
RNA_def_property_ui_text(prop, "Type", "Metaball types");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* number values */
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Location", "");
@@ -130,7 +205,7 @@ static void rna_def_metaelement(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* flags */
- prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_NEGATIVE);
RNA_def_property_ui_text(prop, "Negative", "Set metaball as negative one");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
@@ -141,6 +216,37 @@ static void rna_def_metaelement(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
}
+/* mball.elements */
+static void rna_def_metaball_elements(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "MetaBallElements");
+ srna= RNA_def_struct(brna, "MetaBallElements", NULL);
+ RNA_def_struct_sdna(srna, "MetaBall");
+ RNA_def_struct_ui_text(srna, "Meta Elements", "Collection of metaball elements");
+
+ func= RNA_def_function(srna, "new", "rna_MetaBall_elements_new");
+ RNA_def_function_ui_description(func, "Add a new spline to the curve.");
+ parm= RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta element.");
+ parm= RNA_def_pointer(func, "element", "MetaElement", "", "The newly created metaelement.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_MetaBall_elements_remove");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "lastelem");
+ RNA_def_property_ui_text(prop, "Active Element", "Last selected element");
+}
+
static void rna_def_metaball(BlenderRNA *brna)
{
StructRNA *srna;
@@ -160,25 +266,23 @@ static void rna_def_metaball(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "elems", NULL);
RNA_def_property_struct_type(prop, "MetaElement");
RNA_def_property_ui_text(prop, "Elements", "Meta elements");
+ rna_def_metaball_elements(brna, prop);
- prop= RNA_def_property(srna, "active_element", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "lastelem");
- RNA_def_property_ui_text(prop, "Last selected element.", "Last selected element");
-
/* enums */
- prop= RNA_def_property(srna, "flag", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "update_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_update_items);
RNA_def_property_ui_text(prop, "Update", "Metaball edit update behavior");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* number values */
- prop= RNA_def_property(srna, "wire_size", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "resolution", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "wiresize");
RNA_def_property_range(prop, 0.050f, 1.0f);
RNA_def_property_ui_text(prop, "Wire Size", "Polygonization resolution in the 3D viewport");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "render_size", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "render_resolution", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "rendersize");
RNA_def_property_range(prop, 0.050f, 1.0f);
RNA_def_property_ui_text(prop, "Render Size", "Polygonization resolution in rendering");
@@ -190,8 +294,37 @@ static void rna_def_metaball(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Threshold", "Influence of meta elements");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- /* materials, textures */
- rna_def_texmat_common(srna, "rna_Meta_texspace_editable");
+ /* texture space */
+ prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "texflag", MB_AUTOSPACE);
+ RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object");
+
+ prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location");
+ RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable");
+ RNA_def_property_float_funcs(prop, "rna_Meta_texspace_loc_get", "rna_Meta_texspace_loc_set", NULL);
+ RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
+
+ prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
+ RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable");
+ RNA_def_property_float_funcs(prop, "rna_Meta_texspace_size_get", "rna_Meta_texspace_size_set", NULL);
+ RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
+
+ /* not supported yet
+ prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
+ RNA_def_property_float(prop, NULL, "rot");
+ RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
+ RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable");
+ RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");*/
+
+ /* materials */
+ prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
+ RNA_def_property_struct_type(prop, "Material");
+ RNA_def_property_ui_text(prop, "Materials", "");
/* anim */
rna_def_animdata_common(srna);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index d4bc2d6c571..5024c8d2c2e 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -36,10 +36,13 @@
#include "DNA_object_force.h"
#include "DNA_scene_types.h"
+#include "MEM_guardedalloc.h"
+
#include "BLI_math.h"
#include "BKE_animsys.h"
#include "BKE_bmesh.h" /* For BevelModifierData */
+#include "BKE_multires.h"
#include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */
#include "WM_api.h"
@@ -55,8 +58,8 @@ EnumPropertyItem modifier_type_items[] ={
{eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MOD_EDGESPLIT, "Edge Split", ""},
{eModifierType_Mask, "MASK", ICON_MOD_MASK, "Mask", ""},
{eModifierType_Mirror, "MIRROR", ICON_MOD_MIRROR, "Mirror", ""},
- {eModifierType_Screw, "SCREW", ICON_MOD_SCREW, "Screw", ""},
{eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""},
+ {eModifierType_Screw, "SCREW", ICON_MOD_SCREW, "Screw", ""},
{eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", ""},
{eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""},
{eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""},
@@ -86,10 +89,14 @@ EnumPropertyItem modifier_type_items[] ={
#ifdef RNA_RUNTIME
+#include "DNA_particle_types.h"
+#include "DNA_smoke_types.h"
+
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_library.h"
#include "BKE_modifier.h"
+#include "BKE_particle.h"
static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
@@ -208,13 +215,16 @@ static void rna_Modifier_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
rna_Modifier_update(bmain, scene, ptr);
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
}
static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
{
SmokeModifierData *smd= (SmokeModifierData *)ptr->data;
Object *ob= (Object*)ptr->id.data;
+ ParticleSystemModifierData *psmd = NULL;
+ ParticleSystem *psys = NULL;
+ ParticleSettings *part = NULL;
// nothing changed
if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
@@ -228,6 +238,28 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
ob->dt = OB_WIRE;
break;
case MOD_SMOKE_TYPE_FLOW:
+ for(psys=ob->particlesystem.first; psys; psys=psys->next)
+ if(psys->part->type == PART_EMITTER)
+ break;
+ if(ob->type == OB_MESH && !psys) {
+ /* add particle system */
+ psmd = (ParticleSystemModifierData *)object_add_particle_system(scene, ob, NULL);
+ if(psmd)
+ {
+ psys = psmd->psys;
+ part = psys->part;
+ part->flag |= PART_UNBORN;
+ part->lifetime = 1.0f;
+ part->sta = 1.0f;
+ part->end = 250.0f;
+ part->ren_as = PART_DRAW_NOT;
+ sprintf(psys->name, "SmokeParticles");
+ psys->recalc |= (PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
+ }
+ }
+ if(smd->flow)
+ smd->flow->psys = psys;
case MOD_SMOKE_TYPE_COLL:
case 0:
default:
@@ -369,7 +401,7 @@ static int rna_MultiresModifier_external_get(PointerRNA *ptr)
return CustomData_external_test(&me->fdata, CD_MDISPS);
}
-static void rna_MultiresModifier_filename_get(PointerRNA *ptr, char *value)
+static void rna_MultiresModifier_filepath_get(PointerRNA *ptr, char *value)
{
Object *ob= (Object*)ptr->id.data;
CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
@@ -377,16 +409,18 @@ static void rna_MultiresModifier_filename_get(PointerRNA *ptr, char *value)
BLI_strncpy(value, (external)? external->filename: "", sizeof(external->filename));
}
-static void rna_MultiresModifier_filename_set(PointerRNA *ptr, const char *value)
+static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value)
{
Object *ob= (Object*)ptr->id.data;
CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
- if(external)
+ if(external && strcmp(external->filename, value)) {
BLI_strncpy(external->filename, value, sizeof(external->filename));
+ multires_force_external_reload(ob);
+ }
}
-static int rna_MultiresModifier_filename_length(PointerRNA *ptr)
+static int rna_MultiresModifier_filepath_length(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
@@ -465,7 +499,7 @@ static void rna_ArrayModifier_curve_set(PointerRNA *ptr, PointerRNA value)
static int rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr)
{
- return (((MeshDeformModifierData*)ptr->data)->bindcos != NULL);
+ return (((MeshDeformModifierData*)ptr->data)->bindcagecos != NULL);
}
static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr)
@@ -553,12 +587,12 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0, 6, 1, 0);
RNA_def_property_ui_text(prop, "Render Levels", "Number of subdivisions to perform when rendering");
- prop= RNA_def_property(srna, "optimal_display", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_ControlEdges);
RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "subsurf_uv", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_SubsurfUv);
RNA_def_property_ui_text(prop, "Subdivide UVs", "Use subsurf to subdivide UVs");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -598,17 +632,17 @@ static void rna_def_modifier_multires(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Total Levels", "Number of subdivisions for which displacements are stored");
- prop= RNA_def_property(srna, "external", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_external", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_MultiresModifier_external_get", NULL);
RNA_def_property_ui_text(prop, "External", "Store multires displacements outside the .blend file, to save memory");
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
- RNA_def_property_string_funcs(prop, "rna_MultiresModifier_filename_get", "rna_MultiresModifier_filename_length", "rna_MultiresModifier_filename_set");
- RNA_def_property_ui_text(prop, "Filename", "Path to external displacements file");
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_string_funcs(prop, "rna_MultiresModifier_filepath_get", "rna_MultiresModifier_filepath_length", "rna_MultiresModifier_filepath_set");
+ RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "optimal_display", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", eMultiresModifierFlag_ControlEdges);
RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -626,7 +660,7 @@ static void rna_def_modifier_lattice(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set", NULL, "rna_Lattice_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
@@ -658,7 +692,7 @@ static void rna_def_modifier_curve(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Curve object to deform with");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set", NULL, "rna_Curve_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
@@ -685,17 +719,20 @@ static void rna_def_modifier_build(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "BuildModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_BUILD);
- prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_TIME);
+ prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
+ RNA_def_property_float_sdna(prop, NULL, "start");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start", "Specify the start frame of the effect");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_TIME);
+ prop= RNA_def_property(srna, "frame_duration", PROP_FLOAT, PROP_TIME);
+ RNA_def_property_float_sdna(prop, NULL, "length");
RNA_def_property_range(prop, 1, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Length", "Specify the total time the build effect requires");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "randomize", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_random_order", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "randomize", 1);
RNA_def_property_ui_text(prop, "Randomize", "Randomize the faces or edges during build");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -715,42 +752,42 @@ static void rna_def_modifier_mirror(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "MirrorModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_MIRROR);
- prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_X);
RNA_def_property_ui_text(prop, "X", "Enable X axis mirror");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Y);
RNA_def_property_ui_text(prop, "Y", "Enable Y axis mirror");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Z);
RNA_def_property_ui_text(prop, "Z", "Enable Z axis mirror");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "clip", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_CLIPPING);
RNA_def_property_ui_text(prop, "Clip", "Prevents vertices from going through the mirror during transform");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_VGROUP);
RNA_def_property_ui_text(prop, "Mirror Vertex Groups", "Mirror vertex groups (e.g. .R->.L)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mirror_u", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mirror_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_U);
RNA_def_property_ui_text(prop, "Mirror U", "Mirror the U texture coordinate around the 0.5 point");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mirror_v", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mirror_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_V);
RNA_def_property_ui_text(prop, "Mirror V", "Mirror the V texture coordinate around the 0.5 point");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "merge_limit", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "tolerance");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 1, 0.01, 6);
@@ -774,9 +811,10 @@ static void rna_def_modifier_decimate(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "DecimateModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_DECIM);
- prop= RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "percent");
RNA_def_property_range(prop, 0, 1);
+ RNA_def_property_ui_range(prop, 0, 1, 1, 2);
RNA_def_property_ui_text(prop, "Ratio", "Defines the ratio of triangles to reduce to");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -803,37 +841,37 @@ static void rna_def_modifier_wave(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "WaveModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_WAVE);
- prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_X);
RNA_def_property_ui_text(prop, "X", "X axis motion");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_Y);
RNA_def_property_ui_text(prop, "Y", "Y axis motion");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_CYCL);
RNA_def_property_ui_text(prop, "Cyclic", "Cyclic wave effect");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "normals", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM);
- RNA_def_property_ui_text(prop, "Normals", "Dispace along normals");
+ RNA_def_property_ui_text(prop, "Normals", "Displace along normals");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "x_normal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_normal_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_X);
RNA_def_property_ui_text(prop, "X Normal", "Enable displacement along the X normal");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "y_normal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_normal_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Y);
RNA_def_property_ui_text(prop, "Y Normal", "Enable displacement along the Y normal");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "z_normal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_normal_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Z);
RNA_def_property_ui_text(prop, "Z Normal", "Enable displacement along the Z normal");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -845,6 +883,7 @@ static void rna_def_modifier_wave(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
+ RNA_def_property_float_sdna(prop, NULL, "lifetime");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Lifetime", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -893,7 +932,7 @@ static void rna_def_modifier_wave(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texmapping");
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used for modulating input");
@@ -905,7 +944,7 @@ static void rna_def_modifier_wave(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WaveModifier_uvlayer_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "texture_coordinates_object", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "texture_coords_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "map_object");
RNA_def_property_ui_text(prop, "Texture Coordinates Object", "");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
@@ -949,7 +988,7 @@ static void rna_def_modifier_armature(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Armature object to deform with");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set", NULL, "rna_Armature_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
@@ -959,7 +998,7 @@ static void rna_def_modifier_armature(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ArmatureModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP);
RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -974,17 +1013,12 @@ static void rna_def_modifier_armature(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Bone Envelopes", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "quaternion", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION);
RNA_def_property_ui_text(prop, "Quaternion", "Deform rotation interpolation with quaternions");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "b_bone_rest", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_B_BONE_REST);
- RNA_def_property_ui_text(prop, "B-Bone Rest", "Make B-Bones deform already in rest position");
- RNA_def_property_update(prop, 0, "rna_Modifier_update");
-
- prop= RNA_def_property(srna, "multi_modifier", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_multi_modifier", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "multi", 0);
RNA_def_property_ui_text(prop, "Multi Modifier", "Use same input as previous modifier, and mix results using overall vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1041,13 +1075,13 @@ static void rna_def_modifier_softbody(BlenderRNA *brna)
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_pointer_funcs(prop, "rna_SoftBodyModifier_settings_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Soft Body Settings", "");
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_pointer_funcs(prop, "rna_SoftBodyModifier_point_cache_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Soft Body Point Cache", "");
}
@@ -1068,8 +1102,8 @@ static void rna_def_modifier_boolean(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_MOD_BOOLEAN);
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
- RNA_def_property_ui_text(prop, "Object", "Mesh object to use for boolean operation");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set", NULL);
+ RNA_def_property_ui_text(prop, "Object", "Mesh object to use for Boolean operation");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
@@ -1107,7 +1141,8 @@ static void rna_def_modifier_array(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Count", "Number of duplicates to make");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "fit_length", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_sdna(prop, NULL, "length");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Length", "Length to fit array within");
@@ -1116,43 +1151,43 @@ static void rna_def_modifier_array(BlenderRNA *brna)
prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curve_ob");
RNA_def_property_ui_text(prop, "Curve", "Curve object to fit array length to");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set", NULL, "rna_Curve_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
/* Offset parameters */
- prop= RNA_def_property(srna, "constant_offset", PROP_BOOLEAN, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "use_constant_offset", PROP_BOOLEAN, PROP_TRANSLATION);
RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_CONST);
- RNA_def_property_ui_text(prop, "Constant Offset", "");
+ RNA_def_property_ui_text(prop, "Constant Offset", "Add a constant offset");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "constant_offset_displacement", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_ui_text(prop, "Constant Offset Displacement", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "relative_offset", PROP_BOOLEAN, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "use_relative_offset", PROP_BOOLEAN, PROP_TRANSLATION);
RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_RELATIVE);
- RNA_def_property_ui_text(prop, "Relative Offset", "");
+ RNA_def_property_ui_text(prop, "Relative Offset", "Add an offset relative to the object's bounding box");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "relative_offset_displacement", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "relative_offset_displace", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_ui_text(prop, "Relative Offset Displacement", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* Vertex merging parameters */
- prop= RNA_def_property(srna, "merge_adjacent_vertices", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_merge_vertices", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGE);
RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in adjacent duplicates");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "merge_end_vertices", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_merge_vertices_cap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGEFINAL);
RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in first and last duplicates");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "merge_distance", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "merge_dist");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 1, 1, 4);
@@ -1160,27 +1195,27 @@ static void rna_def_modifier_array(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* Offset object */
- prop= RNA_def_property(srna, "add_offset_object", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_object_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_OBJ);
- RNA_def_property_ui_text(prop, "Add Offset Object", "Add an object transformation to the total offset");
+ RNA_def_property_ui_text(prop, "Object Offset", "Add another object's transformation to the total offset");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "offset_ob");
- RNA_def_property_ui_text(prop, "Offset Object", "");
+ RNA_def_property_ui_text(prop, "Object Offset", "");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
/* Caps */
prop= RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set", NULL, "rna_Mesh_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "End Cap", "Mesh object to use as an end cap");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL, "rna_Mesh_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
}
@@ -1207,7 +1242,7 @@ static void rna_def_modifier_edgesplit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Edge Angle", "Split edges with high angle between faces");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_sharp", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_edge_sharp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMFLAG);
RNA_def_property_ui_text(prop, "Use Sharp Edges", "Split edges that are marked as sharp");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1249,7 +1284,8 @@ static void rna_def_modifier_displace(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "midlevel", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_sdna(prop, NULL, "midlevel");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Midlevel", "Material value that gives no displacement");
@@ -1257,7 +1293,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna)
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
- RNA_def_property_ui_range(prop, -100, 100, 10, 2);
+ RNA_def_property_ui_range(prop, -100, 100, 10, 3);
RNA_def_property_ui_text(prop, "Strength", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1266,7 +1302,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Direction", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texmapping");
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
@@ -1301,7 +1337,8 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_UVProjectModifier_uvlayer_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "num_projectors", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "projector_count", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "num_projectors");
RNA_def_property_ui_text(prop, "Number of Projectors", "Number of projectors to use");
RNA_def_property_int_funcs(prop, NULL, "rna_UVProjectModifier_num_projectors_set", NULL);
RNA_def_property_range(prop, 1, MOD_UVPROJECT_MAX);
@@ -1320,32 +1357,32 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna)
prop= RNA_def_property(srna, "aspect_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aspectx");
RNA_def_property_range(prop, 1, FLT_MAX);
- RNA_def_property_ui_range(prop, 1, 1000, 0.2, 2);
+ RNA_def_property_ui_range(prop, 1, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Horizontal Aspect Ratio", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "aspect_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aspecty");
RNA_def_property_range(prop, 1, FLT_MAX);
- RNA_def_property_ui_range(prop, 1, 1000, 0.2, 2);
+ RNA_def_property_ui_range(prop, 1, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Vertical Aspect Ratio", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scalex");
RNA_def_property_range(prop, 0, FLT_MAX);
- RNA_def_property_ui_range(prop, 0, 1000, 0.2, 2);
+ RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Horizontal Scale", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scaley");
RNA_def_property_range(prop, 0, FLT_MAX);
- RNA_def_property_ui_range(prop, 0, 1000, 0.2, 2);
+ RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Vertical Scale", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "override_image", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_image_override", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_UVPROJECT_OVERRIDEIMAGE);
RNA_def_property_ui_text(prop, "Override Image", "Override faces' current images with the given image");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1355,9 +1392,10 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
- RNA_def_property_pointer_funcs(prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_ui_text(prop, "Object", "Object to use as projector transform");
+ RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
}
static void rna_def_modifier_smooth(BlenderRNA *brna)
@@ -1370,17 +1408,17 @@ static void rna_def_modifier_smooth(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SmoothModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH);
- prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_X);
RNA_def_property_ui_text(prop, "X", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Y);
RNA_def_property_ui_text(prop, "Y", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Z);
RNA_def_property_ui_text(prop, "Z", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1388,11 +1426,12 @@ static void rna_def_modifier_smooth(BlenderRNA *brna)
prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fac");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
- RNA_def_property_ui_range(prop, -10, 10, 0.5, 2);
+ RNA_def_property_ui_range(prop, -10, 10, 1, 3);
RNA_def_property_ui_text(prop, "Factor", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "repeat", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "repeat");
RNA_def_property_ui_range(prop, 0, 30, 1, 0);
RNA_def_property_ui_text(prop, "Repeat", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1428,26 +1467,26 @@ static void rna_def_modifier_cast(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Control object: if available, its location determines the center of the effect");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_CastModifier_object_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_CastModifier_object_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_X);
RNA_def_property_ui_text(prop, "X", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Y);
RNA_def_property_ui_text(prop, "Y", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Z);
RNA_def_property_ui_text(prop, "Z", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "from_radius", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_radius_as_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_SIZE_FROM_RADIUS);
RNA_def_property_ui_text(prop, "From Radius", "Use radius as size of projection shape (0 = auto)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1466,13 +1505,13 @@ static void rna_def_modifier_cast(BlenderRNA *brna)
prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0, FLT_MAX);
- RNA_def_property_ui_range(prop, 0, 100, 10, 2);
+ RNA_def_property_ui_range(prop, 0, 100, 5, 2);
RNA_def_property_ui_text(prop, "Radius", "Only deform vertices within this distance from the center of the effect (leave as 0 for infinite.)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, FLT_MAX);
- RNA_def_property_ui_range(prop, 0, 100, 10, 2);
+ RNA_def_property_ui_range(prop, 0, 100, 5, 2);
RNA_def_property_ui_text(prop, "Size", "Size of projection shape (leave as 0 for auto.)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1501,7 +1540,7 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
@@ -1510,7 +1549,7 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to control cage");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_INVERT_VGROUP);
RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1527,7 +1566,7 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Precision", "The grid size for binding");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "dynamic", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_dynamic_bind", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_DYNAMIC_BIND);
RNA_def_property_ui_text(prop, "Dynamic", "Recompute binding dynamically on top of other deformers (slower and more memory consuming.)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1543,11 +1582,17 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna)
static void rna_def_modifier_particlesystem(BlenderRNA *brna)
{
StructRNA *srna;
+ PropertyRNA *prop;
srna= RNA_def_struct(brna, "ParticleSystemModifier", "Modifier");
RNA_def_struct_ui_text(srna, "ParticleSystem Modifier", "Particle system simulation modifier");
RNA_def_struct_sdna(srna, "ParticleSystemModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES);
+
+ prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "psys");
+ RNA_def_property_ui_text(prop, "Particle System", "Particle System that this modifier controls");
}
static void rna_def_modifier_particleinstance(BlenderRNA *brna)
@@ -1573,7 +1618,7 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "particle_system_number", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "particle_system_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "psys");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Particle System Number", "");
@@ -1585,42 +1630,42 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Axis", "Pole axis for rotation");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "normal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Parents);
RNA_def_property_ui_text(prop, "Normal", "Create instances from normal particles");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "children", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Children);
RNA_def_property_ui_text(prop, "Children", "Create instances from child particles");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "path", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Path);
RNA_def_property_ui_text(prop, "Path", "Create instances along particle paths");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Unborn);
RNA_def_property_ui_text(prop, "Unborn", "Show instances when particles are unborn");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "alive", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Alive);
RNA_def_property_ui_text(prop, "Alive", "Show instances when particles are alive");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "dead", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Dead);
RNA_def_property_ui_text(prop, "Dead", "Show instances when particles are dead");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "keep_shape", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_preserve_shape", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_KeepShape);
RNA_def_property_ui_text(prop, "Keep Shape", "Don't stretch the object");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "size", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_UseSize);
RNA_def_property_ui_text(prop, "Size", "Use particle size to scale the instances");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1657,25 +1702,30 @@ static void rna_def_modifier_explode(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Protect", "Clean vertex group edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "split_edges", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_edge_split", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_EdgeSplit);
RNA_def_property_ui_text(prop, "Split Edges", "Split face edges for nicer shrapnel");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Unborn);
RNA_def_property_ui_text(prop, "Unborn", "Show mesh when particles are unborn");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "alive", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Alive);
RNA_def_property_ui_text(prop, "Alive", "Show mesh when particles are alive");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "dead", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Dead);
RNA_def_property_ui_text(prop, "Dead", "Show mesh when particles are dead");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_PaSize);
+ RNA_def_property_ui_text(prop, "Size", "Use particle size for the shrapnel");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_cloth(BlenderRNA *brna)
@@ -1710,9 +1760,9 @@ static void rna_def_modifier_smoke(BlenderRNA *brna)
static EnumPropertyItem prop_smoke_type_items[] = {
{0, "NONE", 0, "None", ""},
- {MOD_SMOKE_TYPE_DOMAIN, "TYPE_DOMAIN", 0, "Domain", ""},
- {MOD_SMOKE_TYPE_FLOW, "TYPE_FLOW", 0, "Flow", "Inflow/Outflow"},
- {MOD_SMOKE_TYPE_COLL, "TYPE_COLL", 0, "Collision", ""},
+ {MOD_SMOKE_TYPE_DOMAIN, "DOMAIN", 0, "Domain", ""},
+ {MOD_SMOKE_TYPE_FLOW, "FLOW", 0, "Flow", "Inflow/Outflow"},
+ {MOD_SMOKE_TYPE_COLL, "COLLISION", 0, "Collision", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "SmokeModifier", "Modifier");
@@ -1752,7 +1802,7 @@ static void rna_def_modifier_collision(BlenderRNA *brna)
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_pointer_funcs(prop, "rna_CollisionModifier_settings_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Settings", "");
}
@@ -1785,7 +1835,7 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Width", "Bevel value/amount");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "only_vertices", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_only_vertices", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", BME_BEVEL_VERT);
RNA_def_property_ui_text(prop, "Only Vertices", "Bevel verts/corners, not edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1802,7 +1852,7 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Edge Weight Method", "What edge weight to use for weighting a vertex");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bevel_angle");
RNA_def_property_range(prop, 0, 180);
RNA_def_property_ui_range(prop, 0, 180, 100, 2);
@@ -1826,7 +1876,7 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "ShrinkwrapModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SHRINKWRAP);
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "wrap_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shrinkType");
RNA_def_property_enum_items(prop, shrink_type_items);
RNA_def_property_ui_text(prop, "Mode", "");
@@ -1834,14 +1884,14 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set", NULL, "rna_Mesh_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "auxTarget");
RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set", NULL, "rna_Mesh_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
@@ -1858,17 +1908,17 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Offset", "Distance to keep from the target");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_project_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS);
RNA_def_property_ui_text(prop, "X", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_project_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS);
RNA_def_property_ui_text(prop, "Y", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_project_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS);
RNA_def_property_ui_text(prop, "Z", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1880,27 +1930,27 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Subsurf Levels", "Number of subdivisions that must be performed before extracting vertices' positions and normals");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_negative_direction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR);
RNA_def_property_ui_text(prop, "Negative", "Allow vertices to move in the negative direction of axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "positive", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_positive_direction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR);
RNA_def_property_ui_text(prop, "Positive", "Allow vertices to move in the positive direction of axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "cull_front_faces", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cull_front_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE);
RNA_def_property_ui_text(prop, "Cull Front Faces", "Stop vertices from projecting to a front face on the target");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "cull_back_faces", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cull_back_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_CULL_TARGET_BACKFACE);
RNA_def_property_ui_text(prop, "Cull Back Faces", "Stop vertices from projecting to a back face on the target");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "keep_above_surface", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_keep_above_surface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE);
RNA_def_property_ui_text(prop, "Keep Above Surface", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1945,7 +1995,7 @@ static void rna_def_modifier_mask(BlenderRNA *brna)
prop= RNA_def_property(srna, "armature", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob_arm");
RNA_def_property_ui_text(prop, "Armature", "Armature to use as source of bones to mask");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set", NULL, "rna_Armature_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
@@ -1955,7 +2005,7 @@ static void rna_def_modifier_mask(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MaskModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MASK_INV);
RNA_def_property_ui_text(prop, "Invert", "Use vertices that are not part of region defined");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1978,7 +2028,8 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SimpleDeformModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SIMPLEDEFORM);
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, simple_deform_mode_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1994,14 +2045,14 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "originOpts", MOD_SIMPLEDEFORM_ORIGIN_LOCAL);
RNA_def_property_ui_text(prop, "Relative", "Sets the origin of deform space to be relative to the object");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
- RNA_def_property_ui_range(prop, -10, 10, 0.5, 2);
+ RNA_def_property_ui_range(prop, -10, 10, 1, 3);
RNA_def_property_ui_text(prop, "Factor", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2013,12 +2064,12 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Limits", "Lower/Upper limits for deform");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "lock_x_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_X);
RNA_def_property_ui_text(prop, "Lock X Axis", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "lock_y_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_Y);
RNA_def_property_ui_text(prop, "Lock Y Axis", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2051,11 +2102,11 @@ static void rna_def_modifier_solidify(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Thickness", "Thickness of the shell");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "offset_fac");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -1, 1, 0.1, 4);
- RNA_def_property_ui_text(prop, "Offset", "");
+ RNA_def_property_ui_text(prop, "Offset", "Offset the thickness from the center");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "edge_crease_inner", PROP_FLOAT, PROP_FACTOR);
@@ -2089,6 +2140,11 @@ static void rna_def_modifier_solidify(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_RIM);
RNA_def_property_ui_text(prop, "Fill Rim", "Create edge loops between the inner and outer surfaces on face edges (slow, disable when not needed)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "use_rim_material", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_RIM_MATERIAL);
+ RNA_def_property_ui_text(prop, "Rim Material", "Use in the next material for rim faces");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "use_even_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_EVEN);
@@ -2100,10 +2156,12 @@ static void rna_def_modifier_solidify(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "High Quality Normals", "Calculate normals which result in more even thickness (slow, disable when not needed)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_VGROUP_INV);
RNA_def_property_ui_text(prop, "Vertex Group Invert", "Invert the vertex group influence");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+
}
static void rna_def_modifier_screw(BlenderRNA *brna)
@@ -2180,7 +2238,7 @@ static void rna_def_modifier_screw(BlenderRNA *brna)
/*prop= RNA_def_property(srna, "use_angle_object", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_ANGLE);
- RNA_def_property_ui_text(prop, "Object Angle", "Use the angle between the objects rather then the fixed angle");
+ RNA_def_property_ui_text(prop, "Object Angle", "Use the angle between the objects rather than the fixed angle");
RNA_def_property_update(prop, 0, "rna_Modifier_update");*/
}
@@ -2211,30 +2269,30 @@ void RNA_def_modifier(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "");
/* flags */
- prop= RNA_def_property(srna, "realtime", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_viewport", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime);
RNA_def_property_ui_text(prop, "Realtime", "Realtime display of a modifier");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0);
- prop= RNA_def_property(srna, "render", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render);
RNA_def_property_ui_text(prop, "Render", "Use modifier during rendering");
RNA_def_property_ui_icon(prop, ICON_SCENE, 0);
- prop= RNA_def_property(srna, "editmode", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode);
RNA_def_property_ui_text(prop, "Editmode", "Use modifier while in the edit mode");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0);
- prop= RNA_def_property(srna, "on_cage", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_on_cage", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_OnCage);
RNA_def_property_ui_text(prop, "On Cage", "Enable direct editing of modifier control cage");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded);
RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index accb40d2223..15c8608e523 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -314,7 +314,7 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_enum_items(prop, nla_mode_extend_items);
RNA_def_property_ui_text(prop, "Extrapolation", "Action to take for gaps past the strip extents");
- prop= RNA_def_property(srna, "blending", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendmode");
RNA_def_property_enum_items(prop, nla_mode_blend_items);
RNA_def_property_ui_text(prop, "Blending", "Method used for combining strip's result with accumulated result");
@@ -343,7 +343,7 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_out_set", NULL);
RNA_def_property_ui_text(prop, "Blend Out", "");
- prop= RNA_def_property(srna, "auto_blending", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_AUTO_BLENDS);
RNA_def_property_ui_text(prop, "Auto Blend In/Out", "Number of frames for Blending In/Out is automatically determined from overlapping strips");
@@ -401,17 +401,17 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate");
// TODO: should the animated_influence/time settings be animatable themselves?
- prop= RNA_def_property(srna, "animated_influence", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_animated_influence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_influence_set");
RNA_def_property_ui_text(prop, "Animated Influence", "Influence setting is controlled by an F-Curve rather than automatically determined");
- prop= RNA_def_property(srna, "animated_time", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_animated_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME);
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set");
RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined");
- prop= RNA_def_property(srna, "animated_time_cyclic", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_animated_time_cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic Strip Time", "Cycle the animated time within the action start & end");
RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); // is there a better update flag?
@@ -422,15 +422,15 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "NLA Strip is active");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_SELECT);
- RNA_def_property_ui_text(prop, "Selected", "NLA Strip is selected");
+ RNA_def_property_ui_text(prop, "Select", "NLA Strip is selected");
- prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_MUTED);
RNA_def_property_ui_text(prop, "Muted", "NLA Strip is not evaluated");
- prop= RNA_def_property(srna, "reversed", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_REVERSE);
RNA_def_property_ui_text(prop, "Reversed", "NLA Strip is played back in reverse order (only when timing is automatically determined)");
@@ -463,20 +463,20 @@ static void rna_def_nlatrack(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "NLA Track is active");
- prop= RNA_def_property(srna, "solo", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SOLO);
RNA_def_property_ui_text(prop, "Solo", "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the same AnimData block are disabled)");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SELECTED);
- RNA_def_property_ui_text(prop, "Selected", "NLA Track is selected");
+ RNA_def_property_ui_text(prop, "Select", "NLA Track is selected");
- prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_MUTED);
RNA_def_property_ui_text(prop, "Muted", "NLA Track is not evaluated");
- prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_PROTECTED);
RNA_def_property_ui_text(prop, "Locked", "NLA Track is locked");
}
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 82d0f0b3e6e..5044518ca93 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -139,6 +139,24 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value)
chroma->t2 = value;
}
+static void rna_Image_start_frame_set(PointerRNA *ptr, int value)
+{
+ bNode *node= (bNode*)ptr->data;
+ NodeImageFile *image = node->storage;
+
+ CLAMP(value, MINFRAME, image->efra);
+ image->sfra= value;
+}
+
+static void rna_Image_end_frame_set(PointerRNA *ptr, int value)
+{
+ bNode *node= (bNode*)ptr->data;
+ NodeImageFile *image = node->storage;
+
+ CLAMP(value, image->sfra, MAXFRAME);
+ image->efra= value;
+}
+
static void node_update(Main *bmain, Scene *scene, bNodeTree *ntree, bNode *node)
{
ED_node_generic_update(bmain, scene, ntree, node);
@@ -638,12 +656,12 @@ static void def_time(StructRNA *srna)
RNA_def_property_ui_text(prop, "Curve", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "end", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_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, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -670,7 +688,7 @@ static void def_mix_rgb(StructRNA *srna)
RNA_def_property_ui_text(prop, "Blend Type", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
RNA_def_property_ui_text(prop, "Alpha", "Include alpha of second input in this operation");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -707,12 +725,12 @@ static void def_sh_material(StructRNA *srna)
RNA_def_property_ui_text(prop, "Material", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -747,23 +765,23 @@ static void def_sh_mapping(StructRNA *srna)
RNA_def_property_ui_range(prop, -10.f, 10.f, 0.1f, 2);
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_mapping_update");
- prop = RNA_def_property(srna, "clamp_minimum", PROP_BOOLEAN, PROP_NONE);
+ 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, "Clamp Minimum", "Clamp the output coordinate to a minimum value");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_XYZ);
+ prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum", "Minimum value to clamp coordinate to");
RNA_def_property_ui_range(prop, -10.f, 10.f, 0.1f, 2);
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "clamp_maximum", PROP_BOOLEAN, PROP_NONE);
+ 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, "Clamp Maximum", "Clamp the output coordinate to a maximum value");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_XYZ);
+ prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum", "Maximum value to clamp coordinate to");
RNA_def_property_ui_range(prop, -10.f, 10.f, 0.1f, 2);
@@ -795,7 +813,7 @@ static void def_cmp_alpha_over(StructRNA *srna)
PropertyRNA *prop;
// XXX: Tooltip
- prop = RNA_def_property(srna, "convert_premul", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
RNA_def_property_ui_text(prop, "Convert Premul", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -815,19 +833,19 @@ static void def_cmp_hue_saturation(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeHueSat", "storage");
- prop = RNA_def_property(srna, "hue", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "sat", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_saturation", 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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "val", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_value", 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", "");
@@ -851,21 +869,21 @@ static void def_cmp_blur(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeBlurData", "storage");
- prop = RNA_def_property(srna, "sizex", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "size_x", PROP_INT, PROP_NONE);
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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "sizey", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "size_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sizey");
RNA_def_property_range(prop, 0, 256);
RNA_def_property_ui_text(prop, "Size Y", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "relative", 1);
- RNA_def_property_ui_text(prop, "Relative", "");
+ RNA_def_property_ui_text(prop, "Relative", "Use relative (percent) values to define blur radius");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
@@ -892,14 +910,14 @@ static void def_cmp_blur(StructRNA *srna)
RNA_def_property_ui_text(prop, "Filter Type", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "bokeh", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bokeh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bokeh", 1);
- RNA_def_property_ui_text(prop, "Bokeh", "");
+ RNA_def_property_ui_text(prop, "Bokeh", "Uses circular filter (slower)");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "gamma", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_gamma_correction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gamma", 1);
- RNA_def_property_ui_text(prop, "Gamma", "");
+ RNA_def_property_ui_text(prop, "Gamma", "Applies filter on gamma corrected values");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
}
@@ -968,25 +986,29 @@ 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_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Samples", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "min_speed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "speed_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "minspeed");
+ RNA_def_property_range(prop, 0, 1024);
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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "max_speed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "speed_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxspeed");
+ RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Max Speed", "Maximum speed, or zero for none");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "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, "Blur Factor", "Scaling factor for motion vectors; actually 'shutter speed' in frames");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "curved", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1033,30 +1055,30 @@ static void def_cmp_image(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "ImageUser", "storage");
- prop = RNA_def_property(srna, "frames", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frames");
- RNA_def_property_range(prop, 1, MAXFRAMEF);
+ RNA_def_property_range(prop, 0, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Frames", "Number of images used in animation");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "auto_refresh", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1115,9 +1137,9 @@ static void def_cmp_output_file(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeImageFile", "storage");
- prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Filename", "");
+ RNA_def_property_ui_text(prop, "File Path", "Output path for the image, same functionality as render output.");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "image_type", PROP_ENUM, PROP_NONE);
@@ -1126,7 +1148,7 @@ static void def_cmp_output_file(StructRNA *srna)
RNA_def_property_ui_text(prop, "Image Type", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "exr_half", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_exr_half", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
RNA_def_property_ui_text(prop, "Half", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1142,16 +1164,17 @@ static void def_cmp_output_file(StructRNA *srna)
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Quality", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
-
- // TODO: should these be limited to the extents of the each other so that no cross-over occurs?
+
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sfra");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Image_start_frame_set", NULL);
RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "efra");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Image_end_frame_set", NULL);
RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "End Frame", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1176,6 +1199,7 @@ static void def_cmp_scale(StructRNA *srna)
{0, "RELATIVE", 0, "Relative", ""},
{1, "ABSOLUTE", 0, "Absolute", ""},
{2, "SCENE_SIZE", 0, "Scene Size", ""},
+ {3, "RENDER_SIZE", 0, "Render Size", ""},
{0, NULL, 0, NULL, NULL}};
prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE);
@@ -1195,7 +1219,7 @@ static void def_cmp_rotate(StructRNA *srna)
{2, "BICUBIC", 0, "Bicubic", ""},
{0, NULL, 0, NULL, NULL}};
- prop = RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE);
+ 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, rotate_items);
RNA_def_property_ui_text(prop, "Filter", "Method to use to filter rotation");
@@ -1229,19 +1253,19 @@ static void def_cmp_color_matte(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
- prop = RNA_def_property(srna, "h", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_hue", PROP_FLOAT, PROP_NONE);
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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "s", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_saturation", 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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "v", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_value", 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");
@@ -1296,7 +1320,7 @@ static void def_cmp_color_spill(StructRNA *srna)
RNA_def_property_ui_text(prop, "Channel", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "algorithm", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom2");
RNA_def_property_enum_items(prop, algorithm_items);
RNA_def_property_ui_text(prop, "Algorithm", "");
@@ -1316,7 +1340,7 @@ static void def_cmp_color_spill(StructRNA *srna)
RNA_def_property_ui_text(prop, "Ratio", "Scale limit by value");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "unspill", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_unspill", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "unspill", 0);
RNA_def_property_ui_text(prop, "Unspill", "Compensate all channels (diffenrently) by hand");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1346,14 +1370,14 @@ static void def_cmp_luma_matte(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
- prop = RNA_def_property(srna, "high", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL);
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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "low", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL);
RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -1367,14 +1391,14 @@ static void def_cmp_chroma_matte(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
- prop = RNA_def_property(srna, "acceptance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL);
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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "cutoff", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL);
RNA_def_property_range(prop, 0.0f, 30.0f);
@@ -1422,7 +1446,7 @@ static void def_cmp_channel_matte(StructRNA *srna)
RNA_def_property_ui_text(prop, "Color Space", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop= RNA_def_property(srna, "channel", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "matte_channel", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom2");
RNA_def_property_enum_items(prop, prop_tri_channel_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf");
@@ -1431,7 +1455,7 @@ static void def_cmp_channel_matte(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
- prop = RNA_def_property(srna, "algorithm", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "algorithm");
RNA_def_property_enum_items(prop, algorithm_items);
RNA_def_property_ui_text(prop, "Algorithm", "Algorithm to use to limit channel");
@@ -1444,14 +1468,14 @@ static void def_cmp_channel_matte(StructRNA *srna)
RNA_def_property_ui_text(prop, "Limit Channel", "Limit by this channels value");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "high", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL);
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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "low", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL);
RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -1543,7 +1567,7 @@ static void def_cmp_defocus(StructRNA *srna)
RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset in degrees");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "gamma_correction", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1555,7 +1579,7 @@ static void def_cmp_defocus(StructRNA *srna)
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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "max_blur", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "blur_max", 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");
@@ -1567,7 +1591,7 @@ static void def_cmp_defocus(StructRNA *srna)
RNA_def_property_ui_text(prop, "Threshold", "CoC radius threshold, prevents background bleed on in-focus midground, 0=off");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "preview", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1594,12 +1618,12 @@ static void def_cmp_invert(StructRNA *srna)
{
PropertyRNA *prop;
- prop = RNA_def_property(srna, "rgb", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_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, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1609,36 +1633,65 @@ static void def_cmp_crop(StructRNA *srna)
{
PropertyRNA *prop;
- prop = RNA_def_property(srna, "crop_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
-
+
+ prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
+ RNA_def_property_ui_text(prop, "Relative", "Use relative values to crop image");
+ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
RNA_def_struct_sdna_from(srna, "NodeTwoXYs", "storage");
- prop = RNA_def_property(srna, "x1", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "min_x", PROP_INT, PROP_NONE);
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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "x2", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "max_x", 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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "y1", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "min_y", 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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "y2", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "max_y", 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, NC_NODE|NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "rel_min_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fac_x1");
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "X1", "");
+ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "rel_max_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fac_x2");
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "X2", "");
+ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "rel_min_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fac_y1");
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Y1", "");
+ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "rel_max_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fac_y2");
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Y2", "");
+ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
}
static void def_cmp_dblur(StructRNA *srna)
@@ -1653,7 +1706,7 @@ static void def_cmp_dblur(StructRNA *srna)
RNA_def_property_ui_text(prop, "Iterations", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_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, "wrap", 1);
RNA_def_property_ui_text(prop, "Wrap", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1810,7 +1863,7 @@ static void def_cmp_glare(StructRNA *srna)
RNA_def_property_ui_text(prop, "Fade", "Streak fade-out factor");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "rotate_45", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1890,17 +1943,17 @@ static void def_cmp_lensdist(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeLensDist", "storage");
- prop = RNA_def_property(srna, "projector", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "jitter", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "fit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_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, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -1916,7 +1969,7 @@ static void def_cmp_colorbalance(StructRNA *srna)
{1, "OFFSET_POWER_SLOPE", 0, "Offset/Power/Slope (ASC-CDL)", "ASC-CDL standard color correction"},
{0, NULL, 0, NULL, NULL}};
- prop = RNA_def_property(srna, "correction_formula", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "correction_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Correction Formula", "");
@@ -1993,7 +2046,7 @@ static void def_tex_output(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "TexNodeOutput", "storage");
- prop = RNA_def_property(srna, "output_name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "filepath", 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, NC_NODE|NA_EDITED, "rna_Node_update");
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index a0c638b484b..45407a8e375 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -33,6 +33,7 @@
#include "DNA_action_types.h"
#include "DNA_customdata_types.h"
+#include "DNA_controller_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_object_force.h"
@@ -40,6 +41,9 @@
#include "DNA_property_types.h"
#include "DNA_scene_types.h"
+#include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
+#include "ED_mesh.h"
+
#include "WM_api.h"
#include "WM_types.h"
@@ -121,25 +125,61 @@ EnumPropertyItem object_type_curve_items[] = {
#include "BKE_mesh.h"
#include "BKE_particle.h"
#include "BKE_scene.h"
+#include "BKE_deform.h"
#include "BLI_editVert.h" /* for EditMesh->mat_nr */
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_particle.h"
+#include "ED_curve.h"
+#include "ED_lattice.h"
-void rna_Object_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Object_internal_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
DAG_id_flush_update(ptr->id.data, OB_RECALC_OB);
}
-void rna_Object_matrix_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Object_matrix_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
object_apply_mat4(ptr->id.data, ((Object *)ptr->id.data)->obmat);
- rna_Object_update(bmain, scene, ptr);
+ rna_Object_internal_update(bmain, scene, ptr);
+}
+
+static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16])
+{
+ Object *ob= ptr->id.data;
+
+ if(ob->parent) {
+ float invmat[4][4]; /* for inverse of parent's matrix */
+ invert_m4_m4(invmat, ob->parent->obmat);
+ mul_m4_m4m4((float(*)[4])values, ob->obmat, invmat);
+ }
+ else {
+ copy_m4_m4((float(*)[4])values, ob->obmat);
+ }
+}
+
+static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16])
+{
+ Object *ob= ptr->id.data;
+
+ /* localspace matrix is truly relative to the parent, but parameters
+ * stored in object are relative to parentinv matrix. Undo the parent
+ * inverse part before updating obmat and calling apply_obmat() */
+ if(ob->parent) {
+ float invmat[4][4];
+ invert_m4_m4(invmat, ob->parentinv);
+ mul_m4_m4m4(ob->obmat, (float(*)[4])values, invmat);
+ }
+ else {
+ copy_m4_m4(ob->obmat, (float(*)[4])values);
+ }
+
+ object_apply_mat4(ob, ob->obmat);
}
-void rna_Object_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+void rna_Object_internal_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ptr->id.data);
@@ -148,21 +188,33 @@ void rna_Object_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
void rna_Object_active_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Object *ob= ptr->id.data;
- int editmode= (scene->obedit == ob && ob->type == OB_MESH);
- if(editmode) {
+ if(scene->obedit == ob) {
/* exit/enter editmode to get new shape */
- load_editMesh(scene, ob);
- make_editMesh(scene, ob);
+ switch(ob->type) {
+ case OB_MESH:
+ load_editMesh(scene, ob);
+ make_editMesh(scene, ob);
+ break;
+ case OB_CURVE:
+ case OB_SURF:
+ load_editNurb(ob);
+ make_editNurb(ob);
+ break;
+ case OB_LATTICE:
+ load_editLatt(ob);
+ make_editLatt(ob);
+ break;
+ }
}
- rna_Object_update_data(bmain, scene, ptr);
+ rna_Object_internal_update_data(bmain, scene, ptr);
}
static void rna_Object_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
DAG_id_flush_update(ptr->id.data, OB_RECALC_OB);
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
}
/* when changing the selection flag the scene needs updating */
@@ -180,7 +232,7 @@ static void rna_Base_select_update(Main *bmain, Scene *scene, PointerRNA *ptr)
ED_base_object_select(base, mode);
}
-static void rna_Object_layer_update__internal(Scene *scene, Base *base, Object *ob)
+static void rna_Object_layer_update__internal(Main *bmain, Scene *scene, Base *base, Object *ob)
{
/* try to avoid scene sort */
if((ob->lay & scene->lay) && (base->lay & scene->lay)) {
@@ -188,7 +240,7 @@ static void rna_Object_layer_update__internal(Scene *scene, Base *base, Object *
} else if((ob->lay & scene->lay)==0 && (base->lay & scene->lay)==0) {
/* pass */
} else {
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
}
}
@@ -203,16 +255,16 @@ static void rna_Object_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
SWAP(int, base->lay, ob->lay);
- rna_Object_layer_update__internal(scene, base, ob);
+ rna_Object_layer_update__internal(bmain, scene, base, ob);
ob->lay= base->lay;
}
static void rna_Base_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Base *base= (Base*)ptr->id.data;
+ Base *base= (Base*)ptr->data;
Object *ob= (Object*)base->object;
- rna_Object_layer_update__internal(scene, base, ob);
+ rna_Object_layer_update__internal(bmain, scene, base, ob);
ob->lay= base->lay;
}
@@ -400,32 +452,19 @@ int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index)
void rna_object_vgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
{
Object *ob= (Object*)ptr->id.data;
- bDeformGroup *dg;
- int a;
-
- for(a=1, dg=ob->defbase.first; dg; dg=dg->next, a++) {
- if(strcmp(dg->name, value) == 0) {
- *index= a;
- return;
- }
- }
-
- *index= 0;
+ *index= defgroup_name_index(ob, value) + 1;
}
void rna_object_vgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
{
Object *ob= (Object*)ptr->id.data;
- bDeformGroup *dg;
-
- for(dg=ob->defbase.first; dg; dg=dg->next) {
- if(strcmp(dg->name, value) == 0) {
- BLI_strncpy(result, value, maxlen);
- return;
- }
+ bDeformGroup *dg= defgroup_find_name(ob, value);
+ if(dg) {
+ BLI_strncpy(result, value, maxlen);
+ return;
}
- BLI_strncpy(result, "", maxlen);
+ result[0]= '\0';
}
void rna_object_uvlayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
@@ -858,25 +897,52 @@ static void rna_Base_layer_set(PointerRNA *ptr, const int *values)
/* rna_Base_layer_update updates the objects layer */
}
+static void rna_GameObjectSettings_state_get(PointerRNA *ptr, int *values)
+{
+ Object *ob= (Object*)ptr->data;
+ int i;
+ int all_states = (ob->scaflag & OB_ALLSTATE?1:0);
+
+ memset(values, 0, sizeof(int)*OB_MAX_STATES);
+ for(i=0; i<OB_MAX_STATES; i++)
+ values[i] = (ob->state & (1<<i)) | all_states;
+}
+
static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values)
{
Object *ob= (Object*)ptr->data;
int i, tot= 0;
/* ensure we always have some state selected */
- for(i=0; i<20; i++)
+ for(i=0; i<OB_MAX_STATES; i++)
if(values[i])
tot++;
if(tot==0)
return;
- for(i=0; i<20; i++) {
+ for(i=0; i<OB_MAX_STATES; i++) {
if(values[i]) ob->state |= (1<<i);
else ob->state &= ~(1<<i);
}
}
+static void rna_GameObjectSettings_used_state_get(PointerRNA *ptr, int *values)
+{
+ Object *ob= (Object*)ptr->data;
+ bController *cont;
+
+ memset(values, 0, sizeof(int)*OB_MAX_STATES);
+ for (cont=ob->controllers.first; cont; cont=cont->next) {
+ int i;
+
+ for (i=0; i<OB_MAX_STATES; i++) {
+ if (cont->state_mask & (1<<i))
+ values[i] = 1;
+ }
+ }
+}
+
static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max)
{
Object *ob= (Object*)ptr->id.data;
@@ -951,31 +1017,32 @@ static void rna_Object_active_constraint_set(PointerRNA *ptr, PointerRNA value)
constraints_set_active(&ob->constraints, (bConstraint *)value.data);
}
-static bConstraint *rna_Object_constraint_new(Object *object, bContext *C, int type)
+static bConstraint *rna_Object_constraints_new(Object *object, int type)
{
WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
return add_ob_constraint(object, NULL, type);
}
-static int rna_Object_constraint_remove(Object *object, bContext *C, int index)
+static void rna_Object_constraints_remove(Object *object, ReportList *reports, bConstraint *con)
{
- int ok = remove_constraint_index(&object->constraints, index);
- if(ok) {
- ED_object_constraint_set_active(object, NULL);
- WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, object);
+ if(BLI_findindex(&object->constraints, con) == -1) {
+ BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'.", con->name, object->id.name+2);
+ return;
}
- return ok;
+ remove_constraint(&object->constraints, con);
+ ED_object_constraint_set_active(object, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, object);
}
static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, ReportList *reports, char *name, int type)
{
- return ED_object_modifier_add(reports, CTX_data_scene(C), object, name, type);
+ return ED_object_modifier_add(reports, CTX_data_main(C), CTX_data_scene(C), object, name, type);
}
static void rna_Object_modifier_remove(Object *object, bContext *C, ReportList *reports, ModifierData *md)
{
- ED_object_modifier_remove(reports, CTX_data_scene(C), object, md);
+ ED_object_modifier_remove(reports, CTX_data_main(C), CTX_data_scene(C), object, md);
}
static void rna_Object_boundbox_get(PointerRNA *ptr, float *values)
@@ -991,6 +1058,38 @@ static void rna_Object_boundbox_get(PointerRNA *ptr, float *values)
}
+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);
+}
+
+/* generic poll functions */
+int rna_Lattice_object_poll(PointerRNA *ptr, PointerRNA value)
+{
+ return ((Object *)value.id.data)->type == OB_LATTICE;
+}
+
+int rna_Curve_object_poll(PointerRNA *ptr, PointerRNA value)
+{
+ return ((Object *)value.id.data)->type == OB_CURVE;
+}
+
+int rna_Armature_object_poll(PointerRNA *ptr, PointerRNA value)
+{
+ return ((Object *)value.id.data)->type == OB_ARMATURE;
+}
+
+int rna_Mesh_object_poll(PointerRNA *ptr, PointerRNA value)
+{
+ return ((Object *)value.id.data)->type == OB_MESH;
+}
+
+int rna_Camera_object_poll(PointerRNA *ptr, PointerRNA value)
+{
+ return ((Object *)value.id.data)->type == OB_CAMERA;
+}
+
#else
static void rna_def_vertex_group(BlenderRNA *brna)
@@ -1035,15 +1134,15 @@ static void rna_def_material_slot(BlenderRNA *brna)
prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Material", "Material datablock used by this material slot");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "link", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, link_items);
RNA_def_property_enum_funcs(prop, "rna_MaterialSlot_link_get", "rna_MaterialSlot_link_set", NULL);
RNA_def_property_ui_text(prop, "Link", "Link material to object or the object's data");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_MaterialSlot_name_get", "rna_MaterialSlot_name_length", NULL);
@@ -1111,12 +1210,13 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_enum_items(prop, body_type_items);
RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get", "rna_GameObjectSettings_physics_type_set", NULL);
RNA_def_property_ui_text(prop, "Physics Type", "Selects the type of physical representation");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "actor", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_actor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ACTOR);
RNA_def_property_ui_text(prop, "Actor", "Object is detected by the Near and Radar sensor");
- prop= RNA_def_property(srna, "ghost", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_GHOST);
RNA_def_property_ui_text(prop, "Ghost", "Object does not restitute collisions, like a ghost");
@@ -1130,7 +1230,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Radius", "Radius of bounding sphere and material physics");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "no_sleeping", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_sleep", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_COLLISION_RESPONSE);
RNA_def_property_ui_text(prop, "No Sleeping", "Disable auto (de)activation in physics simulation");
@@ -1144,40 +1244,40 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Rotation Damping", "General rotation damping");
- prop= RNA_def_property(srna, "minimum_velocity", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "velocity_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min_vel");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Velocity Min", "Clamp velocity to this minimum speed (except when totally still)");
- prop= RNA_def_property(srna, "maximum_velocity", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max_vel");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Velocity Max", "Clamp velocity to this maximum speed");
/* lock position */
- prop= RNA_def_property(srna, "lock_x_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_AXIS);
RNA_def_property_ui_text(prop, "Lock X Axis", "Disable simulation of linear motion along the X axis");
- prop= RNA_def_property(srna, "lock_y_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_AXIS);
RNA_def_property_ui_text(prop, "Lock Y Axis", "Disable simulation of linear motion along the Y axis");
- prop= RNA_def_property(srna, "lock_z_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_AXIS);
RNA_def_property_ui_text(prop, "Lock Z Axis", "Disable simulation of linear motion along the Z axis");
/* lock rotation */
- prop= RNA_def_property(srna, "lock_x_rot_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_ROT_AXIS);
RNA_def_property_ui_text(prop, "Lock X Rotation Axis", "Disable simulation of angular motion along the X axis");
- prop= RNA_def_property(srna, "lock_y_rot_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_ROT_AXIS);
RNA_def_property_ui_text(prop, "Lock Y Rotation Axis", "Disable simulation of angular motion along the Y axis");
- prop= RNA_def_property(srna, "lock_z_rot_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_ROT_AXIS);
RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
@@ -1187,11 +1287,11 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
- prop= RNA_def_property(srna, "material_physics", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_material_physics", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH);
RNA_def_property_ui_text(prop, "Use Material Physics", "Use physics settings in materials");
- prop= RNA_def_property(srna, "rotate_from_normal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_rotate_from_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ROT_FH);
RNA_def_property_ui_text(prop, "Rotate From Normal", "Use face normal to rotate object, so that it points away from the surface");
@@ -1200,7 +1300,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Form Factor", "Form factor scales the inertia tensor");
- prop= RNA_def_property(srna, "anisotropic_friction", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_anisotropic_friction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ANISOTROPIC_FRICTION);
RNA_def_property_ui_text(prop, "Anisotropic Friction", "Enable anisotropic friction");
@@ -1213,16 +1313,16 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_BOUNDS);
RNA_def_property_ui_text(prop, "Use Collision Bounds", "Specify a collision bounds type other than the default");
- prop= RNA_def_property(srna, "collision_bounds", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "collision_bounds_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "boundtype");
RNA_def_property_enum_items(prop, collision_bounds_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Object_collision_bounds_itemf");
RNA_def_property_ui_text(prop, "Collision Bounds", "Selects the collision type");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "collision_compound", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_collision_compound", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_CHILD);
- RNA_def_property_ui_text(prop, "Collison Compound", "Add children to form a compound collision object");
+ RNA_def_property_ui_text(prop, "Collision Compound", "Add children to form a compound collision object");
prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "margin");
@@ -1235,20 +1335,36 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
/* state */
- prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "states_visible", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "state", 1);
- RNA_def_property_array(prop, 30);
+ RNA_def_property_array(prop, OB_MAX_STATES);
RNA_def_property_ui_text(prop, "State", "State determining which controllers are displayed");
- RNA_def_property_boolean_funcs(prop, NULL, "rna_GameObjectSettings_state_set");
+ RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_state_get", "rna_GameObjectSettings_state_set");
- prop= RNA_def_property(srna, "initial_state", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "used_states", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ RNA_def_property_array(prop, OB_MAX_STATES);
+ RNA_def_property_ui_text(prop, "Used State", "States which are being used by controllers");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_used_state_get", NULL);
+
+ prop= RNA_def_property(srna, "states_initial", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "init_state", 1);
- RNA_def_property_array(prop, 30);
+ RNA_def_property_array(prop, OB_MAX_STATES);
RNA_def_property_ui_text(prop, "Initial State", "Initial state when the game starts");
- prop= RNA_def_property(srna, "debug_state", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_debug_state", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_DEBUGSTATE);
RNA_def_property_ui_text(prop, "Debug State", "Print state debug info in the game engine");
+ RNA_def_property_ui_icon(prop, ICON_INFO, 0);
+
+ prop= RNA_def_property(srna, "use_all_states", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_ALLSTATE);
+ RNA_def_property_ui_text(prop, "All", "Set all state bits");
+
+ prop= RNA_def_property(srna, "show_state_panel", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWSTATE);
+ RNA_def_property_ui_text(prop, "States", "Show state panel");
+ RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
}
static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
@@ -1268,34 +1384,30 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
/* Collection active property */
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
- RNA_def_property_pointer_funcs(prop, "rna_Object_active_constraint_get", "rna_Object_active_constraint_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Object_active_constraint_get", "rna_Object_active_constraint_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint");
/* Constraint collection */
- func= RNA_def_function(srna, "new", "rna_Object_constraint_new");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ func= RNA_def_function(srna, "new", "rna_Object_constraints_new");
RNA_def_function_ui_description(func, "Add a new constraint to this object");
- /* return type */
- parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint.");
- RNA_def_function_return(func, parm);
/* object to add */
parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add.");
RNA_def_property_flag(parm, PROP_REQUIRED);
-
- func= RNA_def_function(srna, "remove", "rna_Object_constraint_remove");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- RNA_def_function_ui_description(func, "Remove a constraint from this object.");
/* return type */
- parm= RNA_def_boolean(func, "success", 0, "Success", "Removed the constraint successfully.");
+ parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint.");
RNA_def_function_return(func, parm);
- /* object to add */
- parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "", 0, INT_MAX);
- RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "remove", "rna_Object_constraints_remove");
+ RNA_def_function_ui_description(func, "Remove a constraint from this object.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ /* constraint to remove */
+ parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
-/* armature.bones.* */
+/* object.modifiers */
static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
@@ -1315,7 +1427,7 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active EditBone", "Armatures active edit bone");
//RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL, NULL);
/* todo, redraw */
// RNA_def_property_collection_active(prop, prop_act);
@@ -1324,7 +1436,7 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
/* add target */
func= RNA_def_function(srna, "new", "rna_Object_modifier_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Add a new bone.");
+ RNA_def_function_ui_description(func, "Add a new modifier.");
parm= RNA_def_string(func, "name", "Name", 0, "", "New name for the bone.");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* modifier to add */
@@ -1340,9 +1452,92 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove an existing modifier from the object.");
/* target to remove*/
parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+}
+
+/* object.particle_systems */
+static void rna_def_object_particle_systems(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+
+ PropertyRNA *prop;
+
+ // FunctionRNA *func;
+ // PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "ParticleSystems");
+ srna= RNA_def_struct(brna, "ParticleSystems", NULL);
+ RNA_def_struct_sdna(srna, "Object");
+ RNA_def_struct_ui_text(srna, "Particle Systems", "Collection of particle systems");
+
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ParticleSystem");
+ RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range");
+ RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_particle_update");
+}
+
+
+/* object.vertex_groups */
+static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ static EnumPropertyItem assign_mode_items[] = {
+ {WEIGHT_REPLACE, "REPLACE", 0, "Replace", "Replace"},
+ {WEIGHT_ADD, "ADD", 0, "Add", "Add"},
+ {WEIGHT_SUBTRACT, "SUBTRACT", 0, "Subtract", "Subtract"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ StructRNA *srna;
+
+ PropertyRNA *prop;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "VertexGroups");
+ srna= RNA_def_struct(brna, "VertexGroups", NULL);
+ RNA_def_struct_sdna(srna, "Object");
+ RNA_def_struct_ui_text(srna, "Vertex Groups", "Collection of vertex groups");
+
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "VertexGroup");
+ RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object");
+ RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data");
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "actdef");
+ RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range");
+ RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array");
+ RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data");
+
+ /* vertex groups */ // add_vertex_group
+ func= RNA_def_function(srna, "new", "ED_vgroup_add_name");
+ 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);
+
+ // XXX, this will be very slow, bad API design! :S
+ func= RNA_def_function(srna, "assign", "rna_Object_add_vertex_to_group");
+ RNA_def_function_ui_description(func, "Add vertex to a vertex group.");
+ parm= RNA_def_int(func, "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);
}
+
static void rna_def_object(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1357,7 +1552,6 @@ static void rna_def_object(BlenderRNA *brna)
{OB_MBALL, "META", 0, "Meta", ""},
{OB_LAMP, "LAMP", 0, "Lamp", ""},
{OB_CAMERA, "CAMERA", 0, "Camera", ""},
- {OB_WAVE, "WAVE", 0, "Wave", ""},
{OB_LATTICE, "LATTICE", 0, "Lattice", ""},
{OB_ARMATURE, "ARMATURE", 0, "Armature", ""},
{0, NULL, 0, NULL, NULL}};
@@ -1400,7 +1594,7 @@ static void rna_def_object(BlenderRNA *brna)
{OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""},
{OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
{OB_BOUND_CONE, "CONE", 0, "Cone", ""},
- {OB_BOUND_POLYH, "POLYHEDER", 0, "Polyheder", ""},
+ {OB_BOUND_POLYH, "POLYHEDRON", 0, "Polyhedron", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem dupli_items[] = {
@@ -1436,11 +1630,11 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ID");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef", NULL);
RNA_def_property_editable_func(prop, "rna_Object_data_editable");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Data", "Object data");
- RNA_def_property_update(prop, 0, "rna_Object_update_data");
+ RNA_def_property_update(prop, 0, "rna_Object_internal_update_data");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
@@ -1462,9 +1656,9 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_layer_update");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
- RNA_def_property_ui_text(prop, "Selected", "Object selection state");
+ RNA_def_property_ui_text(prop, "Select", "Object selection state");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_select_update");
/* for data access */
@@ -1472,11 +1666,11 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_multi_array(prop, 2, boundbox_dimsize);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_Object_boundbox_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Bound Box", "Objects bound box in object-space coords");
+ RNA_def_property_ui_text(prop, "Bound Box", "Objects bound box in object-space coordinates");
/* parent */
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_ui_text(prop, "Parent", "Parent Object");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
@@ -1493,7 +1687,7 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_array(prop, 3);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Parent Vertices", "Indices of vertices in cases of a vertex parenting relation");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "parsubstr");
@@ -1507,13 +1701,13 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, track_items);
RNA_def_property_ui_text(prop, "Track Axis", "Axis that points in 'forward' direction");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "upflag");
RNA_def_property_enum_items(prop, up_items);
RNA_def_property_ui_text(prop, "Up Axis", "Axis that points in the upward direction");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
/* proxy */
prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
@@ -1531,10 +1725,10 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
- RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", "rna_Object_active_material_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", "rna_Object_active_material_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "actcol");
@@ -1547,14 +1741,14 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_editable_array_func(prop, "rna_Object_location_editable");
RNA_def_property_ui_text(prop, "Location", "Location of the object");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable");
RNA_def_property_float_array_default(prop, default_quat);
RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
/* 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...
@@ -1565,81 +1759,84 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable");
RNA_def_property_float_array_default(prop, default_axisAngle);
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");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
prop= RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_euler_editable");
RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_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); // 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");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_editable_array_func(prop, "rna_Object_scale_editable");
RNA_def_property_float_array_default(prop, default_scale);
RNA_def_property_ui_text(prop, "Scale", "Scaling of the object");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ|PROP_UNIT_LENGTH);
+ prop= RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ_LENGTH);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_Object_dimensions_get", "rna_Object_dimensions_set", NULL);
RNA_def_property_ui_text(prop, "Dimensions", "Absolute bounding box dimensions of the object");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_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 translation added to the location of the object");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_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 rotation added to the rotation of the object (when using Euler rotations)");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
prop= RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "dquat");
RNA_def_property_float_array_default(prop, default_quat);
RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)", "Extra rotation added to the rotation of the object (when using Quaternion rotations)");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_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"); // FIXME: this is not a single field any more! (drotAxis and drotAngle)
RNA_def_property_float_array_default(prop, default_axisAngle);
RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)", "Extra rotation added to the rotation of the object (when using Axis-Angle rotations)");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_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 scaling added to the scale of the object");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_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");
+ RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_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");
+ RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_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_icon(prop, ICON_UNLOCKED, 1);
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);
@@ -1650,14 +1847,21 @@ static void rna_def_object(BlenderRNA *brna)
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");
+ RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
/* matrix */
- prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ prop= RNA_def_property(srna, "matrix_world", 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");
+ RNA_def_property_ui_text(prop, "Matrix World", "Worldspace transformation matrix");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_matrix_world_update");
+
+ prop= RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_multi_array(prop, 2, matrix_dimsize);
+ RNA_def_property_ui_text(prop, "Local Matrix", "Parent relative transformation matrix");
+ RNA_def_property_float_funcs(prop, "rna_Object_matrix_local_get", "rna_Object_matrix_local_set", NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL);
/* collections */
prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
@@ -1675,7 +1879,7 @@ static void rna_def_object(BlenderRNA *brna)
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_pointer_funcs(prop, "rna_Object_game_settings_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Game Settings", "Game engine related settings for the object");
/* vertex groups */
@@ -1683,18 +1887,7 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "defbase", NULL);
RNA_def_property_struct_type(prop, "VertexGroup");
RNA_def_property_ui_text(prop, "Vertex Groups", "Vertex groups of the object");
-
- prop= RNA_def_property(srna, "active_vertex_group", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "VertexGroup");
- RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL);
- RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object");
- RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_update_data");
-
- prop= RNA_def_property(srna, "active_vertex_group_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "actdef");
- RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range");
- RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array");
- RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_update_data");
+ rna_def_object_vertex_groups(brna, prop);
/* empty */
prop= RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE);
@@ -1705,8 +1898,8 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "empty_draw_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "empty_drawsize");
- RNA_def_property_range(prop, 0.1f, 1000.0f);
- RNA_def_property_ui_range(prop, 0.01, 100, 1, 1);
+ RNA_def_property_range(prop, 0.0001f, 1000.0f);
+ RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
RNA_def_property_ui_text(prop, "Empty Display Size", "Size of display for empties in the viewport");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
@@ -1725,13 +1918,13 @@ static void rna_def_object(BlenderRNA *brna)
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");
- RNA_def_property_pointer_funcs(prop, "rna_Object_field_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Object_field_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Field Settings", "Settings for using the objects as a field in physics simulation");
prop= RNA_def_property(srna, "collision", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "CollisionSettings");
- RNA_def_property_pointer_funcs(prop, "rna_Object_collision_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Object_collision_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Collision Settings", "Settings for using the objects as a collider in physics simulation");
prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
@@ -1743,32 +1936,25 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "particlesystem", NULL);
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object");
-
- prop= RNA_def_property(srna, "active_particle_system", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "ParticleSystem");
- RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
-
- prop= RNA_def_property(srna, "active_particle_system_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range");
- RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_particle_update");
+ rna_def_object_particle_systems(brna, prop);
/* restrict */
- prop= RNA_def_property(srna, "restrict_view", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide", 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");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "restrict_select", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_SELECT);
RNA_def_property_ui_text(prop, "Restrict Select", "Restrict selection in the viewport");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 1);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "restrict_render", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER);
RNA_def_property_ui_text(prop, "Restrict Render", "Restrict renderability");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* anim */
@@ -1779,10 +1965,10 @@ static void rna_def_object(BlenderRNA *brna)
/* duplicates */
// XXX: evil old crap
- prop= RNA_def_property(srna, "slow_parent", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_slow_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "partype", PARSLOW);
RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "dupli_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag");
@@ -1793,9 +1979,9 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_dupli_frames_speed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED);
RNA_def_property_ui_text(prop, "Dupli Frames Speed", "Set dupliframes to use the frame"); // TODO, better descriptio!
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "use_dupli_verts_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_dupli_vertices_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT);
RNA_def_property_ui_text(prop, "Dupli Verts Rotation", "Rotate dupli according to vertex normal");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
@@ -1803,7 +1989,7 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_dupli_faces_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIFACES_SCALE);
RNA_def_property_ui_text(prop, "Dupli Faces Inherit Scale", "Scale dupli based on face size");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dupfacesca");
@@ -1821,67 +2007,71 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "dupsta");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupend");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupon");
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_range(prop, 1, 1500, 1, 0);
RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupoff");
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_range(prop, 0, 1500, 1, 0);
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");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
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");
+ prop= RNA_def_property(srna, "is_duplicator", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLI);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
/* 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);
- RNA_def_property_ui_text(prop, "Time Offset", "Animation offset in frames for IPO's and dupligroup instances");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_ui_text(prop, "Time Offset", "Animation offset in frames for F-Curve and dupligroup instances");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "time_offset_edit", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_time_offset_edit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_OB);
- RNA_def_property_ui_text(prop, "Time Offset Edit", "Use time offset when inserting keys and display time offset for IPO and action views");
+ RNA_def_property_ui_text(prop, "Time Offset Edit", "Use time offset when inserting keys and display time offset for F-Curve and action views");
- prop= RNA_def_property(srna, "time_offset_parent", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_time_offset_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENT);
RNA_def_property_ui_text(prop, "Time Offset Parent", "Apply the time offset to this objects parent relationship");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "time_offset_particle", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_time_offset_particle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARTICLE);
RNA_def_property_ui_text(prop, "Time Offset Particle", "Let the time offset work on the particle effect");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "time_offset_add_parent", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_time_offset_add_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENTADD);
RNA_def_property_ui_text(prop, "Time Offset Add Parent", "Add the parents time offset value");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
/* drawing */
- prop= RNA_def_property(srna, "max_draw_type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dt");
RNA_def_property_enum_items(prop, drawtype_items);
RNA_def_property_ui_text(prop, "Maximum Draw Type", "Maximum draw type to display object with in viewport");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "draw_bounds", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_bounds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_BOUNDBOX);
RNA_def_property_ui_text(prop, "Draw Bounds", "Displays the object's bounds");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
@@ -1892,32 +2082,32 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Draw Bounds Type", "Object boundary display type");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "draw_name", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWNAME);
RNA_def_property_ui_text(prop, "Draw Name", "Displays the object's name");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "draw_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_AXIS);
RNA_def_property_ui_text(prop, "Draw Axis", "Displays the object's origin and axis");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "draw_texture_space", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_texture_space", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_TEXSPACE);
RNA_def_property_ui_text(prop, "Draw Texture Space", "Displays the object's texture space");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "draw_wire", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWWIRE);
RNA_def_property_ui_text(prop, "Draw Wire", "Adds the object's wireframe over solid drawing");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "draw_transparent", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_transparent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP);
RNA_def_property_ui_text(prop, "Draw Transparent", "Enables transparent materials for the object (Mesh only)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "x_ray", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY);
RNA_def_property_ui_text(prop, "X-Ray", "Makes the object draw in front of others");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
@@ -1941,21 +2131,21 @@ 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);
+ prop= RNA_def_property(srna, "show_shape_key", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK);
RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object");
RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
- RNA_def_property_update(prop, 0, "rna_Object_update_data");
+ RNA_def_property_update(prop, 0, "rna_Object_internal_update_data");
- prop= RNA_def_property(srna, "shape_key_edit_mode", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_shape_key_edit_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_EDIT_MODE);
RNA_def_property_ui_text(prop, "Shape Key Edit Mode", "Apply shape keys in edit mode (for Meshes only)");
RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0);
- RNA_def_property_update(prop, 0, "rna_Object_update_data");
+ RNA_def_property_update(prop, 0, "rna_Object_internal_update_data");
prop= RNA_def_property(srna, "active_shape_key", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ShapeKey");
- RNA_def_property_pointer_funcs(prop, "rna_Object_active_shape_key_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Object_active_shape_key_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key");
prop= RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE);
@@ -1980,13 +2170,13 @@ static void rna_def_dupli_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob");
- /* RNA_def_property_pointer_funcs(prop, "rna_DupliObject_object_get", NULL, NULL); */
+ /* RNA_def_property_pointer_funcs(prop, "rna_DupliObject_object_get", NULL, NULL, NULL); */
RNA_def_property_ui_text(prop, "Object", "Object being duplicated");
- prop= RNA_def_property(srna, "object_matrix", PROP_FLOAT, PROP_MATRIX);
+ prop= RNA_def_property(srna, "matrix_original", 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", "Duplicated object transformation matrix");
+ RNA_def_property_ui_text(prop, "Object Matrix", "The original matrix of this object before it was duplicated");
prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "mat");
@@ -1996,7 +2186,7 @@ static void rna_def_dupli_object(BlenderRNA *brna)
/* TODO: DupliObject has more properties that can be wrapped */
}
-static void rna_def_base(BlenderRNA *brna)
+static void rna_def_object_base(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -2018,22 +2208,19 @@ static void rna_def_base(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, NULL, "rna_Base_layer_set");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Base_layer_update");
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BA_SELECT);
- RNA_def_property_ui_text(prop, "Selected", "Object base selection state");
+ RNA_def_property_ui_text(prop, "Select", "Object base selection state");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Base_select_update");
- prop= RNA_def_property(srna, "selected_user", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", BA_WAS_SEL);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "User Selected", "Object base user selection state, used to restore user selection after transformations");
+ RNA_api_object_base(srna);
}
void RNA_def_object(BlenderRNA *brna)
{
rna_def_object(brna);
rna_def_object_game_settings(brna);
- rna_def_base(brna);
+ rna_def_object_base(brna);
rna_def_vertex_group(brna);
rna_def_material_slot(brna);
rna_def_dupli_object(brna);
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 27a88006b40..d48e714ea23 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -35,9 +35,9 @@
#include "DNA_object_types.h"
-#include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
+// #include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
-#include "ED_mesh.h"
+// #include "ED_mesh.h"
#ifdef RNA_RUNTIME
@@ -65,19 +65,19 @@
#include "DNA_curve_types.h"
#include "DNA_modifier_types.h"
#include "DNA_constraint_types.h"
+#include "DNA_view3d_types.h"
#include "MEM_guardedalloc.h"
/* 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)
+static Mesh *rna_Object_create_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_modifiers, int settings)
{
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) {
@@ -115,7 +115,7 @@ static Mesh *rna_Object_create_mesh(Object *ob, bContext *C, ReportList *reports
/* 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 );
+ free_libblock_us( &(G.main->object), tmpobj );
BKE_report(reports, RPT_ERROR, "cant convert curve to mesh. Does the curve have any segments?");
return NULL;
}
@@ -233,7 +233,7 @@ static Mesh *rna_Object_create_mesh(Object *ob, bContext *C, ReportList *reports
}
/* When no longer needed, duplilist should be freed with Object.free_duplilist */
-static void rna_Object_create_duplilist(Object *ob, bContext *C, ReportList *reports)
+static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce)
{
if (!(ob->transflag & OB_DUPLI)) {
BKE_report(reports, RPT_ERROR, "Object does not have duplis.");
@@ -248,7 +248,7 @@ static void rna_Object_create_duplilist(Object *ob, bContext *C, ReportList *rep
ob->duplilist= NULL;
}
- ob->duplilist= object_duplilist(CTX_data_scene(C), ob);
+ ob->duplilist= object_duplilist(sce, ob);
/* ob->duplilist should now be freed with Object.free_duplilist */
}
@@ -261,21 +261,11 @@ static void rna_Object_free_duplilist(Object *ob, ReportList *reports)
}
}
-static bDeformGroup *rna_Object_add_vertex_group(Object *ob, char *group_name)
+/* copied from old API Object.makeDisplayList (Object.c)
+ * use _ suffix because this exists for internal rna */
+static void rna_Object_update(Object *ob, Scene *sce, int object, int data, int time)
{
- 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);
-}
-
-/* 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);
+ int flag= 0;
if (ob->type == OB_FONT) {
Curve *cu = ob->data;
@@ -283,7 +273,11 @@ static void rna_Object_make_display_list(Object *ob, bContext *C)
BKE_text_to_curve(sce, ob, CU_LEFT);
}
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+ if(object) flag |= OB_RECALC_OB;
+ if(data) flag |= OB_RECALC_DATA;
+ if(time) flag |= OB_RECALC_TIME;
+
+ DAG_id_flush_update(&ob->id, flag);
}
static Object *rna_Object_find_armature(Object *ob)
@@ -328,9 +322,9 @@ static PointerRNA rna_Object_add_shape_key(Object *ob, bContext *C, ReportList *
}
}
-int rna_Object_is_visible(Object *ob, bContext *C)
+int rna_Object_is_visible(Object *ob, Scene *sce)
{
- return !(ob->restrictflag & OB_RESTRICT_VIEW) && ob->lay & CTX_data_scene(C)->lay;
+ return !(ob->restrictflag & OB_RESTRICT_VIEW) && ob->lay & sce->lay;
}
/*
@@ -408,6 +402,13 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
*index= -1;
}
+/* ObjectBase */
+
+void rna_ObjectBase_layers_from_view(Base *base, View3D *v3d)
+{
+ base->lay= base->object->lay= v3d->lay;
+}
+
#else
void RNA_api_object(StructRNA *srna)
@@ -421,17 +422,12 @@ void RNA_api_object(StructRNA *srna)
{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);
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
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.");
@@ -442,30 +438,14 @@ void RNA_api_object(StructRNA *srna)
/* 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);
+ parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+ RNA_def_function_flag(func, 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.");
@@ -506,17 +486,34 @@ void RNA_api_object(StructRNA *srna)
/* 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);
+ func= RNA_def_function(srna, "update", "rna_Object_update");
+ RNA_def_function_ui_description(func, "Tag the object to update its display data.");
+ parm= RNA_def_pointer(func, "scene", "Scene", "", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+ RNA_def_boolean(func, "object", 1, "", "Tag the object for updating");
+ RNA_def_boolean(func, "data", 1, "", "Tag the objects display data for updating");
+ RNA_def_boolean(func, "time", 1, "", "Tag the object time related data for updating");
/* 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);
+ RNA_def_function_ui_description(func, "Determine if object is visible in a given scene.");
+ parm= RNA_def_pointer(func, "scene", "Scene", "", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_boolean(func, "is_visible", 0, "", "Object visibility.");
RNA_def_function_return(func, parm);
}
+
+void RNA_api_object_base(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "layers_from_view", "rna_ObjectBase_layers_from_view");
+ RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view).");
+ parm= RNA_def_pointer(func, "view", "SpaceView3D", "", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+}
+
#endif
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 238098e85e2..f019a96844d 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -294,6 +294,29 @@ static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int v
BLI_freelistN(&pidlist);
}
+static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max)
+{
+ Object *ob = ptr->id.data;
+ PointCache *cache= ptr->data;
+ PTCacheID *pid;
+ ListBase pidlist;
+
+ *min= 1;
+ *max= 20;
+
+ BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
+
+ for(pid=pidlist.first; pid; pid=pid->next) {
+ if(pid->cache == cache) {
+ if(ELEM3(pid->type, PTCACHE_TYPE_CLOTH, PTCACHE_TYPE_SMOKE_DOMAIN, PTCACHE_TYPE_SMOKE_HIGHRES))
+ *max= 1;
+ break;
+ }
+ }
+
+ BLI_freelistN(&pidlist);
+}
+
static char *rna_CollisionSettings_path(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@@ -357,14 +380,19 @@ static void rna_SoftBodySettings_self_collision_set(PointerRNA *ptr, int value)
static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr)
{
Object *data= (Object*)(ptr->id.data);
- return (((data->softflag) & OB_SB_AERO_ANGLE) != 0);
+ if (data->softflag & OB_SB_AERO_ANGLE)
+ return 1;
+ else
+ return 0;
}
static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value)
{
Object *data= (Object*)(ptr->id.data);
- if(value) data->softflag |= OB_SB_AERO_ANGLE;
- else data->softflag &= ~OB_SB_AERO_ANGLE;
+ if (value == 1)
+ data->softflag |= OB_SB_AERO_ANGLE;
+ else /* value == 0 */
+ data->softflag &= ~OB_SB_AERO_ANGLE;
}
static int rna_SoftBodySettings_face_collision_get(PointerRNA *ptr)
@@ -454,7 +482,7 @@ static void rna_FieldSettings_update(Main *bmain, Scene *scene, PointerRNA *ptr)
part->pd2->tex= 0;
}
- DAG_id_flush_update(&part->id, OB_RECALC|PSYS_RECALC_RESET);
+ DAG_id_flush_update(&part->id, OB_RECALC_ALL|PSYS_RECALC_RESET);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL);
}
@@ -482,11 +510,11 @@ static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA
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, NULL, eModifierType_Surface);
+ ED_object_modifier_add(NULL, bmain, scene, ob, NULL, eModifierType_Surface);
}
else {
if(!pd || pd->shape != PFIELD_SHAPE_SURFACE)
- ED_object_modifier_remove(NULL, scene, ob, md);
+ ED_object_modifier_remove(NULL, bmain, scene, ob, md);
}
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
@@ -496,7 +524,7 @@ static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA
static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
if(particle_id_check(ptr)) {
- DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC|PSYS_RECALC_RESET);
+ DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC_ALL|PSYS_RECALC_RESET);
}
else {
Object *ob= (Object*)ptr->id.data;
@@ -510,10 +538,10 @@ static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, Point
rna_FieldSettings_shape_update(bmain, scene, ptr);
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE)
- DAG_id_flush_update(&ob->id, OB_RECALC);
+ DAG_id_flush_update(&ob->id, OB_RECALC_ALL);
else
DAG_id_flush_update(&ob->id, OB_RECALC_OB);
@@ -554,7 +582,7 @@ static void rna_EffectorWeight_update(Main *bmain, Scene *scene, PointerRNA *ptr
static void rna_EffectorWeight_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
@@ -612,9 +640,9 @@ static void rna_CollisionSettings_dependency_update(Main *bmain, Scene *scene, P
/* add/remove modifier as needed */
if(ob->pd->deflect && !md)
- ED_object_modifier_add(NULL, scene, ob, NULL, eModifierType_Collision);
+ ED_object_modifier_add(NULL, bmain, scene, ob, NULL, eModifierType_Collision);
else if(!ob->pd->deflect && md)
- ED_object_modifier_remove(NULL, scene, ob, md);
+ ED_object_modifier_remove(NULL, bmain, scene, ob, md);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
}
@@ -623,7 +651,7 @@ static void rna_CollisionSettings_update(Main *bmain, Scene *scene, PointerRNA *
{
Object *ob= (Object*)ptr->id.data;
- DAG_id_flush_update(&ob->id, OB_RECALC);
+ DAG_id_flush_update(&ob->id, OB_RECALC_ALL);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
}
@@ -665,9 +693,28 @@ static EnumPropertyItem *rna_Effector_shape_itemf(bContext *C, PointerRNA *ptr,
}
}
-
#else
+/* ptcache.point_caches */
+static void rna_def_ptcache_point_caches(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ // FunctionRNA *func;
+ // PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "PointCaches");
+ srna= RNA_def_struct(brna, "PointCaches", NULL);
+ RNA_def_struct_sdna(srna, "PointCache");
+ RNA_def_struct_ui_text(srna, "Point Caches", "Collection of point caches");
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set", "rna_Cache_active_point_cache_index_range");
+ RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
+ RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");
+}
+
static void rna_def_pointcache(BlenderRNA *brna)
{
StructRNA *srna;
@@ -687,8 +734,10 @@ static void rna_def_pointcache(BlenderRNA *brna)
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_ui_text(prop, "End", "Frame on which the simulation stops");
- prop= RNA_def_property(srna, "step", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "step");
RNA_def_property_range(prop, 1, 20);
+ RNA_def_property_int_funcs(prop, NULL, NULL, "rna_PointCache_frame_step_range");
RNA_def_property_ui_text(prop, "Cache Step", "Number of frames between cached frames");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");
@@ -699,20 +748,20 @@ static void rna_def_pointcache(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
/* flags */
- prop= RNA_def_property(srna, "baked", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_baked", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "baking", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_baking", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKING);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "disk_cache", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_disk_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_DISK_CACHE);
- RNA_def_property_ui_text(prop, "Disk Cache", "Save cache files to disk");
+ RNA_def_property_ui_text(prop, "Disk Cache", "Save cache files to disk (.blend file must be saved first)");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_toggle_disk_cache");
- prop= RNA_def_property(srna, "outdated", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_outdated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_OUTDATED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Cache is outdated", "");
@@ -732,7 +781,7 @@ static void rna_def_pointcache(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "File Path", "Cache file path");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
- prop= RNA_def_property(srna, "quick_cache", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_quick_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_QUICK_CACHE);
RNA_def_property_ui_text(prop, "Quick Cache", "Update simulation with cache steps");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");
@@ -742,20 +791,21 @@ static void rna_def_pointcache(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Cache Info", "Info on current cache status");
- prop= RNA_def_property(srna, "external", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_external", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_EXTERNAL);
RNA_def_property_ui_text(prop, "External", "Read cache from an external location");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
+
+ prop= RNA_def_property(srna, "use_library_path", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PTCACHE_IGNORE_LIBPATH);
+ RNA_def_property_ui_text(prop, "Library Path", "Use this files path when library linked into another file.");
+ RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
- prop= RNA_def_property(srna, "point_cache_list", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list");
-
- prop= RNA_def_property(srna, "active_point_cache_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set", "rna_Cache_active_point_cache_index_range");
- RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
- RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");
+ rna_def_ptcache_point_caches(brna, prop);
}
static void rna_def_collision(BlenderRNA *brna)
@@ -768,7 +818,7 @@ static void rna_def_collision(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_CollisionSettings_path");
RNA_def_struct_ui_text(srna, "Collision Settings", "Collision settings for object in physics simulation");
- prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deflect", 1);
RNA_def_property_ui_text(prop, "Enabled", "Enable this objects as a collider for physics systems");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_dependency_update");
@@ -781,7 +831,7 @@ static void rna_def_collision(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Damping Factor", "Amount of damping during particle collision");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "random_damping", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "damping_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_rdamp");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Damping", "Random variation of damping");
@@ -793,7 +843,7 @@ static void rna_def_collision(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Friction Factor", "Amount of friction during particle collision");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "random_friction", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "friction_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_rfrict");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Friction", "Random variation of friction");
@@ -805,7 +855,7 @@ static void rna_def_collision(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Permeability", "Chance that the particle will pass through the mesh");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "kill_particles", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_particle_kill", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PDEFLE_KILL_PART);
RNA_def_property_ui_text(prop, "Kill Particles", "Kill collided particles");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
@@ -818,13 +868,13 @@ static void rna_def_collision(BlenderRNA *brna)
/* Soft Body and Cloth Interaction */
- prop= RNA_def_property(srna, "inner_thickness", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "thickness_inner", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_sbift");
RNA_def_property_range(prop, 0.001f, 1.0f);
RNA_def_property_ui_text(prop, "Inner Thickness", "Inner face thickness");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "outer_thickness", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "thickness_outer", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_sboft");
RNA_def_property_range(prop, 0.001f, 1.0f);
RNA_def_property_ui_text(prop, "Outer Thickness", "Outer face thickness");
@@ -862,15 +912,13 @@ static void rna_def_effector_weight(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_PHYSICS);
/* Flags */
- prop= RNA_def_property(srna, "do_growing_hair", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "apply_to_hair_growing", 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");
@@ -918,7 +966,7 @@ static void rna_def_effector_weight(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "curve_guide", 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);
@@ -1127,25 +1175,25 @@ static void rna_def_field(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mindist");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance for the field's fall-off");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "maximum_distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxdist");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for the field to work");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "radial_minimum", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "radial_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minrad");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Minimum Radial Distance", "Minimum radial distance for the field's fall-off");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "radial_maximum", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "radial_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxrad");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Maximum Radial Distance", "Maximum radial distance for the field to work");
@@ -1198,42 +1246,42 @@ static void rna_def_field(BlenderRNA *brna)
// "Use a maximum angle for the field to work"
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_coordinates", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_object_coords", 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);
+ prop= RNA_def_property(srna, "use_global_coords", 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);
+ prop= RNA_def_property(srna, "use_2d_force", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_2D);
RNA_def_property_ui_text(prop, "2D", "Apply force only in 2d");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "root_coordinates", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_root_coords", PROP_BOOLEAN, PROP_NONE);
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);
+ prop= RNA_def_property(srna, "apply_to_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);
+ prop= RNA_def_property(srna, "apply_to_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");
- prop= RNA_def_property(srna, "do_absorption", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_absorption", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_VISIBILITY);
RNA_def_property_ui_text(prop, "Absorption", "Force gets absorbed by collision objects");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "multiple_springs", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_multiple_springs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_MULTIPLE_SPRINGS);
RNA_def_property_ui_text(prop, "Multiple Springs", "Every point is effected by multiple springs");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
@@ -1260,23 +1308,28 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Free", "Guide-free time from particle life's end");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "guide_path_add", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_guide_path_add", PROP_BOOLEAN, PROP_NONE);
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, "use_guide_path_weight", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GUIDE_PATH_WEIGHT);
+ RNA_def_property_ui_text(prop, "Weights", "Use curve weights to influence the particle influence along the curve");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* Clump Settings */
prop= RNA_def_property(srna, "guide_clump_amount", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clump_fac");
RNA_def_property_range(prop, -1.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Amount", "Amount of clumpimg");
+ RNA_def_property_ui_text(prop, "Amount", "Amount of clumping");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
prop= RNA_def_property(srna, "guide_clump_shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clump_pow");
RNA_def_property_range(prop, -0.999f, 0.999f);
- RNA_def_property_ui_text(prop, "Shape", "Shape of clumpimg");
+ RNA_def_property_ui_text(prop, "Shape", "Shape of clumping");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* Kink Settings */
@@ -1302,7 +1355,7 @@ static void rna_def_field(BlenderRNA *brna)
prop= RNA_def_property(srna, "guide_kink_shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kink_shape");
RNA_def_property_range(prop, -0.999f, 0.999f);
- RNA_def_property_ui_text(prop, "Shape", "djust the offset to the beginning/end");
+ RNA_def_property_ui_text(prop, "Shape", "Adjust the offset to the beginning/end");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
prop= RNA_def_property(srna, "guide_kink_amplitude", PROP_FLOAT, PROP_NONE);
@@ -1326,7 +1379,7 @@ static void rna_def_game_softbody(BlenderRNA *brna)
/* Floats */
- prop= RNA_def_property(srna, "linstiff", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "linear_stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "linStiff");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Linear Stiffness", "Linear stiffness of the soft body links");
@@ -1336,24 +1389,24 @@ static void rna_def_game_softbody(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Friction", "Dynamic Friction");
- prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "shape_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kMT");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Threshold", "Shape matching threshold");
- prop= RNA_def_property(srna, "margin", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "margin");
RNA_def_property_range(prop, 0.01f, 1.0f);
RNA_def_property_ui_text(prop, "Margin", "Collision margin for soft body. Small value makes the algorithm unstable");
- prop= RNA_def_property(srna, "welding", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "weld_threshold", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "welding");
RNA_def_property_range(prop, 0.0f, 0.01f);
RNA_def_property_ui_text(prop, "Welding", "Welding threshold: distance between nearby vertices to be considered equal => set to 0.0 to disable welding test and speed up scene loading (ok if the mesh has no duplicates)");
/* Integers */
- prop= RNA_def_property(srna, "position_iterations", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "location_iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "piterations");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Position Iterations", "Position solver iterations");
@@ -1365,19 +1418,19 @@ static void rna_def_game_softbody(BlenderRNA *brna)
/* Booleans */
- prop= RNA_def_property(srna, "shape_match", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_shape_match", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_BSB_SHAPE_MATCHING);
RNA_def_property_ui_text(prop, "Shape Match", "Enable soft body shape matching goal");
- prop= RNA_def_property(srna, "bending_const", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_bending_constraints", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_BSB_BENDING_CONSTRAINTS);
RNA_def_property_ui_text(prop, "Bending Const", "Enable bending constraints");
- prop= RNA_def_property(srna, "cluster_rigid_to_softbody", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cluster_rigid_to_softbody", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "collisionflags", OB_BSB_COL_CL_RS);
RNA_def_property_ui_text(prop, "Rigid to Soft Body", "Enable cluster collision between soft and rigid body");
- prop= RNA_def_property(srna, "cluster_soft_to_softbody", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cluster_soft_to_softbody", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "collisionflags", OB_BSB_COL_CL_SS);
RNA_def_property_ui_text(prop, "Soft to Soft Body", "Enable cluster collision between soft and soft body");
}
@@ -1396,6 +1449,11 @@ static void rna_def_softbody(BlenderRNA *brna)
{SBC_MODE_MAX, "MAXIMAL", 0, "Maximal", "Maximal Spring length * Ball Size"},
{SBC_MODE_AVGMINMAX, "MINMAX", 0, "AvMinMax", "(Min+Max)/2 * Ball Size"},
{0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem aerodynamics_type[] = {
+ {0, "SIMPLE", 0, "Simple", "Edges receive a drag force from surrounding media"},
+ {1, "LIFT_FORCE", 0, "Lift Force", "Edges receive a lift force when passing through surrounding media"},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "SoftBodySettings", NULL);
RNA_def_struct_sdna(srna, "SoftBody");
@@ -1488,7 +1546,7 @@ static void rna_def_softbody(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Push", "Edge spring stiffness when shorter than rest length");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "damp", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "infrict");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Damp", "Edge spring friction");
@@ -1512,7 +1570,7 @@ static void rna_def_softbody(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Plastic", "Permanent deform");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "bending", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "bend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "secondspring");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Bending", "Bending Stiffness");
@@ -1548,7 +1606,7 @@ static void rna_def_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "ball_stiff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ballstiff");
RNA_def_property_range(prop, 0.001f, 100.0f);
- RNA_def_property_ui_text(prop, "Ball Size", "Ball inflating presure");
+ RNA_def_property_ui_text(prop, "Ball Size", "Ball inflating pressure");
RNA_def_property_update(prop, 0, "rna_softbody_update");
prop= RNA_def_property(srna, "ball_damp", PROP_FLOAT, PROP_NONE);
@@ -1559,19 +1617,19 @@ static void rna_def_softbody(BlenderRNA *brna)
/* Solver */
- prop= RNA_def_property(srna, "error_limit", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rklimit");
RNA_def_property_range(prop, 0.001f, 10.0f);
RNA_def_property_ui_text(prop, "Error Limit", "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "minstep", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "step_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "minloops");
RNA_def_property_range(prop, 0, 30000);
RNA_def_property_ui_text(prop, "Min Step", "Minimal # solver steps/frame");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "maxstep", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "step_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxloops");
RNA_def_property_range(prop, 0, 30000);
RNA_def_property_ui_text(prop, "Max Step", "Maximal # solver steps/frame");
@@ -1586,21 +1644,21 @@ static void rna_def_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "fuzzyness");
RNA_def_property_range(prop, 1, 100);
- RNA_def_property_ui_text(prop, "Fuzzy", "Fuzzyness while on collision, high values make collsion handling faster but less stable");
+ RNA_def_property_ui_text(prop, "Fuzzy", "Fuzziness while on collision, high values make collsion handling faster but less stable");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "auto_step", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_OLDERR);
RNA_def_property_ui_text(prop, "V", "Use velocities for automagic step sizes");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "diagnose", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_diagnose", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_MONITOR);
RNA_def_property_ui_text(prop, "Print Performance to Console", "Turn on SB diagnose console prints");
- prop= RNA_def_property(srna, "estimate_matrix", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_estimate_matrix", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_ESTIMATEIPO);
- RNA_def_property_ui_text(prop, "Estimate matrix", "esimate matrix .. split to COM , ROT ,SCALE ");
+ RNA_def_property_ui_text(prop, "Estimate matrix", "estimate matrix .. split to COM , ROT ,SCALE ");
/***********************************************************************************/
@@ -1608,17 +1666,17 @@ static void rna_def_softbody(BlenderRNA *brna)
/* but i did not want to start a new property struct */
/* so rather rename this from SoftBodySettings to SoftBody */
/* translation */
- prop= RNA_def_property(srna, "lcom", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "location_mass_center", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "lcom");
RNA_def_property_ui_text(prop, "Center of mass", "Location of Center of mass");
/* matrix */
- prop= RNA_def_property(srna, "lrot", PROP_FLOAT, PROP_MATRIX);
+ prop= RNA_def_property(srna, "rotation_estimate", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "lrot");
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Rot Matrix", "Estimated rotation matrix");
- prop= RNA_def_property(srna, "lscale", PROP_FLOAT, PROP_MATRIX);
+ prop= RNA_def_property(srna, "scale_estimate", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "lscale");
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Scale Matrix", "Estimated scale matrix");
@@ -1639,28 +1697,29 @@ static void rna_def_softbody(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Edges", "Use Edges as springs");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "stiff_quads", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stiff_quads", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Stiff Quads", "Adds diagonal springs on 4-gons");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "edge_collision", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_edge_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_edge_collision_get", "rna_SoftBodySettings_edge_collision_set");
RNA_def_property_ui_text(prop, "Edge Collision", "Edges collide too");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "face_collision", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_face_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_face_collision_get", "rna_SoftBodySettings_face_collision_set");
- RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, SLOOOOOW warning");
+ RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, can be very slow");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "new_aero", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set");
- RNA_def_property_ui_text(prop, "N", "New aero(uses angle and length)");
+ prop= RNA_def_property(srna, "aerodynamics_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, aerodynamics_type);
+ RNA_def_property_enum_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set", NULL);
+ RNA_def_property_ui_text(prop, "Aerodynamics Type", "Method of calculating aerodynamic interaction");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "self_collision", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_self_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision");
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 4e8776eff6a..1151215f5f7 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -32,6 +32,7 @@
#include "rna_internal.h"
#include "DNA_modifier_types.h"
+#include "DNA_cloth_types.h"
#include "DNA_particle_types.h"
#include "DNA_object_force.h"
#include "DNA_object_types.h"
@@ -106,6 +107,92 @@ EnumPropertyItem part_hair_ren_as_items[] = {
#include "BLI_math.h"
#include "BLI_listbase.h"
+/* use for object space hair get/set */
+static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleSystemModifierData **psmd_pt, ParticleData **pa_pt)
+{
+ HairKey *hkey= (HairKey *)ptr->data;
+ Object *ob = (Object *)ptr->id.data;
+ ModifierData *md;
+ ParticleSystemModifierData *psmd=NULL;
+ ParticleSystem *psys;
+ ParticleData *pa;
+ int i;
+
+ *psmd_pt= NULL;
+ *pa_pt= NULL;
+
+ /* weak, what about multiple particle systems? */
+ for (md = ob->modifiers.first; md; md=md->next) {
+ if (md->type == eModifierType_ParticleSystem)
+ psmd= (ParticleSystemModifierData*) md;
+ }
+
+ if (!psmd || !psmd->dm || !psmd->psys) {
+ return;
+ }
+
+ psys= psmd->psys;
+
+ /* not a very efficient way of getting hair key location data,
+ * but it's the best we've got at the present */
+
+ /* find the particle that corresponds with this HairKey */
+ for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++) {
+
+ /* hairkeys are stored sequentially in memory, so we can find if
+ * it's the same particle by comparing pointers, without having
+ * to iterate over them all */
+ if ((hkey >= pa->hair) && (hkey < pa->hair + pa->totkey))
+ break;
+ }
+
+ *psmd_pt= psmd;
+ *pa_pt= pa;
+}
+
+static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *values)
+{
+ HairKey *hkey= (HairKey *)ptr->data;
+ Object *ob = (Object *)ptr->id.data;
+ ParticleSystemModifierData *psmd;
+ ParticleData *pa;
+
+ rna_ParticleHairKey_location_object_info(ptr, &psmd, &pa);
+
+ if(pa) {
+ float hairmat[4][4];
+ psys_mat_hair_to_object(ob, psmd->dm, psmd->psys->part->from, pa, hairmat);
+ copy_v3_v3(values, hkey->co);
+ mul_m4_v3(hairmat, values);
+ }
+ else {
+ zero_v3(values);
+ }
+}
+
+static void rna_ParticleHairKey_location_object_set(PointerRNA *ptr, const float *values)
+{
+ HairKey *hkey= (HairKey *)ptr->data;
+ Object *ob = (Object *)ptr->id.data;
+ ParticleSystemModifierData *psmd;
+ ParticleData *pa;
+
+ rna_ParticleHairKey_location_object_info(ptr, &psmd, &pa);
+
+ if(pa) {
+ float hairmat[4][4];
+ float imat[4][4];
+
+ psys_mat_hair_to_object(ob, psmd->dm, psmd->psys->part->from, pa, hairmat);
+ invert_m4_m4(imat, hairmat);
+ copy_v3_v3(hkey->co, values);
+ mul_m4_v3(imat, hkey->co);
+ }
+ else {
+ zero_v3(hkey->co);
+ }
+}
+
/* property update functions */
static void particle_recalc(Main *bmain, Scene *scene, PointerRNA *ptr, short flag)
{
@@ -119,7 +206,7 @@ static void particle_recalc(Main *bmain, Scene *scene, PointerRNA *ptr, short fl
else
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|flag);
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
static void rna_Particle_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -128,7 +215,7 @@ static void rna_Particle_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Particle_redo_dependency(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
rna_Particle_redo(bmain, scene, ptr);
}
@@ -152,12 +239,25 @@ static void rna_Particle_redo_child(Main *bmain, Scene *scene, PointerRNA *ptr)
particle_recalc(bmain, scene, ptr, PSYS_RECALC_CHILD);
}
+static ParticleSystem *rna_particle_system_for_target(Object *ob, ParticleTarget *target)
+{
+ ParticleSystem *psys;
+ ParticleTarget *pt;
+
+ for(psys=ob->particlesystem.first; psys; psys=psys->next)
+ for(pt=psys->targets.first; pt; pt=pt->next)
+ if(pt == target)
+ return psys;
+
+ return NULL;
+}
+
static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
{
if(ptr->type==&RNA_ParticleTarget) {
- ParticleTarget *pt = (ParticleTarget*)ptr->data;
Object *ob = (Object*)ptr->id.data;
- ParticleSystem *kpsys=NULL, *psys=psys_get_current(ob);
+ ParticleTarget *pt = (ParticleTarget*)ptr->data;
+ ParticleSystem *kpsys=NULL, *psys=rna_particle_system_for_target(ob, pt);
if(pt->ob==ob || pt->ob==NULL) {
kpsys = BLI_findlink(&ob->particlesystem, pt->psys-1);
@@ -180,22 +280,23 @@ static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr
psys->recalc = PSYS_RECALC_RESET;
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
}
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
static void rna_Particle_target_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
{
if(ptr->type==&RNA_ParticleTarget) {
Object *ob = (Object*)ptr->id.data;
- ParticleSystem *psys = psys_get_current(ob);
+ ParticleTarget *pt = (ParticleTarget*)ptr->data;
+ ParticleSystem *psys = rna_particle_system_for_target(ob, pt);
psys->recalc = PSYS_RECALC_REDO;
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
}
@@ -211,20 +312,19 @@ static void rna_Particle_hair_dynamics(Main *bmain, Scene *scene, PointerRNA *pt
rna_Particle_redo(bmain, scene, ptr);
}
else
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- ParticleSettings *part = psys_get_current(ob)->part;
+ ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ ParticleSettings *part = psys->part;
return rna_pointer_inherit_refine(ptr, &RNA_ParticleSettings, part);
}
static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object*)ptr->id.data;
- ParticleSystem *psys = psys_get_current(ob);
+ ParticleSystem *psys= (ParticleSystem*)ptr->data;
if(psys->part)
psys->part->id.us--;
@@ -637,6 +737,7 @@ static void rna_ParticleVGroup_name_set_9(PointerRNA *ptr, const char *value) {
static void rna_ParticleVGroup_name_set_10(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 10); }
static void rna_ParticleVGroup_name_set_11(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 11); }
+
#else
static void rna_def_particle_hair_key(BlenderRNA *brna)
@@ -648,16 +749,21 @@ static void rna_def_particle_hair_key(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "HairKey");
RNA_def_struct_ui_text(srna, "Particle Hair Key", "Particle key for hair particle system");
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
- RNA_def_property_float_sdna(prop, NULL, "co");
- RNA_def_property_ui_text(prop, "Location", "Key location");
-
prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Time", "Relative time of key over hair length");
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Weight", "Weight for cloth simulation");
+
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Location (Object Space)", "Location of the hair key in object space");
+ RNA_def_property_float_funcs(prop, "rna_ParticleHairKey_location_object_get", "rna_ParticleHairKey_location_object_set", NULL);
+
+ prop= RNA_def_property(srna, "co_hair_space", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "co");
+ RNA_def_property_ui_text(prop, "Location", "Location of the hair key in its internal coordinate system, relative to the emitting face");
}
static void rna_def_particle_key(BlenderRNA *brna)
@@ -757,7 +863,7 @@ static void rna_def_particle(BlenderRNA *brna)
/* Hair & Keyed Keys */
- prop= RNA_def_property(srna, "hair", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "is_hair", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "hair", "totkey");
RNA_def_property_struct_type(prop, "ParticleHairKey");
RNA_def_property_ui_text(prop, "Hair", "");
@@ -770,7 +876,7 @@ static void rna_def_particle(BlenderRNA *brna)
// float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/
// /* face normal for volume emission */
- prop= RNA_def_property(srna, "birthtime", PROP_FLOAT, PROP_TIME);
+ prop= RNA_def_property(srna, "birth_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
RNA_def_property_ui_text(prop, "Birth Time", "");
@@ -796,17 +902,15 @@ static void rna_def_particle(BlenderRNA *brna)
// int totkey;
/* flag */
- prop= RNA_def_property(srna, "unexist", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_UNEXIST);
- RNA_def_property_ui_text(prop, "unexist", "");
-
- prop= RNA_def_property(srna, "no_disp", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_NO_DISP);
- RNA_def_property_ui_text(prop, "no_disp", "");
+ prop= RNA_def_property(srna, "is_exist", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PARS_UNEXIST);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Exists", "");
- prop= RNA_def_property(srna, "rekey", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_REKEY);
- RNA_def_property_ui_text(prop, "rekey", "");
+ prop= RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PARS_NO_DISP);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Visible", "");
prop= RNA_def_property(srna, "alive_state", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "alive");
@@ -846,7 +950,7 @@ static void rna_def_fluid_settings(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "SPH Fluid Settings", "Settings for particle fluids physics");
/* Fluid settings */
- prop= RNA_def_property(srna, "spring_k", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "spring_force", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spring_k");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Spring", "Spring force constant");
@@ -878,13 +982,13 @@ static void rna_def_fluid_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* Double density relaxation */
- prop= RNA_def_property(srna, "stiffness_k", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness_k");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Stiffness ", "Constant K - Stiffness");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "stiffness_knear", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "stiffness_near", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness_knear");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Repulsion", "Repulsion factor: stiffness_knear");
@@ -968,13 +1072,14 @@ static void rna_def_particle_settings(BlenderRNA *brna)
};
//TODO: names, tooltips
+#if 0
static EnumPropertyItem rot_from_items[] = {
{PART_ROT_KEYS, "KEYS", 0, "keys", ""},
{PART_ROT_ZINCR, "ZINCR", 0, "zincr", ""},
{PART_ROT_IINCR, "IINCR", 0, "iincr", ""},
{0, NULL, 0, NULL, NULL}
};
-
+#endif
static EnumPropertyItem integrator_type_items[] = {
{PART_INT_EULER, "EULER", 0, "Euler", ""},
{PART_INT_VERLET, "VERLET", 0, "Verlet", ""},
@@ -1029,100 +1134,95 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
/* flag */
- prop= RNA_def_property(srna, "react_start_end", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_react_start_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_STA_END);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start/End", "Give birth to unreacted particles eventually");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "react_multiple", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_react_multiple", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_MULTIPLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Multi React", "React multiple times");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- /* TODO: used somewhere? */
- prop= RNA_def_property(srna, "hair_geometry", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_GEOMETRY);
- RNA_def_property_ui_text(prop, "Hair Geometry", "");//TODO: tooltip
-
- prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_UNBORN);
RNA_def_property_ui_text(prop, "Unborn", "Show particles before they are emitted");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "died", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_dead", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIED);
RNA_def_property_ui_text(prop, "Died", "Show particles after they have died");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "trand", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_emit_random", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_TRAND);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Random", "Emit in random order of elements");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "even_distribution", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_even_distribution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_EDISTR);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Even Distribution", "Use even distribution from faces based on face areas or edge lengths");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "die_on_collision", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_die_on_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIE_ON_COL);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Die on hit", "Particles die when they collide with a deflector object");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "size_deflect", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_size_deflect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZE_DEFL);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Size Deflect", "Use particle's size in deflection");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "rotation_dynamic", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_dynamic_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROT_DYN);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Dynamic", "Sets rotation to dynamic/constant");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "sizemass", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_multiply_size_mass", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZEMASS);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Mass from Size", "Multiply mass by particle size");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "boids_2d", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_boids_to_surface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D);
RNA_def_property_ui_text(prop, "Boids 2D", "Constrain boids to a surface");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "branching", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_branching", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BRANCHING);
RNA_def_property_ui_text(prop, "Branching", "Branch child paths from each other");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "animate_branching", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_animate_branching", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ANIM_BRANCHING);
RNA_def_property_ui_text(prop, "Animated", "Animate branching");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "symmetric_branching", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_symmetric_branching", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SYMM_BRANCHING);
RNA_def_property_ui_text(prop, "Symmetric", "Start and end points are the same");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "hair_bspline", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_hair_bspline", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_BSPLINE);
RNA_def_property_ui_text(prop, "B-Spline", "Interpolate hair using B-Splines");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "grid_invert", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_grid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GRID_INVERT);
RNA_def_property_ui_text(prop, "Invert", "Invert what is considered object and what is not");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "child_effector", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "apply_effector_to_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_EFFECT);
RNA_def_property_ui_text(prop, "Children", "Apply effectors to children");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
@@ -1132,17 +1232,12 @@ static void rna_def_particle_settings(BlenderRNA *brna)
//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);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_RENDER);
- RNA_def_property_ui_text(prop, "child_render", "");
-
- prop= RNA_def_property(srna, "child_guide", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "apply_guide_to_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_GUIDE);
- RNA_def_property_ui_text(prop, "child_guide", "");
+ RNA_def_property_ui_text(prop, "apply_guide_to_children", "");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "self_effect", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_self_effect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SELF_EFFECT);
RNA_def_property_ui_text(prop, "Self Effect", "Particle effectors effect themselves");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -1199,7 +1294,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/*draw flag*/
- prop= RNA_def_property(srna, "velocity", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL);
RNA_def_property_ui_text(prop, "Velocity", "Show particle velocity");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
@@ -1209,37 +1304,37 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Size", "Show particle size");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "emitter", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_render_emitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_EMITTER);
RNA_def_property_ui_text(prop, "Emitter", "Render emitter Object also");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "draw_health", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_health", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_HEALTH);
RNA_def_property_ui_text(prop, "Health", "Draw boid health");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "abs_path_time", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_absolute_path_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_ABS_PATH_TIME);
RNA_def_property_ui_text(prop, "Absolute Path Time", "Path timing is in absolute frames");
RNA_def_property_update(prop, 0, "rna_Particle_abspathtime_update");
- prop= RNA_def_property(srna, "billboard_lock", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_billboard", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK);
RNA_def_property_ui_text(prop, "Lock Billboard", "Lock the billboards align axis");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "parent", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_parent_particles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PARENT);
RNA_def_property_ui_text(prop, "Parents", "Render parent particles");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "num", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_number", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_NUM);
RNA_def_property_ui_text(prop, "Number", "Show particle number");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "rand_group", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_group_pick_random", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_RAND_GR);
RNA_def_property_ui_text(prop, "Pick Random", "Pick objects from group randomly");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
@@ -1254,39 +1349,39 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Global", "Use object's global coordinates for duplication");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "render_adaptive", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_render_adaptive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_ADAPT);
RNA_def_property_ui_text(prop, "Adaptive render", "Draw steps of the particle path");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "velocity_length", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_velocity_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL_LENGTH);
RNA_def_property_ui_text(prop, "Speed", "Multiply line length by particle speed");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "material_color", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_material_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_MAT_COL);
RNA_def_property_ui_text(prop, "Material Color", "Draw particles using material's diffuse color");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "whole_group", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_whole_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_WHOLE_GR);
RNA_def_property_ui_text(prop, "Whole Group", "Use whole group at once");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "render_strand", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_strand_primitive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_STRAND);
RNA_def_property_ui_text(prop, "Strand render", "Use the strand primitive for rendering");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "draw_as", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "draw_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "draw_as");
RNA_def_property_enum_items(prop, part_draw_as_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_draw_as_itemf");
RNA_def_property_ui_text(prop, "Particle Drawing", "How particles are drawn in viewport");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "ren_as", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "render_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ren_as");
RNA_def_property_enum_items(prop, part_ren_as_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_ren_as_itemf");
@@ -1334,12 +1429,12 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 45);
RNA_def_property_ui_text(prop, "Degrees", "How many degrees path has to curve to make another render segment");
- prop= RNA_def_property(srna, "adaptive_pix", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "adaptive_pixel", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "adapt_pix");
RNA_def_property_range(prop, 0, 50);
RNA_def_property_ui_text(prop, "Pixel", "How many pixels path has to cover to make another render segment");
- prop= RNA_def_property(srna, "display", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "draw_percentage", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "disp");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Display", "Percentage of particles to display in 3D view");
@@ -1352,11 +1447,13 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- //TODO: is this read only/internal?
+ // not used anywhere, why is this in DNA???
+#if 0
prop= RNA_def_property(srna, "rotate_from", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rotfrom");
RNA_def_property_enum_items(prop, rot_from_items);
RNA_def_property_ui_text(prop, "Rotate From", "");
+#endif
prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, integrator_type_items);
@@ -1384,14 +1481,14 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "bb_uv_split");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_range(prop, 1, 10, 1, 0);
- RNA_def_property_ui_text(prop, "UV Split", "Amount of rows/columns to split uv coordinates for billboards");
+ RNA_def_property_ui_text(prop, "UV Split", "Amount of rows/columns to split UV coordinates for billboards");
prop= RNA_def_property(srna, "billboard_animation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "bb_anim");
RNA_def_property_enum_items(prop, bb_anim_items);
RNA_def_property_ui_text(prop, "Animate", "How to animate billboard textures");
- prop= RNA_def_property(srna, "billboard_split_offset", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "billboard_offset_split", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "bb_split_offset");
RNA_def_property_enum_items(prop, bb_split_offset_items);
RNA_def_property_ui_text(prop, "Offset", "How to offset billboard textures");
@@ -1402,7 +1499,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Tilt", "Tilt of the billboards");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "billboard_random_tilt", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "billboard_tilt_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bb_rand_tilt");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Tilt", "Random tilt of the billboards");
@@ -1417,18 +1514,18 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_redo");
/* simplification */
- prop= RNA_def_property(srna, "enable_simplify", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_ENABLE);
RNA_def_property_ui_text(prop, "Child Simplification", "Remove child strands as the object becomes smaller on the screen");
- prop= RNA_def_property(srna, "viewport", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_simplify_viewport", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_VIEWPORT);
RNA_def_property_ui_text(prop, "Viewport", "");
prop= RNA_def_property(srna, "simplify_refsize", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "simplify_refsize");
RNA_def_property_range(prop, 1, 32768);
- RNA_def_property_ui_text(prop, "Reference Size", "Reference size size in pixels, after which simplification begins");
+ RNA_def_property_ui_text(prop, "Reference Size", "Reference size in pixels, after which simplification begins");
prop= RNA_def_property(srna, "simplify_rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -1443,7 +1540,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Rate", "Speed of Simplification");
/* general values */
- prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sta");//optional if prop names are the same
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -1451,7 +1548,8 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Start", "Frame # to start emitting particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "end", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "end");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -1464,7 +1562,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lifetime", "Specify the life span of the particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "random_lifetime", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "lifetime_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randlife");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random", "Give the particle life a random variation");
@@ -1476,6 +1574,11 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0, 10, 1, 3);
RNA_def_property_ui_text(prop, "Tweak", "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
+
+ prop= RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 0, 1000);
+ RNA_def_property_ui_text(prop, "Subframes", "Subframes to simulate for improved stability and finer granularity simulations");
+ RNA_def_property_update(prop, 0, "rna_Particle_reset");
prop= RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -1487,10 +1590,10 @@ static void rna_def_particle_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "effect_hair", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "eff_hair");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Stiffnes", "Hair stiffness for effectors");
+ RNA_def_property_ui_text(prop, "Stiffness", "Hair stiffness for effectors");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "amount", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "totpart");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
/* This limit is for those freaks who have the machine power to handle it. */
@@ -1531,7 +1634,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Object", "Let the object give the particle a starting speed");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "random_factor", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "factor_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randfac");//optional if prop names are the same
RNA_def_property_range(prop, 0.0f, 200.0f);
RNA_def_property_ui_range(prop, 0, 100, 1, 3);
@@ -1564,7 +1667,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Reactor", "Let the vector away from the target particles location give the particle a starting speed");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "object_aligned_factor", PROP_FLOAT, PROP_VELOCITY);
+ prop= RNA_def_property(srna, "object_align_factor", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "ob_vel");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -200.0f, 200.0f);
@@ -1585,13 +1688,13 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Phase", "Initial rotation phase");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "random_rotation_factor", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "rotation_factor_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randrotfac");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Rotation", "Randomize rotation");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "random_phase_factor", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "phase_factor_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randphasefac");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Phase", "Randomize rotation phase");
@@ -1611,7 +1714,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Size", "The size of the particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "random_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "size_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randsize");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Size", "Give the particle size a random variation");
@@ -1635,17 +1738,17 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "brownfac");
RNA_def_property_range(prop, 0.0f, 200.0f);
RNA_def_property_ui_range(prop, 0, 20, 1, 3);
- RNA_def_property_ui_text(prop, "Brownian", "Specify the amount of brownian motion");
+ RNA_def_property_ui_text(prop, "Brownian", "Specify the amount of Brownian motion");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "damp_factor", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampfac");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Damp", "Specify the amount of damping");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* random length */
- prop= RNA_def_property(srna, "random_length", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "length_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randlength");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Length", "Give path length a random variation");
@@ -1659,7 +1762,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Children Per Parent", "Amount of children/parent");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "rendered_child_nbr", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "rendered_child_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ren_child_nbr");
RNA_def_property_range(prop, 0, 100000);
RNA_def_property_ui_range(prop, 0, 10000, 1, 0);
@@ -1678,7 +1781,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Child Size", "A multiplier for the child particle size");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "child_random_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "child_size_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "childrandsize");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Child Size", "Random variation to the size of the child particles");
@@ -1703,7 +1806,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Clump", "Amount of clumping");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "clumppow", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "clump_shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clumppow");
RNA_def_property_range(prop, -0.999f, 0.999f);
RNA_def_property_ui_text(prop, "Shape", "Shape of clumping");
@@ -1732,46 +1835,49 @@ static void rna_def_particle_settings(BlenderRNA *brna)
/* rough */
- prop= RNA_def_property(srna, "rough1", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "roughness_1", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "rough1");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Rough1", "Amount of location dependent rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "rough1_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "roughness_1_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "rough1_size");
RNA_def_property_range(prop, 0.01f, 100000.0f);
RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Size1", "Size of location dependent rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "rough2", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "roughness_2", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough2");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Rough2", "Amount of random rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "rough2_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "roughness_2_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough2_size");
RNA_def_property_range(prop, 0.01f, 100000.0f);
RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Size2", "Size of random rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "rough2_thres", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "roughness_2_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough2_thres");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by random rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "rough_endpoint", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "roughness_endpoint", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough_end");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Rough Endpoint", "Amount of end point rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "rough_end_shape", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "roughness_end_shape", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "rough_end_shape");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Shape", "Shape of end point rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
@@ -1782,7 +1888,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Length", "Length of child paths");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "child_length_thres", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "child_length_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clength_thres");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by child path length");
@@ -1857,13 +1963,14 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Dupli Group", "Show Objects in this Group in place of particles");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "dupliweights", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "dupli_weights", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "dupliweights", NULL);
RNA_def_property_struct_type(prop, "ParticleDupliWeight");
RNA_def_property_ui_text(prop, "Dupli Group Weights", "Weights for all of the objects in the dupli group");
prop= RNA_def_property(srna, "active_dupliweight", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ParticleDupliWeight");
- RNA_def_property_pointer_funcs(prop, "rna_ParticleDupliWeight_active_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_ParticleDupliWeight_active_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Dupli Object", "");
prop= RNA_def_property(srna, "active_dupliweight_index", PROP_INT, PROP_UNSIGNED);
@@ -1895,13 +2002,13 @@ static void rna_def_particle_settings(BlenderRNA *brna)
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_pointer_funcs(prop, "rna_Particle_field1_get", NULL, 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_pointer_funcs(prop, "rna_Particle_field2_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Force Field 2", "");
}
@@ -1951,12 +2058,13 @@ static void rna_def_particle_target(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Duration", "");
RNA_def_property_update(prop, 0, "rna_Particle_target_redo");
- prop= RNA_def_property(srna, "valid", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTARGET_VALID);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Valid", "Keyed particles target is valid");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "alliance", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, mode_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Mode", "");
@@ -1983,7 +2091,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
//RNA_def_property_pointer_sdna(prop, NULL, "part");
RNA_def_property_struct_type(prop, "ParticleSettings");
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_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Settings", "Particle system settings");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -2002,12 +2110,12 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* hair */
- prop= RNA_def_property(srna, "global_hair", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_global_hair", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_GLOBAL_HAIR);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Global Hair", "Hair keys are in global coordinate space");
- prop= RNA_def_property(srna, "hair_dynamics", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_hair_dynamics", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_HAIR_DYNAMICS);
RNA_def_property_ui_text(prop, "Hair Dynamics", "Enable hair dynamics using cloth simulation");
RNA_def_property_update(prop, 0, "rna_Particle_hair_dynamics");
@@ -2033,7 +2141,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* keyed */
- prop= RNA_def_property(srna, "keyed_timing", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_keyed_timing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIMING);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Keyed timing", "Use key times");
@@ -2045,7 +2153,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_particle_target", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ParticleTarget");
- RNA_def_property_pointer_funcs(prop, "rna_ParticleSystem_active_particle_target_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_ParticleSystem_active_particle_target_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Particle Target", "");
prop= RNA_def_property(srna, "active_particle_target_index", PROP_INT, PROP_UNSIGNED);
@@ -2084,7 +2192,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_density_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_density", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_DENSITY));
RNA_def_property_ui_text(prop, "Vertex Group Density Negate", "Negate the effect of the density vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -2094,7 +2202,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Velocity", "Vertex group to control velocity");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_velocity_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_VEL));
RNA_def_property_ui_text(prop, "Vertex Group Velocity Negate", "Negate the effect of the velocity vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -2104,7 +2212,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Length", "Vertex group to control length");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "vertex_group_length_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_LENGTH));
RNA_def_property_ui_text(prop, "Vertex Group Length Negate", "Negate the effect of the length vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
@@ -2114,7 +2222,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Clump", "Vertex group to control clump");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_clump_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_clump", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_CLUMP));
RNA_def_property_ui_text(prop, "Vertex Group Clump Negate", "Negate the effect of the clump vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
@@ -2124,27 +2232,27 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Kink", "Vertex group to control kink");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_kink_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_kink", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_KINK));
RNA_def_property_ui_text(prop, "Vertex Group Kink Negate", "Negate the effect of the kink vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_roughness1", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "vertex_group_roughness_1", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_5", "rna_ParticleVGroup_name_len_5", "rna_ParticleVGroup_name_set_5");
RNA_def_property_ui_text(prop, "Vertex Group Roughness 1", "Vertex group to control roughness 1");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_roughness1_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_roughness_1", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH1));
RNA_def_property_ui_text(prop, "Vertex Group Roughness 1 Negate", "Negate the effect of the roughness 1 vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_roughness2", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "vertex_group_roughness_2", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_6", "rna_ParticleVGroup_name_len_6", "rna_ParticleVGroup_name_set_6");
RNA_def_property_ui_text(prop, "Vertex Group Roughness 2", "Vertex group to control roughness 2");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_roughness2_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_roughness_2", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH2));
RNA_def_property_ui_text(prop, "Vertex Group Roughness 2 Negate", "Negate the effect of the roughness 2 vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
@@ -2154,7 +2262,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Roughness End", "Vertex group to control roughness end");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_roughness_end_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_roughness_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGHE));
RNA_def_property_ui_text(prop, "Vertex Group Roughness End Negate", "Negate the effect of the roughness end vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
@@ -2164,7 +2272,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Size", "Vertex group to control size");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_size_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_SIZE));
RNA_def_property_ui_text(prop, "Vertex Group Size Negate", "Negate the effect of the size vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -2174,7 +2282,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Tangent", "Vertex group to control tangent");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_tangent_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_tangent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_TAN));
RNA_def_property_ui_text(prop, "Vertex Group Tangent Negate", "Negate the effect of the tangent vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -2184,7 +2292,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Rotation", "Vertex group to control rotation");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_rotation_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROT));
RNA_def_property_ui_text(prop, "Vertex Group Rotation Negate", "Negate the effect of the rotation vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -2194,7 +2302,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Field", "Vertex group to control field");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_field_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_vertex_group_field", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_EFFECTOR));
RNA_def_property_ui_text(prop, "Vertex Group Field Negate", "Negate the effect of the field vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -2206,7 +2314,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache", "");
- prop= RNA_def_property(srna, "multiple_caches", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "has_multiple_caches", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_multiple_caches_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Multiple Caches", "Particle system has multiple point caches");
@@ -2219,12 +2327,12 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_redo");
/* hair or cache editing */
- prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_editable_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Editable", "Particle system can be edited in particle mode");
- prop= RNA_def_property(srna, "edited", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_edited_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Edited", "Particle system has been edited in particle mode");
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 0d31ec4776a..e4a3be023ca 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -37,7 +37,6 @@
#include "DNA_scene_types.h"
#include "BLI_math.h"
-#include "BLI_ghash.h"
#include "WM_types.h"
@@ -49,6 +48,10 @@
#include "DNA_userdef_types.h"
+#include "MEM_guardedalloc.h"
+
+#include "BLI_ghash.h"
+
#include "BKE_context.h"
#include "BKE_constraint.h"
#include "BKE_depsgraph.h"
@@ -59,6 +62,8 @@
#include "MEM_guardedalloc.h"
+#include "WM_api.h"
+
#include "RNA_access.h"
static void rna_Pose_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -117,7 +122,7 @@ static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
}
}
-static IDProperty *rna_PoseBone_idproperties(PointerRNA *ptr, int create)
+static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, int create)
{
bPoseChannel *pchan= ptr->data;
@@ -151,7 +156,7 @@ static void rna_Pose_ik_solver_update(Main *bmain, Scene *scene, PointerRNA *ptr
bPose *pose = ptr->data;
pose->flag |= POSE_RECALC; // checks & sorts pose channels
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
update_pose_constraint_flags(pose);
@@ -431,7 +436,7 @@ static void rna_PoseChannel_active_constraint_set(PointerRNA *ptr, PointerRNA va
constraints_set_active(&pchan->constraints, (bConstraint *)value.data);
}
-static bConstraint *rna_PoseChannel_constraints_new(bPoseChannel *pchan, bContext *C, int type)
+static bConstraint *rna_PoseChannel_constraints_new(bPoseChannel *pchan, int type)
{
//WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
// TODO, pass object also
@@ -439,12 +444,17 @@ static bConstraint *rna_PoseChannel_constraints_new(bPoseChannel *pchan, bContex
return add_pose_constraint(NULL, pchan, NULL, type);
}
-static int rna_PoseChannel_constraints_remove(bPoseChannel *pchan, bContext *C, int index)
+static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, ReportList *reports, bConstraint *con)
{
+ if(BLI_findindex(&pchan->constraints, con) == -1) {
+ BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in pose bone '%s'.", con->name, pchan->name);
+ return;
+ }
+
// TODO
- //ED_object_constraint_set_active(object, NULL);
- //WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, object);
- return remove_constraint_index(&pchan->constraints, index);
+ //ED_object_constraint_set_active(id, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, id);
+ remove_constraint(&pchan->constraints, con);
}
static int rna_PoseChannel_proxy_editable(PointerRNA *ptr)
@@ -632,14 +642,13 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro
/* Collection active property */
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
- RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_active_constraint_get", "rna_PoseChannel_active_constraint_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_active_constraint_get", "rna_PoseChannel_active_constraint_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Constraint", "Active PoseChannel constraint");
/* Constraint collection */
func= RNA_def_function(srna, "new", "rna_PoseChannel_constraints_new");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Add a constraint to this object");
/* return type */
parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint.");
@@ -649,14 +658,11 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "remove", "rna_PoseChannel_constraints_remove");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Remove a constraint from this object.");
- /* return type */
- parm= RNA_def_boolean(func, "success", 0, "Success", "Removed the constraint successfully.");
- RNA_def_function_return(func, parm);
- /* object to add */
- parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "", 0, INT_MAX);
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); /* ID needed for refresh */
+ /* constraint to remove */
+ parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
static void rna_def_pose_channel(BlenderRNA *brna)
@@ -684,7 +690,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "bPoseChannel");
RNA_def_struct_ui_text(srna, "Pose Bone", "Channel defining pose data for a bone in a Pose");
RNA_def_struct_path_func(srna, "rna_PoseBone_path");
- RNA_def_struct_idproperties_func(srna, "rna_PoseBone_idproperties");
+ RNA_def_struct_idprops_func(srna, "rna_PoseBone_idprops");
/* Bone Constraints */
prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
@@ -700,9 +706,9 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "selectflag", BONE_SELECTED);
- RNA_def_property_ui_text(prop, "Selected", "");
+ RNA_def_property_ui_text(prop, "Select", "");
/* Baked Bone Path cache data */
rna_def_motionpath_common(srna);
@@ -805,55 +811,55 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone");
/* IK Settings */
- prop= RNA_def_property(srna, "has_ik", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_in_ik_chain", PROP_BOOLEAN, PROP_NONE);
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_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");
+ prop= RNA_def_property(srna, "lock_ik_x", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
+ RNA_def_property_ui_text(prop, "IK X Lock", "Disallow movement around the X axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
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");
+ prop= RNA_def_property(srna, "lock_ik_y", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
+ RNA_def_property_ui_text(prop, "IK Y Lock", "Disallow movement around the Y axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "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");
+ prop= RNA_def_property(srna, "lock_ik_z", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
+ RNA_def_property_ui_text(prop, "IK Z Lock", "Disallow movement around the Z axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
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);
+ prop= RNA_def_property(srna, "use_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_editable_func(prop, "rna_PoseChannel_proxy_editable");
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);
+ prop= RNA_def_property(srna, "use_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_editable_func(prop, "rna_PoseChannel_proxy_editable");
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);
+ prop= RNA_def_property(srna, "use_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_editable_func(prop, "rna_PoseChannel_proxy_editable");
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);
+ prop= RNA_def_property(srna, "use_ik_rotation_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_editable_func(prop, "rna_PoseChannel_proxy_editable");
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);
+ prop= RNA_def_property(srna, "use_ik_linear_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_editable_func(prop, "rna_PoseChannel_proxy_editable");
@@ -929,14 +935,14 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
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);
+ prop= RNA_def_property(srna, "ik_rotation_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_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "ik_lin_weight", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "ik_linear_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");
@@ -972,7 +978,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
prop= RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoneGroup");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_group_get", "rna_PoseChannel_bone_group_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_group_get", "rna_PoseChannel_bone_group_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Bone Group", "Bone Group this pose channel belongs to");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
@@ -982,6 +988,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
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_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
@@ -989,6 +996,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
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_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
@@ -996,6 +1004,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
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");
+ RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
@@ -1010,6 +1019,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
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_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
@@ -1041,13 +1051,13 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "iterations", 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);
+ prop= RNA_def_property(srna, "step_count", 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");
@@ -1059,24 +1069,24 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Mode", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild");
- prop= RNA_def_property(srna, "reiteration", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "reiteration_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_itasc_reiteration_items);
RNA_def_property_ui_text(prop, "Reiteration", "Defines if the solver is allowed to reiterate (converges until precision is met) on none, first or 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);
+ prop= RNA_def_property(srna, "use_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_ui_text(prop, "Auto step", "Automatically determine the optimal number of steps for best performance/accuracy 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);
+ prop= RNA_def_property(srna, "step_min", 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);
+ prop= RNA_def_property(srna, "step_max", 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");
@@ -1088,7 +1098,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "velocity_max", 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");
@@ -1100,13 +1110,13 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "damping_max", 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);
+ prop= RNA_def_property(srna, "damping_epsilon", 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");
@@ -1130,6 +1140,34 @@ static void rna_def_pose_ikparam(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "IK Solver", "IK solver for which these parameters are defined, 0 for Legacy, 1 for iTaSC");
}
+/* pose.bone_groups */
+static void rna_def_bone_groups(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+// FunctionRNA *func;
+// PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "BoneGroups");
+ srna= RNA_def_struct(brna, "BoneGroups", NULL);
+ RNA_def_struct_sdna(srna, "bPose");
+ RNA_def_struct_ui_text(srna, "Bone Groups", "Collection of bone groups");
+
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "BoneGroup");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "active_group");
+ 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");
+}
+
static void rna_def_pose(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1151,19 +1189,7 @@ static void rna_def_pose(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "agroups", NULL);
RNA_def_property_struct_type(prop, "BoneGroup");
RNA_def_property_ui_text(prop, "Bone Groups", "Groups of the bones");
-
- prop= RNA_def_property(srna, "active_bone_group", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "BoneGroup");
- RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL);
- RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "active_bone_group_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "active_group");
- 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");
+ rna_def_bone_groups(brna, prop);
/* ik solvers */
prop= RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
@@ -1175,7 +1201,7 @@ static void rna_def_pose(BlenderRNA *brna)
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_pointer_funcs(prop, "rna_Pose_ikparam_get", NULL, "rna_Pose_ikparam_typef", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "IK Param", "Parameters for IK solver");
diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c
index 6de403f28d1..13f913b978b 100644
--- a/source/blender/makesrna/intern/rna_property.c
+++ b/source/blender/makesrna/intern/rna_property.c
@@ -30,6 +30,8 @@
#include "DNA_property_types.h"
+#include "WM_types.h"
+
#ifdef RNA_RUNTIME
#include "BKE_property.h"
@@ -108,27 +110,32 @@ void RNA_def_gameproperty(BlenderRNA *brna)
RNA_def_struct_refine_func(srna, "rna_GameProperty_refine");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- RNA_def_property_ui_text(prop, "Name", "Available as as GameObject attributes in the game engines python api");
+ RNA_def_property_ui_text(prop, "Name", "Available as GameObject attributes in the game engine's python API");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GameProperty_name_set");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, gameproperty_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_enum_funcs(prop, NULL, "rna_GameProperty_type_set", NULL);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "debug", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_debug", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PROP_DEBUG);
RNA_def_property_ui_text(prop, "Debug", "Print debug information for this property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameBooleanProperty */
srna= RNA_def_struct(brna, "GameBooleanProperty", "GameProperty");
- RNA_def_struct_ui_text(srna , "Game Boolean Property", "Game engine user defined boolean property");
+ RNA_def_struct_ui_text(srna , "Game Boolean Property", "Game engine user defined Boolean property");
RNA_def_struct_sdna(srna, "bProperty");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "data", 1);
RNA_def_property_ui_text(prop, "Value", "Property value");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameIntProperty */
srna= RNA_def_struct(brna, "GameIntProperty", "GameProperty");
@@ -139,6 +146,7 @@ void RNA_def_gameproperty(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "data");
RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_range(prop, -10000, 10000);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameFloatProperty */
srna= RNA_def_struct(brna, "GameFloatProperty", "GameProperty");
@@ -150,6 +158,7 @@ void RNA_def_gameproperty(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_range(prop, -10000, 10000);
RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameTimerProperty */
srna= RNA_def_struct(brna, "GameTimerProperty", "GameProperty");
@@ -161,6 +170,7 @@ void RNA_def_gameproperty(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_range(prop, -10000, 10000);
RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameStringProperty */
srna= RNA_def_struct(brna, "GameStringProperty", "GameProperty");
@@ -171,6 +181,7 @@ void RNA_def_gameproperty(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "poin");
RNA_def_property_string_maxlength(prop, MAX_PROPSTRING);
RNA_def_property_ui_text(prop, "Value", "Property value");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index d00507e8bcf..e4a89ed3121 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -277,11 +277,11 @@ static void rna_def_render_engine(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_flag(prop, PROP_REGISTER);
- prop= RNA_def_property(srna, "bl_preview", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "bl_use_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_DO_PREVIEW);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
- prop= RNA_def_property(srna, "bl_postprocess", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_DO_ALL);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index c75706b91bb..4bfd0e4fd41 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -53,7 +53,7 @@ EnumPropertyItem property_unit_items[] = {
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
-
+#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
/* Struct */
@@ -201,7 +201,7 @@ static void rna_Struct_properties_next(CollectionPropertyIterator *iter)
/* try id properties */
if(!iter->valid) {
- group= RNA_struct_idproperties(&iter->builtin_parent, 0);
+ group= RNA_struct_idprops(&iter->builtin_parent, 0);
if(group) {
rna_iterator_listbase_end(iter);
@@ -335,7 +335,7 @@ PointerRNA rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key
if(ptr->data) {
IDProperty *group, *idp;
- group= RNA_struct_idproperties(ptr, 0);
+ group= RNA_struct_idprops(ptr, 0);
if(group) {
for(idp=group->data.group.first; idp; idp=idp->next) {
@@ -811,6 +811,12 @@ static int rna_Function_registered_optional_get(PointerRNA *ptr)
return func->flag & FUNC_REGISTER_OPTIONAL;
}
+static int rna_Function_no_self_get(PointerRNA *ptr)
+{
+ FunctionRNA *func= (FunctionRNA*)ptr->data;
+ return !(func->flag & FUNC_NO_SELF);
+}
+
/* Blender RNA */
static void rna_BlenderRNA_structs_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
@@ -884,19 +890,19 @@ static void rna_def_struct(BlenderRNA *brna)
prop= RNA_def_property(srna, "base", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Struct");
- RNA_def_property_pointer_funcs(prop, "rna_Struct_base_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Struct_base_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Base", "Struct definition this is derived from");
prop= RNA_def_property(srna, "nested", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Struct");
- RNA_def_property_pointer_funcs(prop, "rna_Struct_nested_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Struct_nested_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Nested", "Struct in which this struct is always nested, and to which it logically belongs");
prop= RNA_def_property(srna, "name_property", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "StringProperty");
- RNA_def_property_pointer_funcs(prop, "rna_Struct_name_property_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Struct_name_property_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Name Property", "Property that gives the name of the struct");
prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
@@ -974,7 +980,7 @@ static void rna_def_property(BlenderRNA *brna)
prop= RNA_def_property(srna, "srna", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Struct");
- RNA_def_property_pointer_funcs(prop, "rna_Property_srna_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Property_srna_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Base", "Struct definition used for properties assigned to this item");
prop= RNA_def_property(srna, "unit", PROP_ENUM, PROP_NONE);
@@ -991,27 +997,27 @@ static void rna_def_property(BlenderRNA *brna)
prop= RNA_def_property(srna, "is_required", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_is_required_get", NULL);
- RNA_def_property_ui_text(prop, "Required", "False when this property is an optional argument in an rna function");
+ RNA_def_property_ui_text(prop, "Required", "False when this property is an optional argument in an RNA function");
prop= RNA_def_property(srna, "is_never_none", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_is_never_none_get", NULL);
RNA_def_property_ui_text(prop, "Never None", "True when this value can't be set to None");
- prop= RNA_def_property(srna, "use_output", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_output", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_use_output_get", NULL);
- RNA_def_property_ui_text(prop, "Return", "True when this property is an output value from an rna function");
+ RNA_def_property_ui_text(prop, "Return", "True when this property is an output value from an RNA function");
- prop= RNA_def_property(srna, "registered", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_registered", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_registered_get", NULL);
- RNA_def_property_ui_text(prop, "Registered", "Property is registerd as part of type registration");
+ RNA_def_property_ui_text(prop, "Registered", "Property is registered as part of type registration");
- prop= RNA_def_property(srna, "registered_optional", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_registered_optional", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_registered_optional_get", NULL);
- RNA_def_property_ui_text(prop, "Registered Optionally", "Property is optionally registerd as part of type registration");
+ RNA_def_property_ui_text(prop, "Registered Optionally", "Property is optionally registered as part of type registration");
}
static void rna_def_function(BlenderRNA *brna)
@@ -1040,15 +1046,20 @@ static void rna_def_function(BlenderRNA *brna)
RNA_def_property_collection_funcs(prop, "rna_Function_parameters_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
RNA_def_property_ui_text(prop, "Parameters", "Parameters for the function");
- prop= RNA_def_property(srna, "registered", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_registered", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Function_registered_get", NULL);
- RNA_def_property_ui_text(prop, "Registered", "Function is registerd as callback as part of type registration");
+ RNA_def_property_ui_text(prop, "Registered", "Function is registered as callback as part of type registration");
- prop= RNA_def_property(srna, "registered_optional", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_registered_optional", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Function_registered_optional_get", NULL);
- RNA_def_property_ui_text(prop, "Registered Optionally", "Function is optionally registerd as callback part of type registration");
+ RNA_def_property_ui_text(prop, "Registered Optionally", "Function is optionally registered as callback part of type registration");
+
+ prop= RNA_def_property(srna, "use_self", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_Function_no_self_get", NULL);
+ RNA_def_property_ui_text(prop, "No Self", "Function does not pass its self as an argument (becomes a class method in python)");
}
static void rna_def_number_property(StructRNA *srna, PropertyType type)
@@ -1151,7 +1162,7 @@ static void rna_def_string_property(StructRNA *srna)
RNA_def_property_string_funcs(prop, "rna_StringProperty_default_get", "rna_StringProperty_default_length", NULL);
RNA_def_property_ui_text(prop, "Default", "string default value");
- prop= RNA_def_property(srna, "max_length", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "length_max", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_StringProperty_max_length_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Maximum Length", "Maximum length of the string, 0 means unlimited");
@@ -1212,9 +1223,9 @@ static void rna_def_pointer_property(StructRNA *srna, PropertyType type)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Struct");
if(type == PROP_POINTER)
- RNA_def_property_pointer_funcs(prop, "rna_PointerProperty_fixed_type_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_PointerProperty_fixed_type_get", NULL, NULL, NULL);
else
- RNA_def_property_pointer_funcs(prop, "rna_CollectionProperty_fixed_type_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_CollectionProperty_fixed_type_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Pointer Type", "Fixed pointer type, empty if variable type");
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index e0118945574..5ff1dbcd2b9 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -31,6 +31,7 @@
#include "DNA_group_types.h"
#include "DNA_modifier_types.h"
+#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
@@ -39,6 +40,7 @@
#ifdef WITH_QUICKTIME
#include "quicktime_export.h"
+#include "AUD_C-API.h"
#endif
#ifdef WITH_FFMPEG
@@ -92,31 +94,42 @@ EnumPropertyItem snap_element_items[] = {
EnumPropertyItem image_type_items[] = {
{0, "", 0, "Image", NULL},
+ {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""},
+ //{R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, // XXX not yet implemented
+ {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""},
{R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""},
{R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""},
#ifdef WITH_OPENJPEG
{R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""},
#endif
- {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""},
{R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""},
{R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", ""},
- //{R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, // XXX not yet implemented
- //{R_HAMX, "HAMX", ICON_FILE_IMAGE, "HamX", ""}, // should remove this format, 8bits are so 80's
- {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""},
{0, "", 0, " ", NULL},
+#ifdef WITH_CINEON
+ {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""},
+ {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", ""},
+#endif
#ifdef WITH_OPENEXR
- {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""},
{R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""},
+ {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""},
#endif
- {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""}, // XXX only with G.have_libtiff
+#ifdef WITH_HDR
{R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", ""},
- {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""},
- {R_DPX, "DPX", ICON_FILE_IMAGE, "DPX", ""},
+#endif
+#ifdef WITH_TIFF
+ {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""},
+#endif
{0, "", 0, "Movie", NULL},
- {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", ""},
- {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", ""},
#ifdef _WIN32
- {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""},
+ {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""}, // XXX Missing codec menu
+#endif
+ {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", ""},
+ {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", ""},
+ {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
+#ifdef WITH_FFMPEG
+ {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
+ {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", ""},
+ {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
#endif
#ifdef WITH_QUICKTIME
# ifdef USE_QTKIT
@@ -125,16 +138,9 @@ EnumPropertyItem image_type_items[] = {
{R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", ""},
# endif
#endif
-#ifdef __sgi
- {R_MOVIE, "MOVIE", ICON_FILE_MOVIE, "Movie", ""},
-#endif
#ifdef WITH_FFMPEG
- {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
{R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""},
- {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
- {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", ""},
#endif
- {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
@@ -144,6 +150,8 @@ EnumPropertyItem image_type_items[] = {
#include "DNA_object_types.h"
#include "DNA_mesh_types.h"
+#include "MEM_guardedalloc.h"
+
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_image.h"
@@ -155,16 +163,17 @@ EnumPropertyItem image_type_items[] = {
#include "BKE_image.h"
#include "BKE_mesh.h"
#include "BKE_sound.h"
+#include "BKE_screen.h"
#include "BLI_threads.h"
#include "BLI_editVert.h"
+#include "BLI_blenlib.h"
#include "WM_api.h"
#include "ED_info.h"
#include "ED_node.h"
#include "ED_view3d.h"
-#include "ED_object.h"
#include "ED_mesh.h"
#include "ED_keyframing.h"
@@ -178,15 +187,11 @@ static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
}
-static Base *rna_Scene_object_link(Scene *scene, ReportList *reports, Object *ob)
+static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
{
+ Scene *scene_act= CTX_data_scene(C);
Base *base;
- if (ob->type != OB_EMPTY && ob->data==NULL) {
- BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is not an Empty type and has no Object Data set.", ob->id.name+2);
- return NULL;
- }
-
if (object_in_scene(ob, scene)) {
BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
return NULL;
@@ -196,34 +201,47 @@ static Base *rna_Scene_object_link(Scene *scene, ReportList *reports, Object *ob
ob->id.us++;
/* this is similar to what object_add_type and add_object do */
- ob->lay= base->lay= scene->lay;
- ob->recalc |= OB_RECALC;
+ base->lay= scene->lay;
+
+ /* when linking to an inactive scene dont touch the layer */
+ if(scene == scene_act)
+ ob->lay= base->lay;
+
+ ob->recalc |= OB_RECALC_ALL;
+
+ /* slows down importers too much, run scene.update() */
+ /* DAG_scene_sort(G.main, scene); */
- DAG_scene_sort(scene);
+ WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
return base;
}
-static void rna_Scene_object_unlink(Scene *scene, bContext *C, ReportList *reports, Object *ob)
+static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
{
Base *base= object_in_scene(ob, scene);
if (!base) {
- BKE_report(reports, RPT_ERROR, "Object is not in this scene.");
+ BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'.", ob->id.name+2, scene->id.name+2);
return;
}
if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
- BKE_report(reports, RPT_ERROR, "Object must be in 'Object Mode' to unlink.");
+ BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink.", ob->id.name+2);
return;
}
+ if(scene->basact==base) {
+ scene->basact= NULL;
+ }
- /* 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(scene, base);
+ BLI_remlink(&scene->base, base);
+ MEM_freeN(base);
+
+ ob->id.us--;
/* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
- DAG_scene_sort(scene);
- DAG_ids_flush_update(0);
+ DAG_scene_sort(G.main, scene);
+ DAG_ids_flush_update(G.main, 0);
- WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
+ WM_main_add_notifier(NC_SCENE|ND_OB_ACTIVE, scene);
}
static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
@@ -268,14 +286,14 @@ static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
{
Scene *scene= (Scene*)ptr->data;
- scene->lay= ED_view3d_scene_layer_set(scene->lay, values);
+ scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
}
-static void rna_Scene_layer_update(Main *bmain, Scene *unused, PointerRNA *ptr)
+static void rna_Scene_view3d_update(Main *bmain, Scene *unused, PointerRNA *ptr)
{
Scene *scene= (Scene*)ptr->data;
- ED_view3d_scene_layers_update(bmain, scene);
+ BKE_screen_view3d_main_sync(&bmain->screen, scene);
}
static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
@@ -373,16 +391,24 @@ static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
}
-#if 0 // XXX: these need to be fixed up first...
-static void rna_Scene_active_keying_set_index_range(PointerRNA *ptr, int *min, int *max)
+/* get KeyingSet index stuff for list of Keying Sets editing UI
+ * - active_keyingset-1 since 0 is reserved for 'none'
+ * - don't clamp, otherwise can never set builtins types as active...
+ */
+static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
{
- Scene *scene= (Scene *)ptr->data;
-
- // FIXME: would need access to builtin keyingsets list to count min...
- *min= 0;
- *max= 0;
+ Scene *scene= (Scene *)ptr->data;
+ return scene->active_keyingset-1;
+}
+
+/* get KeyingSet index stuff for list of Keying Sets editing UI
+ * - value+1 since 0 is reserved for 'none'=
+ */
+static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
+{
+ Scene *scene= (Scene *)ptr->data;
+ scene->active_keyingset= value+1;
}
-#endif
// XXX: evil... builtin_keyingsets is defined in keyingsets.c!
// TODO: make API function to retrieve this...
@@ -523,14 +549,14 @@ static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
{
RenderData *rd= (RenderData*)ptr->data;
- return quicktime_rnatmpvalue_from_codectype(rd->qtcodecsettings.codecType);
+ return quicktime_rnatmpvalue_from_videocodectype(rd->qtcodecsettings.codecType);
}
static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
{
RenderData *rd= (RenderData*)ptr->data;
- rd->qtcodecsettings.codecType = quicktime_codecType_from_rnatmpvalue(value);
+ rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
}
static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, int *free)
@@ -541,8 +567,8 @@ static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bCon
int i=1, totitem= 0;
char id[5];
- for(i=0;i<quicktime_get_num_codecs();i++) {
- codecTypeDesc = quicktime_get_codecType_desc(i);
+ for(i=0;i<quicktime_get_num_videocodecs();i++) {
+ codecTypeDesc = quicktime_get_videocodecType_desc(i);
if (!codecTypeDesc) break;
tmp.value= codecTypeDesc->rnatmpvalue;
@@ -557,8 +583,47 @@ static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bCon
*free= 1;
return item;
+}
+
+#ifdef USE_QTKIT
+static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+
+ return quicktime_rnatmpvalue_from_audiocodectype(rd->qtcodecsettings.audiocodecType);
+}
+
+static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+
+ rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
+}
+
+static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ EnumPropertyItem *item= NULL;
+ EnumPropertyItem tmp = {0, "", 0, "", ""};
+ QuicktimeCodecTypeDesc *codecTypeDesc;
+ int i=1, totitem= 0;
+
+ for(i=0;i<quicktime_get_num_audiocodecs();i++) {
+ codecTypeDesc = quicktime_get_audiocodecType_desc(i);
+ if (!codecTypeDesc) break;
+
+ tmp.value= codecTypeDesc->rnatmpvalue;
+ tmp.identifier= codecTypeDesc->codecName;
+ tmp.name= codecTypeDesc->codecName;
+ RNA_enum_item_add(&item, &totitem, &tmp);
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+ *free= 1;
+
+ return item;
}
#endif
+#endif
static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
{
@@ -581,6 +646,22 @@ static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *mi
*max= MAX2(0, *max);
}
+static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+ SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
+
+ return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
+}
+
+static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+ SceneRenderLayer *srl= (SceneRenderLayer*)value.data;
+
+ rd->actlay = BLI_findindex(&rd->layers, srl);
+}
+
static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
{
RenderData *rd= (RenderData*)ptr->data;
@@ -623,6 +704,13 @@ static int rna_RenderSettings_engine_get(PointerRNA *ptr)
return 0;
}
+static void rna_Scene_glsl_update(Main *bmain, Scene *unused, PointerRNA *ptr)
+{
+ Scene *scene= (Scene*)ptr->id.data;
+
+ DAG_id_flush_update(&scene->id, 0);
+}
+
static void rna_RenderSettings_color_management_update(Main *bmain, Scene *unused, PointerRNA *ptr)
{
/* reset image nodes */
@@ -641,6 +729,8 @@ static void rna_RenderSettings_color_management_update(Main *bmain, Scene *unuse
}
}
}
+
+ rna_Scene_glsl_update(bmain, unused, ptr);
}
static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
@@ -683,7 +773,7 @@ static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
{
SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
- rl->lay= ED_view3d_scene_layer_set(rl->lay, values);
+ rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL);
}
static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *unused, PointerRNA *ptr)
@@ -748,10 +838,14 @@ static void rna_Scene_editmesh_select_mode_update(Main *bmain, Scene *scene, Poi
static void object_simplify_update(Object *ob)
{
ModifierData *md;
+ ParticleSystem *psys;
for(md=ob->modifiers.first; md; md=md->next)
if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
- ob->recalc |= OB_RECALC_DATA;
+ ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
+
+ for(psys=ob->particlesystem.first; psys; psys=psys->next)
+ psys->recalc |= PSYS_RECALC_CHILD;
if(ob->dup_group) {
GroupObject *gob;
@@ -761,17 +855,24 @@ static void object_simplify_update(Object *ob)
}
}
-static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
+ Scene *sce;
Base *base;
- for(base= scene->base.first; base; base= base->next)
+ for(SETLOOPER(scene, base))
object_simplify_update(base->object);
- DAG_ids_flush_update(0);
+ DAG_ids_flush_update(bmain, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
}
+static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ if(scene->r.mode & R_SIMPLIFY)
+ rna_Scene_use_simplify_update(bmain, scene, ptr);
+}
+
static int rna_Scene_sync_mode_get(PointerRNA *ptr)
{
Scene *scene= (Scene*)ptr->data;
@@ -904,7 +1005,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Sculpt");
RNA_def_property_ui_text(prop, "Sculpt", "");
- prop = RNA_def_property(srna, "auto_normalize", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
"Ensure all bone-deforming vertex groups add up to 1.0 while "
@@ -927,13 +1028,19 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Particle Edit", "");
/* Transform */
- prop= RNA_def_property(srna, "proportional_editing", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "proportional");
RNA_def_property_enum_items(prop, proportional_editing_items);
RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode");
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
+ RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing object mode");
+ RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
+ RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
+
+ prop= RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
RNA_def_property_enum_items(prop, proportional_falloff_items);
RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
@@ -946,17 +1053,17 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
- prop= RNA_def_property(srna, "automerge_editing", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
- prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
@@ -974,52 +1081,53 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "snap_peel_object", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "snap_project", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
RNA_def_property_ui_text(prop, "Project Individual Elements", "Project vertices on the surface of other objects");
RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
/* Auto Keying */
- prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
+ RNA_def_property_ui_icon(prop, ICON_REC, 0);
- prop= RNA_def_property(srna, "autokey_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
RNA_def_property_enum_items(prop, auto_key_items);
RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
- prop= RNA_def_property(srna, "record_with_nla", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
RNA_def_property_ui_text(prop, "Layered", "Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking");
/* UV */
- prop= RNA_def_property(srna, "uv_selection_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
RNA_def_property_enum_items(prop, uv_select_mode_items);
RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "uv_sync_selection", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "uv_local_view", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
/* Mesh */
- prop= RNA_def_property(srna, "mesh_selection_mode", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
RNA_def_property_array(prop, 3);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
@@ -1037,20 +1145,20 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
/* etch-a-ton */
- prop= RNA_def_property(srna, "bone_sketching", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
// RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
- prop= RNA_def_property(srna, "etch_quick", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
- prop= RNA_def_property(srna, "etch_overdraw", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
- prop= RNA_def_property(srna, "etch_autoname", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
@@ -1066,7 +1174,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Object");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
@@ -1099,6 +1207,16 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_enum_items(prop, sketch_convert_items);
RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
+ /* Sculpt/Paint Unified Size and Strength */
+
+ prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
+ RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius", "Instead of per brush radius, the radius is shared across brushes");
+
+ prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
+ RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength", "Instead of per brush strength, the strength is shared across brushes");
}
@@ -1174,7 +1292,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* layers */
- prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
@@ -1183,7 +1301,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_LAYER);
+ prop= RNA_def_property(srna, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers");
@@ -1191,214 +1309,222 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* layer options */
- prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "zmask", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "zmask_negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "all_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "solid", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "ztransp", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "strand", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* passes */
- prop= RNA_def_property(srna, "pass_combined", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_vector", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_normal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_uv", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_mist", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_object_index", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_color", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_specular", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_shadow", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_ao", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_reflection", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_refraction", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_emit", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_environment", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_indirect", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_specular_exclude", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_shadow_exclude", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_ao_exclude", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_reflection_exclude", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_refraction_exclude", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_emit_exclude", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_environment_exclude", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "pass_indirect_exclude", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
}
@@ -1469,7 +1595,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_range(prop, 8, 32);
RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
@@ -1482,19 +1608,19 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "fullscreen", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
RNA_def_property_update(prop, NC_SCENE, NULL);
/* Framing */
- prop= RNA_def_property(srna, "framing_type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "framing.type");
RNA_def_property_enum_items(prop, framing_types_items);
RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "framing_color", PROP_FLOAT, PROP_COLOR);
+ prop= RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "framing.col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Framing Color", "Set colour of the bars");
@@ -1513,7 +1639,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "eye_separation", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
RNA_def_property_range(prop, 0.01, 5.0);
RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
@@ -1529,7 +1655,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "dome_tesselation", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dome.res");
RNA_def_property_ui_range(prop, 1, 8, 1, 1);
- RNA_def_property_ui_text(prop, "Tesselation", "Tesselation level - check the generated mesh in wireframe mode");
+ RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
@@ -1573,7 +1699,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "occlusionRes");
RNA_def_property_range(prop, 128.0, 1024.0);
- RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precsion (slower)");
+ RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
@@ -1607,10 +1733,10 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
/* mode */
prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
- RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustrum and occlusion culling");
+ RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
// not used // deprecated !!!!!!!!!!!!!
- prop= RNA_def_property(srna, "activity_culling", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
@@ -1635,7 +1761,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
- RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather then rendering as many frames as possible");
+ RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
@@ -1649,7 +1775,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
- prop= RNA_def_property(srna, "auto_start", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
@@ -1660,35 +1786,35 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "glsl_lights", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
- RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
+ RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "glsl_shaders", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
- RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
+ RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "glsl_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
- RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
+ RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "glsl_ramps", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
- RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
+ RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "glsl_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
- RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
+ RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
- RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
+ RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
}
static void rna_def_scene_render_layer(BlenderRNA *brna)
@@ -1697,10 +1823,40 @@ static void rna_def_scene_render_layer(BlenderRNA *brna)
srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
+ RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
rna_def_render_layer_common(srna, 1);
}
+/* curve.splines */
+static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ // FunctionRNA *func;
+ // PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "RenderLayers");
+ srna= RNA_def_struct(brna, "RenderLayers", NULL);
+ RNA_def_struct_sdna(srna, "RenderData");
+ RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "actlay");
+ RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
+ RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
+ RNA_def_property_struct_type(prop, "SceneRenderLayer");
+ RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get", "rna_RenderSettings_active_layer_set", NULL, NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+}
+
static void rna_def_scene_render_data(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1824,6 +1980,35 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
static EnumPropertyItem quicktime_codec_type_items[] = {
{0, "codec", 0, "codec", ""},
{0, NULL, 0, NULL, NULL}};
+
+#ifdef USE_QTKIT
+ static EnumPropertyItem quicktime_audio_samplerate_items[] = {
+ {22050, "22050", 0, "22kHz", ""},
+ {44100, "44100", 0, "44.1kHz", ""},
+ {48000, "48000", 0, "48kHz", ""},
+ {88200, "88200", 0, "88.2kHz", ""},
+ {96000, "96000", 0, "96kHz", ""},
+ {192000, "192000", 0, "192kHz", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
+ {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
+ {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
+ {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
+ {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
+ {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
+ {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem quicktime_audio_bitrate_items[] = {
+ {64000, "64000", 0, "64kbps", ""},
+ {112000, "112000", 0, "112kpbs", ""},
+ {128000, "128000", 0, "128kbps", ""},
+ {192000, "192000", 0, "192kbps", ""},
+ {256000, "256000", 0, "256kbps", ""},
+ {320000, "320000", 0, "320kbps", ""},
+ {0, NULL, 0, NULL, NULL}};
+#endif
#endif
#ifdef WITH_FFMPEG
@@ -1931,20 +2116,20 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "quality");
- RNA_def_property_range(prop, 1, 100);
- RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies");
+ RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
+ RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, Compression for PNG's");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* Tiff */
- prop= RNA_def_property(srna, "tiff_bit", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_tiff_16bit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT);
RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* Cineon and DPX */
- prop= RNA_def_property(srna, "cineon_log", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG);
RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -1976,7 +2161,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "exr_half", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_exr_half", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
RNA_def_property_ui_text(prop, "Half", "Use 16 bit floats instead of 32 bit floats per channel");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2031,8 +2216,47 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+#ifdef USE_QTKIT
+ prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType");
+ RNA_def_property_enum_items(prop, quicktime_codec_type_items);
+ RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
+ "rna_RenderSettings_qtcodecsettings_audiocodecType_set",
+ "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
+ RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate");
+ RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
+ RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth");
+ RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
+ RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
+ RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
+ RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate");
+ RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
+ RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
#endif
+#endif
#ifdef WITH_FFMPEG
/* FFMPEG Video*/
@@ -2143,7 +2367,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "pixel_filter", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filtertype");
RNA_def_property_enum_items(prop, pixel_filter_items);
RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
@@ -2167,7 +2391,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "raytrace_structure", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
RNA_def_property_enum_items(prop, raytrace_structure_items);
RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
@@ -2183,7 +2407,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Local Coords", "Vertex coordinates are stored localy on each primitive. Increases memory usage, but may have impact on speed");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "antialiasing", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2194,7 +2418,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2205,42 +2429,43 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "use_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, "render_shadows", PROP_BOOLEAN, PROP_NONE);
+ /* rendering features */
+ prop= RNA_def_property(srna, "use_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");
+ RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "render_envmaps", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
- RNA_def_property_ui_text(prop, "Render Environment Maps", "Calculate environment maps while rendering");
+ RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "render_radiosity", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
- RNA_def_property_ui_text(prop, "Render Radiosity", "Calculate radiosity in a pre-process before rendering");
+ RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "render_sss", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
- RNA_def_property_ui_text(prop, "Render SSS", "Calculate sub-surface scattering in materials rendering");
+ RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "render_raytracing", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
- RNA_def_property_ui_text(prop, "Render Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
+ RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "render_textures", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
- RNA_def_property_ui_text(prop, "Render Textures", "Use textures to affect material properties");
+ RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2257,6 +2482,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Edge Color", "");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ /* threads */
prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "threads");
RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
@@ -2270,7 +2496,8 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
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);
+ /* motion blur */
+ prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2281,6 +2508,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ prop= RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "blurfac");
+ RNA_def_property_range(prop, 0.01f, 10.0f);
+ RNA_def_property_ui_range(prop, 0.01, 2.0f, 1, 0);
+ RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ /* border */
prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
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. Note, this disables save_buffers and full_sample");
@@ -2310,7 +2545,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2335,10 +2570,11 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "color_management", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
- RNA_def_property_ui_text(prop, "Color Management", "Use color profiles and gamma corrected imaging pipeline");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_MATERIAL|ND_SHADING, "rna_RenderSettings_color_management_update");
+ RNA_def_property_ui_text(prop, "Color Management", "Use linear workflow - gamma corrected imaging pipeline");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_RenderSettings_color_management_update");
+
prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
@@ -2362,29 +2598,29 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
- prop= RNA_def_property(srna, "free_image_textures", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
+ prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, required for Full Sample)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "backbuf", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_backbuf", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", R_BACKBUF);
RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2395,7 +2631,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "pic");
RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2421,19 +2657,19 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_items(prop, fixed_oversample_items);
RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
- prop= RNA_def_property(srna, "bake_active", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
- prop= RNA_def_property(srna, "bake_normalized", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings");
- prop= RNA_def_property(srna, "bake_clear", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
- prop= RNA_def_property(srna, "bake_enable_aa", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_bake_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
@@ -2454,52 +2690,52 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
/* stamp */
- prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_date", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_frame", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_camera", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_scene", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_note", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_marker", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_filename", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_render_time", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2509,7 +2745,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "render_stamp", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2547,12 +2783,12 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
- RNA_def_property_enum_items(prop, viewport_shading_items);
+ RNA_def_property_enum_items(prop, viewport_shade_items);
RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
- RNA_def_property_enum_items(prop, viewport_shading_items);
+ RNA_def_property_enum_items(prop, viewport_shade_items);
RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
/* layers */
@@ -2561,18 +2797,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
RNA_def_property_struct_type(prop, "SceneRenderLayer");
RNA_def_property_ui_text(prop, "Render Layers", "");
+ rna_def_render_layers(brna, prop);
- prop= RNA_def_property(srna, "single_layer", PROP_BOOLEAN, PROP_NONE);
+
+ prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "actlay");
- RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
- RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
-
/* engine */
prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, engine_items);
@@ -2580,7 +2812,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
RNA_def_property_update(prop, NC_WINDOW, NULL);
- prop= RNA_def_property(srna, "multiple_engines", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
@@ -2594,9 +2826,9 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
- RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
+ RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
- prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
RNA_def_property_ui_range(prop, 0, 6, 1, 0);
RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
@@ -2618,7 +2850,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor");
RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
- prop= RNA_def_property(srna, "simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated");
@@ -2641,8 +2873,8 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
func= RNA_def_function(srna, "link", "rna_Scene_object_link");
- RNA_def_function_ui_description(func, "Link object to scene.");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after.");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
@@ -2650,13 +2882,13 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
RNA_def_function_ui_description(func, "Unlink object from scene.");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
+ 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);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
- RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene");
/* Could call: ED_base_object_activate(C, scene->basact);
@@ -2716,6 +2948,75 @@ static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
+/* scene.keying_sets */
+static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+// FunctionRNA *func;
+// PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "KeyingSets");
+ srna= RNA_def_struct(brna, "KeyingSets", NULL);
+ RNA_def_struct_sdna(srna, "Scene");
+ RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
+
+ /*
+ func= RNA_def_function(srna, "new", "rna_Curve_spline_new");
+ RNA_def_function_ui_description(func, "Add a new spline to the curve.");
+ parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+ */
+
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "KeyingSet");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
+ RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
+ RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
+}
+
+static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ RNA_def_property_srna(cprop, "KeyingSetsAll");
+ srna= RNA_def_struct(brna, "KeyingSetsAll", NULL);
+ RNA_def_struct_sdna(srna, "Scene");
+ RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
+
+ /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
+
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "KeyingSet");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
+ RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
+ RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
+}
+
void RNA_def_scene(BlenderRNA *brna)
{
StructRNA *srna;
@@ -2747,14 +3048,15 @@ void RNA_def_scene(BlenderRNA *brna)
/* Global Settings */
prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene");
- RNA_def_property_update(prop, NC_SCENE, NULL);
+ RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_view3d_update");
- prop= RNA_def_property(srna, "set", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "set");
RNA_def_property_struct_type(prop, "Scene");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
@@ -2763,14 +3065,14 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
RNA_def_property_update(prop, NC_SCENE|NC_WORLD, NULL);
- prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ|PROP_UNIT_LENGTH);
+ prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "cursor");
RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location");
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
RNA_def_property_update(prop, NC_WINDOW, NULL);
/* Bases/Objects */
- prop= RNA_def_property(srna, "bases", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "object_bases", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
RNA_def_property_struct_type(prop, "ObjectBase");
RNA_def_property_ui_text(prop, "Bases", "");
@@ -2784,12 +3086,12 @@ void RNA_def_scene(BlenderRNA *brna)
rna_def_scene_objects(brna, prop);
/* Layers */
- prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
- RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene");
- RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_layer_update");
+ RNA_def_property_ui_text(prop, "Layers", "Layers visible when rendering the scene");
+ RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_view3d_update");
/* Frame Range Stuff */
prop= RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
@@ -2807,7 +3109,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
- RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL);
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -2815,7 +3117,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
- RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL);
prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -2830,25 +3132,26 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "r.flag", SCER_PRV_RANGE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_preview_range_set");
- RNA_def_property_ui_text(prop, "Use Preview Range", "");
+ RNA_def_property_ui_text(prop, "Use Preview Range", "Use an alternative start/end frame for UI playback, rather than the scene start/end frame");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
+ RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
- prop= RNA_def_property(srna, "preview_range_frame_start", PROP_INT, PROP_TIME);
+ prop= RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "r.psfra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
- RNA_def_property_ui_text(prop, "Preview Range Start Frame", "");
+ RNA_def_property_ui_text(prop, "Preview Range Start Frame", "Alternative start frame for UI playback");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
- prop= RNA_def_property(srna, "preview_range_frame_end", PROP_INT, PROP_TIME);
+ prop= RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "r.pefra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
- RNA_def_property_ui_text(prop, "Preview Range End Frame", "");
+ RNA_def_property_ui_text(prop, "Preview Range End Frame", "Alternative end frame for UI playback");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
/* Stamp */
- prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
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);
@@ -2857,14 +3160,14 @@ void RNA_def_scene(BlenderRNA *brna)
rna_def_animdata_common(srna);
/* Readonly Properties */
- prop= RNA_def_property(srna, "nla_tweakmode_on", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_NLA_EDIT_ON);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
RNA_def_property_ui_text(prop, "NLA TweakMode", "Indicates whether there is any action referenced by NLA being edited. Strictly read-only");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* Frame dropping flag for playback and sync enum */
- prop= RNA_def_property(srna, "frame_drop", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_FRAME_DROP);
RNA_def_property_ui_text(prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
RNA_def_property_update(prop, NC_SCENE, NULL);
@@ -2898,25 +3201,14 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "KeyingSet");
RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
+ rna_def_scene_keying_sets(brna, prop);
- prop= RNA_def_property(srna, "all_keying_sets", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_Scene_all_keyingsets_begin", "rna_Scene_all_keyingsets_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
RNA_def_property_struct_type(prop, "KeyingSet");
- RNA_def_property_ui_text(prop, "All Keying Sets", "All Keying Sets available for use (builtins and Absolute Keying Sets for this Scene)");
- RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
-
- prop= RNA_def_property(srna, "active_keying_set", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "KeyingSet");
- RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL);
- RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
- RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
-
- prop= RNA_def_property(srna, "active_keying_set_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
- //RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Scene_active_keying_set_index_range"); // XXX
- RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
+ RNA_def_property_ui_text(prop, "All Keying Sets", "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
+ rna_def_scene_keying_sets_all(brna, prop);
/* Tool Settings */
prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
@@ -2960,41 +3252,41 @@ void RNA_def_scene(BlenderRNA *brna)
rna_def_timeline_markers(brna, prop);
/* Audio Settings */
- prop= RNA_def_property(srna, "mute_audio", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_MUTE);
+ prop= RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_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);
+ prop= RNA_def_property(srna, "use_audio_sync", 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 clock, dropping frames if frame display is too slow");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "scrub_audio", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_audio_scrub", 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);
+ prop= RNA_def_property(srna, "audio_doppler_speed", 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_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);
+ prop= RNA_def_property(srna, "audio_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_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);
+ prop= RNA_def_property(srna, "audio_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_NONE);
+ prop= RNA_def_property(srna, "game_settings", 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");
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 376ef54f4d8..498bd148508 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -39,22 +39,30 @@
#ifdef RNA_RUNTIME
#include "BKE_animsys.h"
-#include "BKE_scene.h"
-#include "BKE_image.h"
#include "BKE_depsgraph.h"
+#include "BKE_global.h"
+#include "BKE_image.h"
+#include "BKE_scene.h"
#include "BKE_writeavi.h"
-static void rna_Scene_set_frame(Scene *scene, bContext *C, int frame)
+static void rna_Scene_set_frame(Scene *scene, int frame, float subframe)
{
scene->r.cfra= frame;
+ scene->r.subframe= subframe;
+
CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
- scene_update_for_newframe(scene, (1<<20) - 1);
+ scene_update_for_newframe(G.main, scene, (1<<20) - 1);
WM_main_add_notifier(NC_SCENE|ND_FRAME, scene);
}
+static void rna_Scene_update_tagged(Scene *scene)
+{
+ scene_update_tagged(G.main, scene);
+}
+
static KeyingSet *rna_Scene_add_keying_set(Scene *sce, ReportList *reports,
char name[], int absolute, int insertkey_needed, int insertkey_visual)
{
@@ -98,12 +106,12 @@ void RNA_api_scene(StructRNA *srna)
PropertyRNA *parm;
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);
+ parm= RNA_def_float(func, "subframe", 0.0, 0.0, 1.0, "", "Sub-frame time, between 0.0 and 1.0", 0.0, 1.0);
- func= RNA_def_function(srna, "update", "scene_update_tagged");
+ func= RNA_def_function(srna, "update", "rna_Scene_update_tagged");
RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators.");
/* Add Keying Set */
@@ -118,8 +126,8 @@ void RNA_api_scene(StructRNA *srna)
/* 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 */
- 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'.");
+ RNA_def_boolean(func, "use_insertkey_needed", 0, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves.");
+ RNA_def_boolean(func, "use_insertkey_visual", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'.");
}
void RNA_api_scene_render(StructRNA *srna)
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index d7dfd6fba9a..da8aab32f31 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -74,7 +74,7 @@ static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
}
}
-static int rna_Screen_animation_playing_get(PointerRNA *ptr)
+static int rna_Screen_is_animation_playing_get(PointerRNA *ptr)
{
bScreen *sc= (bScreen*)ptr->data;
return (sc->animtimer != NULL);
@@ -161,12 +161,12 @@ static void rna_def_region(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Region Type", "Type of this region");
- prop= RNA_def_property(srna, "width", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Width", "Region width");
- prop= RNA_def_property(srna, "height", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winy");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Height", "Region height");
@@ -184,7 +184,7 @@ static void rna_def_screen(BlenderRNA *brna)
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_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen");
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, 0, "rna_Screen_scene_update");
@@ -194,12 +194,12 @@ static void rna_def_screen(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Area");
RNA_def_property_ui_text(prop, "Areas", "Areas the screen is subdivided into");
- prop= RNA_def_property(srna, "animation_playing", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_animation_playing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_boolean_funcs(prop, "rna_Screen_animation_playing_get", NULL);
+ RNA_def_property_boolean_funcs(prop, "rna_Screen_is_animation_playing_get", NULL);
RNA_def_property_ui_text(prop, "Animation Playing", "Animation playback is active");
- prop= RNA_def_property(srna, "fullscreen", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Screen_fullscreen_get", NULL);
RNA_def_property_ui_text(prop, "Fullscreen", "An area is maximised, filling this screen");
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index cafc9bb8f82..3b83ec2d3ad 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -30,6 +30,7 @@
#include "DNA_ID.h"
#include "DNA_scene_types.h"
+#include "DNA_brush_types.h"
#include "BKE_paint.h"
@@ -48,6 +49,7 @@ static EnumPropertyItem particle_edit_hair_brush_items[] = {
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
+#include "MEM_guardedalloc.h"
#include "BKE_context.h"
#include "BKE_pointcache.h"
@@ -88,29 +90,6 @@ static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL);
}
-static void rna_Paint_brushes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
-{
- Paint *p= (Paint*)ptr->data;
- rna_iterator_array_begin(iter, (void*)p->brushes, sizeof(Brush*), p->brush_count, 0, NULL);
-}
-
-static int rna_Paint_brushes_length(PointerRNA *ptr)
-{
- Paint *p= (Paint*)ptr->data;
-
- return p->brush_count;
-}
-
-static PointerRNA rna_Paint_active_brush_get(PointerRNA *ptr)
-{
- return rna_pointer_inherit_refine(ptr, &RNA_Brush, paint_brush(ptr->data));
-}
-
-static void rna_Paint_active_brush_set(PointerRNA *ptr, PointerRNA value)
-{
- paint_brush_set(ptr->data, value.data);
-}
-
static void rna_ParticleEdit_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Object *ob= (scene->basact)? scene->basact->object: NULL;
@@ -133,11 +112,11 @@ static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
/* redraw hair completely if weight brush is/was used */
- if(pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) {
+ if((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->scene) {
Object *ob = (pset->scene->basact)? pset->scene->basact->object: NULL;
if(ob) {
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
}
@@ -163,63 +142,28 @@ static int rna_ParticleEdit_editable_get(PointerRNA *ptr)
{
ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
- return (pset->object && PE_get_current(pset->scene, pset->object));
+ return (pset->object && pset->scene && PE_get_current(pset->scene, pset->object));
}
static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
{
ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
- PTCacheEdit *edit = PE_get_current(pset->scene, pset->object);
-
- return (edit && edit->psys);
-}
+ if(pset->scene) {
+ PTCacheEdit *edit = PE_get_current(pset->scene, pset->object);
-static void rna_Paint_active_brush_index_set(PointerRNA *ptr, int value)
-{
- Paint *p= ptr->data;
- CLAMP(value, 0, p->brush_count-1);
- p->active_brush_index= value;
-}
-
-static void rna_Paint_active_brush_index_range(PointerRNA *ptr, int *min, int *max)
-{
- Paint *p= ptr->data;
- *min= 0;
- *max= MAX2(p->brush_count-1, 0);
-}
-
-static void rna_Paint_active_brush_name_get(PointerRNA *ptr, char *value)
-{
- Paint *p= ptr->data;
- Brush *br = paint_brush(p);
+ return (edit && edit->psys);
+ }
- BLI_strncpy(value, br->id.name+2, sizeof(br->id.name-2));
+ return 0;
}
-
-static int rna_Paint_active_brush_name_length(PointerRNA *ptr)
+static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
{
- Paint *p= ptr->data;
- Brush *br = paint_brush(p);
- return strlen(br->id.name+2);
+ Scene *scene= (Scene *)ptr->id.data;
+ Object *ob = OBACT;
+ Brush *brush= value.id.data;
+ return ob->mode & brush->ob_mode;
}
-
-static void rna_Paint_active_brush_name_set(PointerRNA *ptr, const char *value)
-{
- Paint *p= ptr->data;
- Brush *br;
- int i;
-
- for(i = 0; i < p->brush_count; ++i) {
- br = p->brushes[i];
-
- if (strcmp(br->id.name+2, value)==0) {
- paint_brush_set(p, br);
- return;
- }
- }
-}
-
#else
static void rna_def_paint(BlenderRNA *brna)
@@ -230,39 +174,22 @@ static void rna_def_paint(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Paint", NULL);
RNA_def_struct_ui_text(srna, "Paint", "");
- prop= RNA_def_property(srna, "brushes", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, "Brush");
- RNA_def_property_collection_funcs(prop, "rna_Paint_brushes_begin",
- "rna_iterator_array_next",
- "rna_iterator_array_end",
- "rna_iterator_array_dereference_get",
- "rna_Paint_brushes_length", 0, 0);
- RNA_def_property_ui_text(prop, "Brushes", "Brushes selected for this paint mode");
-
- prop= RNA_def_property(srna, "active_brush_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_funcs(prop, NULL, "rna_Paint_active_brush_index_set", "rna_Paint_active_brush_index_range");
- RNA_def_property_range(prop, 0, INT_MAX);
- RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL);
-
- prop= RNA_def_property(srna, "active_brush_name", PROP_STRING, PROP_NONE);
- RNA_def_property_string_funcs(prop, "rna_Paint_active_brush_name_get", "rna_Paint_active_brush_name_length", "rna_Paint_active_brush_name_set");
- RNA_def_property_string_maxlength(prop, sizeof(((ID*)NULL)->name)-2);
- RNA_def_property_ui_text(prop, "Active Brush Name", "");
- RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL);
-
- /* Fake property to get active brush directly, rather than integer index */
+ /* Global Settings */
prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Brush");
- RNA_def_property_pointer_funcs(prop, "rna_Paint_active_brush_get", "rna_Paint_active_brush_set", NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Brush", "Active paint brush");
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_poll");
+ RNA_def_property_ui_text(prop, "Brush", "Active Brush");
RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH);
RNA_def_property_ui_text(prop, "Show Brush", "");
- prop= RNA_def_property(srna, "fast_navigate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH_ON_SURFACE);
+ RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
+
+ prop= RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_FAST_NAVIGATE);
RNA_def_property_ui_text(prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
}
@@ -274,16 +201,23 @@ static void rna_def_sculpt(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Sculpt", "Paint");
RNA_def_struct_ui_text(srna, "Sculpt", "");
-
- prop= RNA_def_property(srna, "symmetry_x", PROP_BOOLEAN, PROP_NONE);
+
+ prop= RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
+ RNA_def_property_int_sdna(prop, NULL, "radial_symm");
+ RNA_def_property_int_default(prop, 1);
+ RNA_def_property_range(prop, 1, 64);
+ RNA_def_property_ui_range(prop, 0, 32, 1, 1);
+ RNA_def_property_ui_text(prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
+
+ prop= RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X);
RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis");
- prop= RNA_def_property(srna, "symmetry_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Y);
RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis");
- prop= RNA_def_property(srna, "symmetry_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Z);
RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis");
@@ -298,6 +232,14 @@ static void rna_def_sculpt(BlenderRNA *brna)
prop= RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z);
RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
+
+ prop= RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMMETRY_FEATHER);
+ RNA_def_property_ui_text(prop, "Symmetry Feathering", "Reduce the strength of the brush where it overlaps symmetrical daubs");
+
+ prop= RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_USE_OPENMP);
+ RNA_def_property_ui_text(prop, "Use OpenMP", "Take advantage of multiple CPU cores to improve sculpting performance");
}
static void rna_def_vertex_paint(BlenderRNA *brna)
@@ -309,15 +251,15 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "VPaint");
RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
- prop= RNA_def_property(srna, "all_faces", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_all_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_AREA);
RNA_def_property_ui_text(prop, "All Faces", "Paint on all faces inside brush");
-
- prop= RNA_def_property(srna, "normals", PROP_BOOLEAN, PROP_NONE);
+
+ prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS);
RNA_def_property_ui_text(prop, "Normals", "Applies the vertex normal before painting");
- prop= RNA_def_property(srna, "spray", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY);
RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse");
}
@@ -349,7 +291,7 @@ static void rna_def_image_paint(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_XRAY);
RNA_def_property_ui_text(prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
- prop= RNA_def_property(srna, "use_backface_cull", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_BACKFACE);
RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
@@ -377,7 +319,7 @@ static void rna_def_image_paint(BlenderRNA *brna)
prop= RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 0, 90);
- RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view acording to this angle");
+ RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
prop= RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size", "Size to capture the image for re-projecting", 0, 0);
RNA_def_property_range(prop, 512, 16384);
@@ -424,21 +366,21 @@ static void rna_def_particle_edit(BlenderRNA *brna)
RNA_def_property_enum_funcs(prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
RNA_def_property_ui_text(prop, "Tool", "");
- prop= RNA_def_property(srna, "selection_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
RNA_def_property_enum_items(prop, select_mode_items);
RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
- prop= RNA_def_property(srna, "keep_lengths", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS);
RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
- prop= RNA_def_property(srna, "keep_root", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_LOCK_FIRST);
RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
- prop= RNA_def_property(srna, "emitter_deflect", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DEFLECT_EMITTER);
RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
@@ -447,25 +389,25 @@ static void rna_def_particle_edit(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter");
- prop= RNA_def_property(srna, "fade_time", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME);
RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
- prop= RNA_def_property(srna, "auto_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY);
RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
- prop= RNA_def_property(srna, "draw_particles", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART);
RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
- prop= RNA_def_property(srna, "add_interpolate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED);
RNA_def_property_ui_text(prop, "Interpolate", "Interpolate new particles from the existing ones");
- prop= RNA_def_property(srna, "add_keys", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "totaddkey");
RNA_def_property_range(prop, 2, INT_MAX);
RNA_def_property_ui_range(prop, 2, 20, 10, 3);
@@ -473,7 +415,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ParticleBrush");
- RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Brush", "");
prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
@@ -492,12 +434,12 @@ static void rna_def_particle_edit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
- prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
- prop= RNA_def_property(srna, "hair", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Hair", "Editing hair");
@@ -550,7 +492,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
/* dummy */
prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "CurveMapping");
- RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Curve", "");
}
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index 533aab1a317..d20e5aebcfb 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -25,13 +25,39 @@
#include <stdlib.h>
#include "RNA_define.h"
+#include "RNA_enum_types.h"
#include "rna_internal.h"
+#include "DNA_constraint_types.h"
+#include "DNA_object_types.h"
#include "DNA_sensor_types.h"
+#include "WM_types.h"
+
+/* Always keep in alphabetical order */
+EnumPropertyItem sensor_type_items[] ={
+ {SENS_ACTUATOR, "ACTUATOR", 0, "Actuator", ""},
+ {SENS_ALWAYS, "ALWAYS", 0, "Always", ""},
+ {SENS_ARMATURE, "ARMATURE", 0, "Armature", ""},
+ {SENS_COLLISION, "COLLISION", 0, "Collision", ""},
+ {SENS_DELAY, "DELAY", 0, "Delay", ""},
+ {SENS_JOYSTICK, "JOYSTICK", 0, "Joystick", ""},
+ {SENS_KEYBOARD, "KEYBOARD", 0, "Keyboard", ""},
+ {SENS_MESSAGE, "MESSAGE", 0, "Message", ""},
+ {SENS_MOUSE, "MOUSE", 0, "Mouse", ""},
+ {SENS_NEAR, "NEAR", 0, "Near", ""},
+ {SENS_PROPERTY, "PROPERTY", 0, "Property", ""},
+ {SENS_RADAR, "RADAR", 0, "Radar", ""},
+ {SENS_RANDOM, "RANDOM", 0, "Random", ""},
+ {SENS_RAY, "RAY", 0, "Ray", ""},
+ {SENS_TOUCH, "TOUCH", 0, "Touch", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
+#include "BKE_sca.h"
+
static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
{
bSensor *sensor= (bSensor*)ptr->data;
@@ -72,29 +98,150 @@ static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
}
}
+static void rna_Sensor_type_set(struct PointerRNA *ptr, int value)
+{
+ bSensor *sens= (bSensor *)ptr->data;
+ if (value != sens->type)
+ {
+ sens->type = value;
+ init_sensor(sens);
+ }
+}
+
+/* Always keep in alphabetical order */
+EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ EnumPropertyItem *item= NULL;
+ Object *ob=NULL;
+ int totitem= 0;
+
+ if (ptr->type == &RNA_Sensor) {
+ ob = (Object *)ptr->id.data;
+ } else {
+ /* can't use ob from ptr->id.data because that enum is also used by operators */
+ ob = CTX_data_active_object(C);
+ }
+
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ACTUATOR);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ALWAYS);
+
+ if (ob != NULL) {
+ if (ob->type==OB_ARMATURE) {
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ARMATURE);
+ }
+ }
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_COLLISION);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_DELAY);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_JOYSTICK);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_KEYBOARD);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_MESSAGE);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_MOUSE);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_NEAR);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_PROPERTY);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_RADAR);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_RANDOM);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_RAY);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_TOUCH);
+
+ RNA_enum_item_end(&item, &totitem);
+ *free= 1;
+
+ return item;
+}
+
+static void rna_Sensor_keyboard_key_set(struct PointerRNA *ptr, int value)
+{
+ bSensor *sens= (bSensor *)ptr->data;
+ bKeyboardSensor *ks = (bKeyboardSensor *)sens->data;
+
+ if (ISKEYBOARD(value))
+ ks->key = value;
+}
+
+static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value)
+{
+ bSensor *sens= (bSensor *)ptr->data;
+ bKeyboardSensor *ks = (bKeyboardSensor *)sens->data;
+
+ if (ISKEYBOARD(value))
+ ks->qual = value;
+}
+
+static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value)
+{
+ bSensor *sens= (bSensor *)ptr->data;
+ bKeyboardSensor *ks = (bKeyboardSensor *)sens->data;
+
+ if (ISKEYBOARD(value))
+ ks->qual2 = value;
+}
+
+static void rna_Sensor_tap_set(struct PointerRNA *ptr, int value)
+{
+ bSensor *sens= (bSensor*)ptr->data;
+
+ sens->tap = value;
+ if(sens->tap == 1)
+ sens->level = 0;
+}
+
+static void rna_Sensor_level_set(struct PointerRNA *ptr, int value)
+{
+ bSensor *sens= (bSensor*)ptr->data;
+
+ sens->level = value;
+ if(sens->level == 1)
+ sens->tap = 0;
+}
+
+static void rna_Sensor_Armature_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ bSensor *sens= (bSensor *)ptr->data;
+ bArmatureSensor *as = sens->data;
+ Object *ob = (Object *)ptr->id.data;
+
+ char *posechannel= as->posechannel;
+ char *constraint= as->constraint;
+
+ /* check that bone exist in the active object */
+ if (ob->type == OB_ARMATURE && ob->pose) {
+ bPoseChannel *pchan;
+ bPose *pose = ob->pose;
+ for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
+ if (!strcmp(pchan->name, posechannel)) {
+ /* found it, now look for constraint channel */
+ bConstraint *con;
+ for (con=pchan->constraints.first; con; con=con->next) {
+ if (!strcmp(con->name, constraint)) {
+ /* found it, all ok */
+ return;
+ }
+ }
+ /* didn't find constraint, make empty */
+ constraint[0] = 0;
+ return;
+ }
+ }
+ }
+ /* didn't find any */
+ posechannel[0] = 0;
+ constraint[0] = 0;
+}
+
+/* note: the following set functions exists only to avoid id refcounting */
+static void rna_Sensor_touch_material_set(PointerRNA *ptr, PointerRNA value)
+{
+ bSensor *sens = (bSensor *)ptr->data;
+ bTouchSensor *ts = (bTouchSensor *) sens->data;
+
+ ts->ma = value.data;
+}
#else
static void rna_def_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem sensor_type_items[] ={
- {SENS_ALWAYS, "ALWAYS", 0, "Always", ""},
- {SENS_TOUCH, "TOUCH", 0, "Touch", ""},
- {SENS_NEAR, "NEAR", 0, "Near", ""},
- {SENS_KEYBOARD, "KEYBOARD", 0, "Keyboard", ""},
- {SENS_PROPERTY, "PROPERTY", 0, "Property", ""},
- {SENS_MOUSE, "MOUSE", 0, "Mouse", ""},
- {SENS_COLLISION, "COLLISION", 0, "Collision", ""},
- {SENS_RADAR, "RADAR", 0, "Radar", ""},
- {SENS_RANDOM, "RANDOM", 0, "Random", ""},
- {SENS_RAY, "RAY", 0, "Ray", ""},
- {SENS_MESSAGE, "MESSAGE", 0, "Message", ""},
- {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);
RNA_def_struct_ui_text(srna, "Sensor", "Game engine logic brick to detect events");
@@ -104,31 +251,60 @@ static void rna_def_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Sensor name");
RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- /* type is not editable, would need to do proper data free/alloc */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, sensor_type_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_type_set", "rna_Sensor_type_itemf");
RNA_def_property_ui_text(prop, "Type", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_PIN);
+ RNA_def_property_ui_text(prop, "Pinned", "Display when not linked to a visible states controller");
+ RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_SHOW);
+ RNA_def_property_ui_text(prop, "Expanded", "Set sensor expanded in the user interface");
+ RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Invert Output", "Invert the level(output) of this sensor");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "level", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_level", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "level", 1);
RNA_def_property_ui_text(prop, "Level", "Level detector, trigger controllers of new states(only applicable upon logic state transition)");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_level_set");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "pulse_true_level", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pulse_true_level", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_PULSE_REPEAT);
RNA_def_property_ui_text(prop, "Pulse True Level", "Activate TRUE level triggering (pulse mode)");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "pulse_false_level", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pulse_false_level", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_NEG_PULSE_MODE);
RNA_def_property_ui_text(prop, "Pulse False Level", "Activate FALSE level triggering (pulse mode)");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "frequence", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "freq");
RNA_def_property_ui_text(prop, "Frequency", "Delay between repeated pulses(in logic tics, 0=no delay)");
RNA_def_property_range(prop, 0, 10000);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "use_tap", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "tap", 1);
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_tap_set");
+ RNA_def_property_ui_text(prop, "Tap", "Trigger controllers only for an instant, even while the sensor remains true");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ RNA_api_sensor(srna);
}
static void rna_def_always_sensor(BlenderRNA *brna)
@@ -150,16 +326,19 @@ static void rna_def_near_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_ui_text(prop, "Distance", "Trigger distance");
RNA_def_property_range(prop, 0.0f, 10000.0f);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "reset_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "resetdist");
RNA_def_property_ui_text(prop, "Reset Distance", "");
RNA_def_property_range(prop, 0.0f, 10000.0f);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_mouse_sensor(BlenderRNA *brna)
@@ -186,6 +365,7 @@ static void rna_def_mouse_sensor(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, mouse_event_items);
RNA_def_property_ui_text(prop, "Mouse Event", "Specify the type of event this mouse sensor should trigger on");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_touch_sensor(BlenderRNA *brna)
@@ -201,7 +381,10 @@ static void rna_def_touch_sensor(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_pointer_sdna(prop, NULL, "ma");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Material", "Only look for floors with this material");
+ RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material");
+ /* note: custom set function is ONLY to avoid rna setting a user for this. */
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Sensor_touch_material_set", NULL, NULL);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_keyboard_sensor(BlenderRNA *brna)
@@ -213,34 +396,41 @@ static void rna_def_keyboard_sensor(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Keyboard Sensor", "Sensor to detect keyboard events");
RNA_def_struct_sdna_from(srna, "bKeyboardSensor", "data");
- prop= RNA_def_property(srna, "key", PROP_INT, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* need better range or enum check */
- RNA_def_property_ui_text(prop, "Key", "Input key code");
- RNA_def_property_range(prop, 0, 255);
-
- prop= RNA_def_property(srna, "modifier_key", PROP_INT, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* need better range or enum check */
- RNA_def_property_int_sdna(prop, NULL, "qual");
+ prop= RNA_def_property(srna, "key", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "key");
+ RNA_def_property_enum_items(prop, event_type_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_key_set", NULL);
+ RNA_def_property_ui_text(prop, "Key", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "modifier_key_1", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "qual");
+ RNA_def_property_enum_items(prop, event_type_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier_set", NULL);
RNA_def_property_ui_text(prop, "Modifier Key", "Modifier key code");
- RNA_def_property_range(prop, 0, 255);
-
- prop= RNA_def_property(srna, "second_modifier_key", PROP_INT, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* need better range or enum check */
- RNA_def_property_int_sdna(prop, NULL, "qual2");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "modifier_key_2", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "qual2");
+ RNA_def_property_enum_items(prop, event_type_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier2_set", NULL);
RNA_def_property_ui_text(prop, "Second Modifier Key", "Modifier key code");
- RNA_def_property_range(prop, 0, 255);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "target", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "targetName");
RNA_def_property_ui_text(prop, "Target", "Property that indicates whether to log keystrokes as a string");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "log", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "toggleName");
- RNA_def_property_ui_text(prop, "Log", "Property that receive the keystrokes in case a string is logged");
+ RNA_def_property_ui_text(prop, "Log Toggle", "Property that receive the keystrokes in case a string is logged");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "all_keys", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_all_keys", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", 1);
RNA_def_property_ui_text(prop, "All Keys", "Trigger this sensor on any keystroke");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_property_sensor(BlenderRNA *brna)
@@ -263,22 +453,27 @@ static void rna_def_property_sensor(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, "Evaluation Type", "Type of property evaluation");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "value");
RNA_def_property_ui_text(prop, "Value", "Check for this value in types in Equal or Not Equal types");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "min_value", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "value_min", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "value");
RNA_def_property_ui_text(prop, "Minimum Value", "Specify minimum value in Interval type");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "max_value", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "value_max", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "maxvalue");
RNA_def_property_ui_text(prop, "Maximum Value", "Specify maximum value in Interval type");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_armature_sensor(BlenderRNA *brna)
@@ -297,22 +492,26 @@ static void rna_def_armature_sensor(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "test_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");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "channel_name", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "bone", 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");
+ RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update");
- prop= RNA_def_property(srna, "constraint_name", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "constraint", 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");
+ RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update");
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");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_actuator_sensor(BlenderRNA *brna)
@@ -328,6 +527,7 @@ static void rna_def_actuator_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "actuator", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Actuator", "Actuator name, actuator active state modifications will be detected");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_delay_sensor(BlenderRNA *brna)
@@ -342,48 +542,57 @@ static void rna_def_delay_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "delay", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Delay", "Delay in number of logic tics before the positive trigger (default 60 per second)");
RNA_def_property_range(prop, 0, 5000);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "duration", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Duration", "If >0, delay in number of logic tics before the negative trigger following the positive trigger");
RNA_def_property_range(prop, 0, 5000);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "repeat", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_repeat", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_DELAY_REPEAT);
RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_collision_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
- {0, "PROPERTY", 0, "Property", ""},
- {1, "MATERIAL", 0, "Material", ""},
- {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "CollisionSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Collision Sensor", "Sensor to detect objects colliding with the current object, with more settings than the Touch sensor");
RNA_def_struct_sdna_from(srna, "bCollisionSensor", "data");
+ prop= RNA_def_property(srna, "use_pulse", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_PULSE);
+ RNA_def_property_ui_text(prop, "Pulse", "Changes to the set of colliding objects generates pulse");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_MATERIAL);
+ RNA_def_property_ui_text(prop, "M/P", "Toggle collision on material or property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Property Name", "Only look for Objects with this property");
+ RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+ //XXX to make a setFunction to create a lookup with all materials in Blend File (not only this object mat.)
prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "materialName");
- RNA_def_property_ui_text(prop, "Material Name", "Only look for Objects with this material");
+ RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
-/*
+/*//XXX either use a datablock look up to store the string name (material)
+ // or to do a doversion and use a material pointer.
prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "ma");
RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
*/
- prop= RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "mode");
- RNA_def_property_enum_items(prop, prop_type_items);
- RNA_def_property_ui_text(prop, "Collision Type", "Toggle collision on material or property");
}
static void rna_def_radar_sensor(BlenderRNA *brna)
@@ -406,19 +615,23 @@ static void rna_def_radar_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, axis_items);
RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the radar cone is cast");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 179.9);
RNA_def_property_ui_text(prop, "Angle", "Opening angle of the radar cone");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "range");
RNA_def_property_range(prop, 0.0, 10000.0);
RNA_def_property_ui_text(prop, "Distance", "Depth of the radar cone");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_random_sensor(BlenderRNA *brna)
@@ -433,6 +646,7 @@ static void rna_def_random_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator. (Choose 0 for not random)");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_ray_sensor(BlenderRNA *brna)
@@ -447,24 +661,34 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
{SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y axis", ""},
{SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_type_items[] ={
- {0, "PROPERTY", 0, "Property", ""},
- {1, "MATERIAL", 0, "Material", ""},
+
+ static const EnumPropertyItem prop_ray_type_items[]= {
+ {SENS_COLLISION_PROPERTY, "PROPERTY", ICON_LOGIC, "Property", "Use a material for ray intersections"},
+ {SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a property for ray intersections"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "RaySensor", "Sensor");
RNA_def_struct_ui_text(srna, "Ray Sensor", "Sensor to detect intersections with a ray emanating from the current object");
RNA_def_struct_sdna_from(srna, "bRaySensor", "data");
+
+ prop= RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, prop_ray_type_items);
+ RNA_def_property_ui_text(prop, "Ray Type", "Toggle collision on material or property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "propname");
RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "matname");
RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
-/*
+ /* //XXX either use a datablock look up to store the string name (material)
+ // or to do a doversion and use a material pointer.
prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -472,23 +696,21 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
*/
- prop= RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "mode");
- RNA_def_property_enum_items(prop, prop_type_items);
- RNA_def_property_ui_text(prop, "Collision Type", "Toggle collision on material or property");
-
- prop= RNA_def_property(srna, "x_ray_mode", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_RAY_XRAY);
RNA_def_property_ui_text(prop, "X-Ray Mode", "Toggle X-Ray option (see through objects that don't have the property)");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 10000.0);
RNA_def_property_ui_text(prop, "Range", "Sense objects no farther than this distance");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axisflag");
RNA_def_property_enum_items(prop, axis_items);
RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the ray is cast");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_message_sensor(BlenderRNA *brna)
@@ -502,6 +724,7 @@ static void rna_def_message_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty for all");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_joystick_sensor(BlenderRNA *brna)
@@ -513,6 +736,7 @@ static void rna_def_joystick_sensor(BlenderRNA *brna)
{SENS_JOY_BUTTON, "BUTTON", 0, "Button", ""},
{SENS_JOY_AXIS, "AXIS", 0, "Axis", ""},
{SENS_JOY_HAT, "HAT", 0, "Hat", ""},
+ {SENS_JOY_AXIS_SINGLE, "AXIS_SINGLE", 0, "Single Axis", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem axis_direction_items[] ={
@@ -522,56 +746,84 @@ static void rna_def_joystick_sensor(BlenderRNA *brna)
{SENS_JOY_NEG_Y_AXIS, "DOWNAXIS", 0, "Down Axis", ""},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem hat_direction_items[] ={
+ {SENS_JOY_HAT_UP, "UP", 0, "Up", ""},
+ {SENS_JOY_HAT_DOWN, "DOWN", 0, "Down", ""},
+ {SENS_JOY_HAT_LEFT, "LEFT", 0, "Left", ""},
+ {SENS_JOY_HAT_RIGHT, "RIGHT", 0, "Right", ""},
+
+ {SENS_JOY_HAT_UP_RIGHT, "UPRIGHT", 0, "Up/Right", ""},
+ {SENS_JOY_HAT_DOWN_LEFT, "DOWNLEFT", 0, "Down/Left", ""},
+ {SENS_JOY_HAT_UP_LEFT, "UPLEFT", 0, "Up/Left", ""},
+ {SENS_JOY_HAT_DOWN_RIGHT, "DOWNRIGHT", 0, "Down/Right", ""},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "JoystickSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Joystick Sensor", "Sensor to detect joystick events");
RNA_def_struct_sdna_from(srna, "bJoystickSensor", "data");
prop= RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "joyindex");
- RNA_def_property_ui_text(prop, "Joystick Index", "Specify which joystick to use");
+ RNA_def_property_ui_text(prop, "Index", "Specify which joystick to use");
RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX-1);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "event_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_ui_text(prop, "Event Type", "The type of event this joystick sensor is triggered on");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "all_events", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_all_events", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_JOY_ANY_EVENT);
RNA_def_property_ui_text(prop, "All Events", "Triggered by all events on this joysticks current type (axis/button/hat)");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Button */
prop= RNA_def_property(srna, "button_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "button");
RNA_def_property_ui_text(prop, "Button Number", "Specify which button to use");
RNA_def_property_range(prop, 0, 18);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Axis */
prop= RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "axis");
RNA_def_property_ui_text(prop, "Axis Number", "Specify which axis pair to use, 1 is usually the main direction input");
RNA_def_property_range(prop, 1, 2);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "precision");
RNA_def_property_ui_text(prop, "Axis Threshold", "Specify the precision of the axis");
RNA_def_property_range(prop, 0, 32768);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "axis_direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axisf");
RNA_def_property_enum_items(prop, axis_direction_items);
RNA_def_property_ui_text(prop, "Axis Direction", "The direction of the axis");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ /* Single Axis */
+ prop= RNA_def_property(srna, "single_axis_number", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "axis_single");
+ RNA_def_property_ui_text(prop, "Axis Number", "Specify a single axis (verticle/horizontal/other) to detect");
+ RNA_def_property_range(prop, 1, 16);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Hat */
prop= RNA_def_property(srna, "hat_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "hat");
RNA_def_property_ui_text(prop, "Hat Number", "Specify which hat to use");
RNA_def_property_range(prop, 1, 2);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "hat_direction", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "hatf");
+ prop= RNA_def_property(srna, "hat_direction", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "hatf");
+ RNA_def_property_enum_items(prop, hat_direction_items);
RNA_def_property_ui_text(prop, "Hat Direction", "Specify hat direction");
- RNA_def_property_range(prop, 0, 12);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
void RNA_def_sensor(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_sensor_api.c b/source/blender/makesrna/intern/rna_sensor_api.c
new file mode 100644
index 00000000000..afdb71b4f3b
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_sensor_api.c
@@ -0,0 +1,72 @@
+/**
+ * $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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2010 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s):
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "WM_types.h"
+#include "RNA_define.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_sca.h"
+#include "DNA_sensor_types.h"
+#include "DNA_controller_types.h"
+
+static void rna_Sensor_link(bSensor *sens, bController *cont)
+{
+ link_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks, sizeof(bController *));
+}
+
+static void rna_Sensor_unlink(bSensor *sens, bController *cont)
+{
+ unlink_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks);
+}
+
+#else
+
+void RNA_api_sensor(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "link", "rna_Sensor_link");
+ RNA_def_function_ui_description(func, "Link the sensor to a controller.");
+ parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_update(parm, NC_LOGIC, NULL);
+
+ func= RNA_def_function(srna, "unlink", "rna_Sensor_unlink");
+ RNA_def_function_ui_description(func, "Unlink the sensor from a controller.");
+ parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_update(parm, NC_LOGIC, NULL);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index be6bb1f00b8..d3207f14e24 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -30,19 +30,32 @@
#include "rna_internal.h"
+#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "BKE_animsys.h"
+#include "BKE_global.h"
#include "BKE_sequencer.h"
#include "MEM_guardedalloc.h"
#include "WM_types.h"
+#include "BLI_math.h"
#ifdef RNA_RUNTIME
+static float to_dB(float x)
+{
+ return logf(x * x + 1e-30f) * 4.34294480f;
+}
+
+static float from_dB(float x)
+{
+ return expf(x * 0.11512925f);
+}
+
/* build a temp referene to the parent */
static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
{
@@ -130,7 +143,29 @@ static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value)
rna_Sequence_frame_change_update(scene, seq);
}
-static void rna_Sequence_length_set(PointerRNA *ptr, int value)
+static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value)
+{
+ Sequence *seq= (Sequence*)ptr->data;
+ Scene *scene= (Scene*)ptr->id.data;
+
+ seq->anim_startofs = MIN2(value, seq->len + seq->anim_startofs);
+
+ reload_sequence_new_file(G.main, scene, seq, FALSE);
+ rna_Sequence_frame_change_update(scene, seq);
+}
+
+static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value)
+{
+ Sequence *seq= (Sequence*)ptr->data;
+ Scene *scene= (Scene*)ptr->id.data;
+
+ seq->anim_endofs = MIN2(value, seq->len + seq->anim_endofs);
+
+ reload_sequence_new_file(G.main, scene, seq, FALSE);
+ rna_Sequence_frame_change_update(scene, seq);
+}
+
+static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value)
{
Sequence *seq= (Sequence*)ptr->data;
Scene *scene= (Scene*)ptr->id.data;
@@ -139,7 +174,7 @@ static void rna_Sequence_length_set(PointerRNA *ptr, int value)
rna_Sequence_frame_change_update(scene, seq);
}
-static int rna_Sequence_length_get(PointerRNA *ptr)
+static int rna_Sequence_frame_length_get(PointerRNA *ptr)
{
Sequence *seq= (Sequence*)ptr->data;
return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0);
@@ -219,6 +254,70 @@ static void rna_Sequence_use_crop_set(PointerRNA *ptr, int value)
seq->flag ^= SEQ_USE_CROP;
}
}
+
+static int transform_seq_cmp_cb(Sequence *seq, void *arg_pt)
+{
+ struct { Sequence *seq; void *transform; } *data= arg_pt;
+
+ if(seq->strip && seq->strip->transform == data->transform) {
+ data->seq= seq;
+ return -1; /* done so bail out */
+ }
+ return 1;
+}
+
+static char *rna_SequenceTransform_path(PointerRNA *ptr)
+{
+ Scene *scene= ptr->id.data;
+ Editing *ed= seq_give_editing(scene, FALSE);
+ Sequence *seq;
+
+ struct { Sequence *seq; void *transform; } data;
+ data.seq= NULL;
+ data.transform= ptr->data;
+
+ /* irritating we need to search for our sequence! */
+ seqbase_recursive_apply(&ed->seqbase, transform_seq_cmp_cb, &data);
+ seq= data.seq;
+
+ if (seq && seq->name+2)
+ return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform", seq->name+2);
+ else
+ return BLI_strdup("");
+}
+
+static int crop_seq_cmp_cb(Sequence *seq, void *arg_pt)
+{
+ struct { Sequence *seq; void *crop; } *data= arg_pt;
+
+ if(seq->strip && seq->strip->crop == data->crop) {
+ data->seq= seq;
+ return -1; /* done so bail out */
+ }
+ return 1;
+}
+
+static char *rna_SequenceCrop_path(PointerRNA *ptr)
+{
+ Scene *scene= ptr->id.data;
+ Editing *ed= seq_give_editing(scene, FALSE);
+ Sequence *seq;
+
+ struct { Sequence *seq; void *crop; } data;
+ data.seq= NULL;
+ data.crop= ptr->data;
+
+ /* irritating we need to search for our sequence! */
+ seqbase_recursive_apply(&ed->seqbase, crop_seq_cmp_cb, &data);
+ seq= data.seq;
+
+ if (seq && seq->name+2)
+ return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop", seq->name+2);
+ else
+ return BLI_strdup("");
+}
+
+
/* name functions that ignore the first two characters */
static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
{
@@ -237,6 +336,7 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
Scene *scene= (Scene*)ptr->id.data;
Sequence *seq= (Sequence*)ptr->data;
char oldname[sizeof(seq->name)];
+ AnimData *adt;
/* make a copy of the old name first */
BLI_strncpy(oldname, seq->name+2, sizeof(seq->name)-2);
@@ -248,7 +348,12 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
seqbase_unique_name_recursive(&scene->ed->seqbase, seq);
/* fix all the animation data which may link to this */
- BKE_all_animdata_fix_paths_rename("sequence_editor.sequences_all", oldname, seq->name+2);
+
+ /* dont rename everywhere because these are per scene */
+ /* BKE_all_animdata_fix_paths_rename("sequence_editor.sequences_all", oldname, seq->name+2); */
+ adt= BKE_animdata_from_id(&scene->id);
+ if(adt)
+ BKE_animdata_fix_paths_rename(&scene->id, adt, "sequence_editor.sequences_all", oldname, seq->name+2, 0, 0, 1);
}
static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
@@ -275,6 +380,8 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
case SEQ_MUL:
case SEQ_OVERDROP:
return &RNA_EffectSequence;
+ case SEQ_MULTICAM:
+ return &RNA_MulticamSequence;
case SEQ_PLUGIN:
return &RNA_PluginSequence;
case SEQ_WIPE:
@@ -313,11 +420,22 @@ static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *
return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
}
+/* TODO, expose seq path setting as a higher level sequencer BKE function */
static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
{
Sequence *seq= (Sequence*)(ptr->data);
char dir[FILE_MAX], name[FILE_MAX];
+ if(seq->type == SEQ_SOUND && seq->sound) {
+ /* for sound strips we need to update the sound as well.
+ * arguably, this could load in a new sound rather then modify an existing one.
+ * but while using the sequencer its most likely your not using the sound in the game engine too.
+ */
+ PointerRNA id_ptr;
+ RNA_id_pointer_create((ID *)seq->sound, &id_ptr);
+ RNA_string_set(&id_ptr, "filepath", value);
+ }
+
BLI_split_dirfile(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));
@@ -341,6 +459,49 @@ static int rna_Sequence_filepath_length(PointerRNA *ptr)
return strlen(path)+1;
}
+static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
+{
+ StripProxy *proxy= (StripProxy*)(ptr->data);
+ char dir[FILE_MAX], name[FILE_MAX];
+
+ BLI_split_dirfile(value, dir, name);
+ BLI_strncpy(proxy->dir, dir, sizeof(proxy->dir));
+ BLI_strncpy(proxy->file, name, sizeof(proxy->file));
+}
+
+static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value)
+{
+ StripProxy *proxy= (StripProxy*)(ptr->data);
+ char path[FILE_MAX];
+
+ BLI_join_dirfile(path, proxy->dir, proxy->file);
+ BLI_strncpy(value, path, strlen(path)+1);
+}
+
+static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
+{
+ StripProxy *proxy= (StripProxy*)(ptr->data);
+ char path[FILE_MAX];
+
+ BLI_join_dirfile(path, proxy->dir, proxy->file);
+ return strlen(path)+1;
+}
+
+static float rna_Sequence_attenuation_get(PointerRNA *ptr)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+
+ return to_dB(seq->volume);
+}
+
+static void rna_Sequence_attenuation_set(PointerRNA *ptr, float value)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+
+ seq->volume = from_dB(value);
+}
+
+
/*static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
{
Sequence *seq= (Sequence*)(ptr->data);
@@ -364,7 +525,17 @@ static void rna_Sequence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Editing *ed= seq_give_editing(scene, FALSE);
- free_imbuf_seq(scene, &ed->seqbase, FALSE);
+ free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE);
+
+ if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
+ seq_update_sound(scene, ptr->data);
+}
+
+static void rna_Sequence_update_reopen_files(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Editing *ed= seq_give_editing(scene, FALSE);
+
+ free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
seq_update_sound(scene, ptr->data);
@@ -378,6 +549,14 @@ static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr)
rna_Sequence_update(bmain, scene, ptr);
}
+static void rna_Sequence_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+ reload_sequence_new_file(G.main, scene, seq, TRUE);
+ calc_sequence(scene, seq);
+ rna_Sequence_update(bmain, scene, ptr);
+}
+
/* do_versions? */
static float rna_Sequence_opacity_get(PointerRNA *ptr) {
return ((Sequence*)(ptr->data))->blend_opacity / 100.0f;
@@ -386,6 +565,86 @@ static void rna_Sequence_opacity_set(PointerRNA *ptr, float value) {
((Sequence*)(ptr->data))->blend_opacity = value * 100.0f;
}
+
+static int colbalance_seq_cmp_cb(Sequence *seq, void *arg_pt)
+{
+ struct { Sequence *seq; void *color_balance; } *data= arg_pt;
+
+ if(seq->strip && seq->strip->color_balance == data->color_balance) {
+ data->seq= seq;
+ return -1; /* done so bail out */
+ }
+ return 1;
+}
+static char *rna_SequenceColorBalance_path(PointerRNA *ptr)
+{
+ Scene *scene= ptr->id.data;
+ Editing *ed= seq_give_editing(scene, FALSE);
+ Sequence *seq;
+
+ struct { Sequence *seq; void *color_balance; } data;
+ data.seq= NULL;
+ data.color_balance= ptr->data;
+
+ /* irritating we need to search for our sequence! */
+ seqbase_recursive_apply(&ed->seqbase, colbalance_seq_cmp_cb, &data);
+ seq= data.seq;
+
+ if (seq && seq->name+2)
+ return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].color_balance", seq->name+2);
+ else
+ return BLI_strdup("");
+}
+
+static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, int value)
+{
+ Scene *scene= ptr->id.data;
+ Editing *ed= seq_give_editing(scene, FALSE);
+
+ if(ed==NULL)
+ return;
+
+ /* convert from abs to relative and back */
+ if((ed->over_flag & SEQ_EDIT_OVERLAY_ABS)==0 && value) {
+ ed->over_cfra= scene->r.cfra + ed->over_ofs;
+ ed->over_flag |= SEQ_EDIT_OVERLAY_ABS;
+ }
+ else if((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) && !value) {
+ ed->over_ofs= ed->over_cfra - scene->r.cfra;
+ ed->over_flag &= ~SEQ_EDIT_OVERLAY_ABS;
+ }
+}
+
+static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr)
+{
+ Scene *scene= (Scene *)ptr->id.data;
+ Editing *ed= seq_give_editing(scene, FALSE);
+
+ if(ed==NULL)
+ return scene->r.cfra;
+
+ if(ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
+ return ed->over_cfra - scene->r.cfra;
+ else
+ return ed->over_ofs;
+
+}
+
+static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value)
+{
+ Scene *scene= (Scene *)ptr->id.data;
+ Editing *ed= seq_give_editing(scene, FALSE);
+
+ if(ed==NULL)
+ return;
+
+
+ if(ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
+ ed->over_cfra= (scene->r.cfra + value);
+ else
+ ed->over_ofs= value;
+}
+
#else
static void rna_def_strip_element(BlenderRNA *brna)
@@ -399,9 +658,7 @@ static void rna_def_strip_element(BlenderRNA *brna)
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filename", "");
- RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
}
@@ -414,25 +671,31 @@ static void rna_def_strip_crop(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripCrop");
- prop= RNA_def_property(srna, "top", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "max_y", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "top");
RNA_def_property_ui_text(prop, "Top", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "bottom", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "min_x", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "bottom");
RNA_def_property_ui_text(prop, "Bottom", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "left", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "min_y", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "left");
RNA_def_property_ui_text(prop, "Left", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "right", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "max_x", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "right");
RNA_def_property_ui_text(prop, "Right", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
+ RNA_def_struct_path_func(srna, "rna_SequenceCrop_path");
}
static void rna_def_strip_transform(BlenderRNA *brna)
@@ -455,6 +718,9 @@ static void rna_def_strip_transform(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Offset Y", "");
RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
+ RNA_def_struct_path_func(srna, "rna_SequenceTransform_path");
+
}
static void rna_def_strip_proxy(BlenderRNA *brna)
@@ -468,12 +734,13 @@ static void rna_def_strip_proxy(BlenderRNA *brna)
prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "dir");
- RNA_def_property_ui_text(prop, "Directory", "Location to story the proxy file");
+ RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "file", PROP_STRING, PROP_DIRPATH);
- RNA_def_property_string_sdna(prop, NULL, "file");
- RNA_def_property_ui_text(prop, "File", "Proxy file name");
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_ui_text(prop, "Path", "Location of custom proxy file");
+ RNA_def_property_string_funcs(prop, "rna_Sequence_proxy_filepath_get", "rna_Sequence_proxy_filepath_length", "rna_Sequence_proxy_filepath_set");
+
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
}
@@ -488,31 +755,36 @@ static void rna_def_strip_color_balance(BlenderRNA *brna)
prop= RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR);
RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows)");
+ RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR);
RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones)");
+ RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR);
RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights)");
+ RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "inverse_gain", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_gain", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN);
RNA_def_property_ui_text(prop, "Inverse Gain", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "inverse_gamma", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_gamma", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA);
RNA_def_property_ui_text(prop, "Inverse Gamma", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "inverse_lift", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_lift", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT);
RNA_def_property_ui_text(prop, "Inverse Lift", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
-
+
+ RNA_def_struct_path_func(srna, "rna_SequenceColorBalance_path");
+
/* not yet used
prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -529,7 +801,6 @@ static void rna_def_sequence(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- FunctionRNA *func;
static const EnumPropertyItem seq_type_items[]= {
{SEQ_IMAGE, "IMAGE", 0, "Image", ""},
@@ -551,6 +822,7 @@ static void rna_def_sequence(BlenderRNA *brna)
{SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
{SEQ_COLOR, "COLOR", 0, "Color", ""},
{SEQ_SPEED, "SPEED", 0, "Speed", ""},
+ {SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
{0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem blend_mode_items[]= {
@@ -584,35 +856,30 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
//prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
- //RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this sequence");
+ //RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by this sequence");
/* flags */
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
- RNA_def_property_ui_text(prop, "Selected", "");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
+ RNA_def_property_ui_text(prop, "Select", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "left_handle_selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
RNA_def_property_ui_text(prop, "Left Handle Selected", "");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "right_handle_selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
RNA_def_property_ui_text(prop, "Right Handle Selected", "");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL);
prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
RNA_def_property_ui_text(prop, "Mute", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_mute_update");
- prop= RNA_def_property(srna, "frame_locked", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_IPO_FRAME_LOCKED);
- RNA_def_property_ui_text(prop, "Frame Locked", "Lock the animation curve to the global frame counter");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
-
prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed");
@@ -620,13 +887,18 @@ static void rna_def_sequence(BlenderRNA *brna)
/* strip positioning */
- prop= RNA_def_property(srna, "length", PROP_INT, PROP_TIME);
- RNA_def_property_int_sdna(prop, NULL, "len");
+ prop= RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
- RNA_def_property_int_funcs(prop, "rna_Sequence_length_get", "rna_Sequence_length_set",NULL);
+ RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set",NULL);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
+ prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME);
+ RNA_def_property_int_sdna(prop, NULL, "len");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE|PROP_ANIMATABLE);
+ RNA_def_property_range(prop, 1, MAXFRAME);
+ RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "start");
@@ -638,7 +910,7 @@ static void rna_def_sequence(BlenderRNA *brna)
prop= RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startdisp");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Start Frame", "Start frame displayed in the sequence editor after offsets are applied, setting this is equivilent to moving the handle, not the actual start frame");
+ RNA_def_property_ui_text(prop, "Start Frame", "Start frame displayed in the sequence editor after offsets are applied, setting this is equivalent to moving the handle, not the actual start frame");
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -658,7 +930,7 @@ static void rna_def_sequence(BlenderRNA *brna)
prop= RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "endofs");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
- RNA_def_property_ui_text(prop, "End offset", "");
+ RNA_def_property_ui_text(prop, "End Offset", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME);
@@ -684,12 +956,13 @@ static void rna_def_sequence(BlenderRNA *brna)
/* blending */
- prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "blend_mode");
RNA_def_property_enum_items(prop, blend_mode_items);
RNA_def_property_ui_text(prop, "Blend Mode", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_FACTOR);
+ prop= RNA_def_property(srna, "blend_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Blend Opacity", "");
RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL); // stupid 0-100 -> 0-1
@@ -701,9 +974,9 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Effect fader position", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_effect_default_fade", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_default_fade", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE);
- RNA_def_property_ui_text(prop, "Use Default Fade", "Fade effect using the builtin default (usually make transition as long as effect strip)");
+ RNA_def_property_ui_text(prop, "Use Default Fade", "Fade effect using the built-in default (usually make transition as long as effect strip)");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -712,12 +985,7 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Speed effect fader position", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- /* functions */
- func= RNA_def_function(srna, "getStripElem", "give_stripelem");
- RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
- prop= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
- RNA_def_property_flag(prop, PROP_REQUIRED);
- RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
+ RNA_api_sequence_strip(srna);
}
static void rna_def_editor(BlenderRNA *brna)
@@ -749,6 +1017,24 @@ static void rna_def_editor(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+
+ prop= RNA_def_property(srna, "show_overlay", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_SHOW);
+ RNA_def_property_ui_text(prop, "Draw Axes", "Partial overlay ontop of the sequencer");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
+
+ prop= RNA_def_property(srna, "overlay_lock", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_ABS);
+ RNA_def_property_ui_text(prop, "Overlay Lock", "");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_overlay_lock_set");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
+
+ /* access to fixed and relative frame */
+ prop= RNA_def_property(srna, "overlay_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Overlay Offset", "");
+ RNA_def_property_int_funcs(prop, "rna_SequenceEditor_overlay_frame_get", "rna_SequenceEditor_overlay_frame_set", NULL);
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip");
}
@@ -756,41 +1042,49 @@ static void rna_def_filter_video(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "de_interlace", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_deinterlace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY);
RNA_def_property_ui_text(prop, "De-Interlace", "For video movies to remove fields");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update_reopen_files");
- prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL);
RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "flip_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX);
RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "flip_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY);
RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "convert_float", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_float", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT);
RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES);
RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "multiply_colors", PROP_FLOAT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "mul");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Multiply Colors", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+ prop= RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_UNSIGNED);
+ RNA_def_property_float_sdna(prop, NULL, "sat");
+ RNA_def_property_range(prop, 0.0f, 20.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 2.0f, 3, 3);
+ RNA_def_property_ui_text(prop, "Saturation", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 1.0f, 30.0f);
RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame");
@@ -840,25 +1134,33 @@ static void rna_def_proxy(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
RNA_def_property_ui_text(prop, "Proxy", "");
- prop= RNA_def_property(srna, "proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR);
RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
+ prop= RNA_def_property(srna, "use_proxy_custom_file", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_FILE);
+ RNA_def_property_ui_text(prop, "Proxy Custom File", "Use a custom file to read proxy data from");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
}
static void rna_def_input(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "animation_start_offset", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "animation_offset_start", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_startofs_final_set", NULL); // overlap tests
+
RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start)");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "animation_end_offset", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "animation_offset_end", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_endofs_final_set", NULL); // overlap tests
RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end)");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
}
@@ -922,6 +1224,7 @@ static void rna_def_scene(BlenderRNA *brna)
prop= RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -949,7 +1252,7 @@ static void rna_def_movie(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "File", "");
RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
"rna_Sequence_filepath_set");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_filepath_update");
rna_def_filter_video(srna);
rna_def_proxy(srna);
@@ -972,15 +1275,22 @@ static void rna_def_sound(BlenderRNA *brna)
prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume");
- RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+ prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, -100.0f, +40.0f);
+ RNA_def_property_ui_text(prop, "Attenuation/db", "Attenuation in dezibel");
+ RNA_def_property_float_funcs(prop, "rna_Sequence_attenuation_get", "rna_Sequence_attenuation_set", NULL);
+
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "");
RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
"rna_Sequence_filepath_set");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_filepath_update");
rna_def_input(srna);
}
@@ -993,7 +1303,28 @@ static void rna_def_effect(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Effect Sequence", "Sequence strip applying an effect on the images created by other strips");
RNA_def_struct_sdna(srna, "Sequence");
+ rna_def_filter_video(srna);
+ rna_def_proxy(srna);
+}
+
+static void rna_def_multicam(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "MulticamSequence", "Sequence");
+ RNA_def_struct_ui_text(srna, "Multicam Select Sequence", "Sequence strip to perform multicam editing: select channel from below");
+ RNA_def_struct_sdna(srna, "Sequence");
+
+ prop= RNA_def_property(srna, "multicam_source", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "multicam_source");
+ RNA_def_property_range(prop, 0, MAXSEQ-1);
+ RNA_def_property_ui_text(prop, "Multicam Source Channel", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
+ rna_def_filter_video(srna);
rna_def_proxy(srna);
+ rna_def_input(srna);
}
static void rna_def_plugin(BlenderRNA *brna)
@@ -1091,7 +1422,7 @@ static void rna_def_glow(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "blur_distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "blur_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dDist");
RNA_def_property_range(prop, 0.5f, 20.0f);
RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect");
@@ -1103,7 +1434,7 @@ static void rna_def_glow(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "only_boost", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_only_boost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -1143,7 +1474,7 @@ static void rna_def_transform(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "uniform_scale", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0);
RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -1186,7 +1517,7 @@ static void rna_def_solid_color(BlenderRNA *brna)
PropertyRNA *prop;
srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence");
- RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color");
+ RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single g");
RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
@@ -1211,17 +1542,17 @@ static void rna_def_speed_control(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "curve_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_curve_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
RNA_def_property_ui_text(prop, "F-Curve Velocity", "Interpret the F-Curve value as a velocity instead of a frame number");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "frame_blending", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_frame_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_BLEND);
RNA_def_property_ui_text(prop, "Frame Blending", "Blend two frames into the target for a smoother result");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "curve_compress_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_curve_compress_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
RNA_def_property_ui_text(prop, "F-Curve Compress Y", "Scale F-Curve value to get the target frame number, F-Curve value runs from 0.0 to 1.0");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -1244,6 +1575,7 @@ void RNA_def_sequencer(BlenderRNA *brna)
rna_def_movie(brna);
rna_def_sound(brna);
rna_def_effect(brna);
+ rna_def_multicam(brna);
rna_def_plugin(brna);
rna_def_wipe(brna);
rna_def_glow(brna);
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c
new file mode 100644
index 00000000000..425bad9fcd7
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_sequencer_api.c
@@ -0,0 +1,72 @@
+/**
+ * $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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Blender Foundation (2010)
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "RNA_define.h"
+
+#include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "rna_internal.h"
+
+#include "DNA_scene_types.h"
+#include "DNA_sequence_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_report.h"
+#include "BKE_sequencer.h"
+
+static void rna_Sequence_swap_internal(Sequence *seq_self, ReportList *reports, Sequence *seq_other)
+{
+ if(seq_swap(seq_self, seq_other) == 0)
+ BKE_report(reports, RPT_ERROR, "both strips must be the same length");
+}
+
+#else
+
+void RNA_api_sequence_strip(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "getStripElem", "give_stripelem");
+ RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
+ parm= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
+
+ func= RNA_def_function(srna, "swap", "rna_Sequence_swap_internal");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "other", "Sequence", "Other", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 970abf92b08..53f27bc06fb 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -55,7 +55,7 @@ static void rna_Smoke_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Smoke_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
rna_Smoke_update(bmain, scene, ptr);
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
}
static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -120,12 +120,18 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
{SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow compression"},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem smoke_domain_colli_items[] = {
+ {SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"},
+ {SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open", "Smoke doesn't collide with top and bottom sides"},
+ {SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"},
+ {0, NULL, 0, NULL, NULL}};
+
srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL);
RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings");
RNA_def_struct_sdna(srna, "SmokeDomainSettings");
RNA_def_struct_path_func(srna, "rna_SmokeDomainSettings_path");
- prop= RNA_def_property(srna, "maxres", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxres");
RNA_def_property_range(prop, 24, 512);
RNA_def_property_ui_range(prop, 24, 512, 2, 0);
@@ -139,12 +145,12 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "highres", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES);
RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "viewhighres", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG);
RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
@@ -169,7 +175,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Heat", "Higher value results in faster rising smoke");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "coll_group", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -183,7 +189,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Fluid Group", "Limit fluid objects to this group");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
- prop= RNA_def_property(srna, "eff_group", PROP_POINTER, PROP_NONE);
+ 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);
@@ -192,29 +198,24 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strength");
- RNA_def_property_range(prop, 1.0, 10.0);
- RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2);
+ RNA_def_property_range(prop, 0.0, 10.0);
+ RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2);
RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "diss_speed");
- RNA_def_property_range(prop, 1.0, 100.0);
- RNA_def_property_ui_range(prop, 1.0, 1000.0, 1, 0);
+ RNA_def_property_range(prop, 1.0, 10000.0);
+ RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, 0);
RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
RNA_def_property_update(prop, 0, NULL);
- prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_INITVELOCITY);
- RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle");
- RNA_def_property_update(prop, 0, NULL);
-
- prop= RNA_def_property(srna, "dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE);
RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time");
RNA_def_property_update(prop, 0, NULL);
- prop= RNA_def_property(srna, "dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG);
RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x ");
RNA_def_property_update(prop, 0, NULL);
@@ -229,24 +230,48 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "point_cache[1]");
RNA_def_property_ui_text(prop, "Point Cache", "");
- prop= RNA_def_property(srna, "smoke_cache_comp", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "point_cache_compress_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "cache_comp");
RNA_def_property_enum_items(prop, smoke_cache_comp_items);
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
RNA_def_property_update(prop, 0, NULL);
- prop= RNA_def_property(srna, "smoke_cache_high_comp", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "point_cache_compress_high_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "cache_high_comp");
RNA_def_property_enum_items(prop, smoke_cache_comp_items);
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
RNA_def_property_update(prop, 0, NULL);
+ prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
+ RNA_def_property_enum_items(prop, smoke_domain_colli_items);
+ RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object.");
+ RNA_def_property_update(prop, 0, NULL);
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Weights", "");
+ prop= RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH);
+ RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothens emitted smoke to avoid blockiness.");
+ RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "time_scale");
+ RNA_def_property_range(prop, 0.2, 1.5);
+ RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5);
+ RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "vorticity");
+ RNA_def_property_range(prop, 0.01, 4.0);
+ RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5);
+ RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
}
static void rna_def_smoke_flow_settings(BlenderRNA *brna)
@@ -270,20 +295,37 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "temp");
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_range(prop, -10, 10, 1, 1);
- RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambientt temperature");
+ RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature");
RNA_def_property_update(prop, 0, NULL);
- prop= RNA_def_property(srna, "psys", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object");
RNA_def_property_update(prop, 0, "rna_Smoke_reset_dependancy");
- prop= RNA_def_property(srna, "outflow", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation");
RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE);
+ RNA_def_property_ui_text(prop, "Absolute Density", "Only allows given density value in emitter area.");
+ RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
+ RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle");
+ RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "vel_multi");
+ RNA_def_property_range(prop, -2.0, 2.0);
+ RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5);
+ RNA_def_property_ui_text(prop, "Multiplier", "Multiplier to adjust velocity passed to smoke");
+ RNA_def_property_update(prop, 0, NULL);
}
static void rna_def_smoke_coll_settings(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c
index 3ff81df02f8..674fbbad9c6 100644
--- a/source/blender/makesrna/intern/rna_sound.c
+++ b/source/blender/makesrna/intern/rna_sound.c
@@ -36,7 +36,7 @@
#include "BKE_sound.h"
#include "BKE_context.h"
-static void rna_Sound_filename_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Sound_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
sound_load(bmain, (bSound*)ptr->data);
}
@@ -70,19 +70,19 @@ static void rna_def_sound(BlenderRNA *brna)
//rna_def_ipo_common(srna);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Filename", "Sound sample file used by this Sound datablock");
- RNA_def_property_update(prop, 0, "rna_Sound_filename_update");
+ RNA_def_property_ui_text(prop, "File Path", "Sound sample file used by this Sound datablock");
+ RNA_def_property_update(prop, 0, "rna_Sound_filepath_update");
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, "caching", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_memory_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Sound_caching_get", "rna_Sound_caching_set");
RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM");
- RNA_def_property_update(prop, 0, "rna_Sound_filename_update");
+ RNA_def_property_update(prop, 0, "rna_Sound_filepath_update");
}
void RNA_def_sound(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 8b3a54af4c2..214ef891724 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -89,7 +89,7 @@ EnumPropertyItem autosnap_items[] = {
{SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem viewport_shading_items[] = {
+EnumPropertyItem viewport_shade_items[] = {
{OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
{OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
{OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
@@ -125,7 +125,7 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
switch(space->spacetype) {
case SPACE_VIEW3D:
- return &RNA_Space3DView;
+ return &RNA_SpaceView3D;
case SPACE_IPO:
return &RNA_SpaceGraphEditor;
case SPACE_OUTLINER:
@@ -227,7 +227,7 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, i
RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_LOCAL);
RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_VIEW);
- if (ptr->type == &RNA_Space3DView)
+ if (ptr->type == &RNA_SpaceView3D)
scene = ((bScreen*)ptr->id.data)->scene;
else
scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */
@@ -256,7 +256,7 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, i
}
/* Space 3D View */
-static void rna_Space3DView_lock_camera_and_layers_set(PointerRNA *ptr, int value)
+static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int value)
{
View3D *v3d= (View3D*)(ptr->data);
bScreen *sc= (bScreen*)ptr->id.data;
@@ -299,36 +299,46 @@ static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
copy_v3_v3(cursor, values);
}
-static void rna_Space3DView_layer_set(PointerRNA *ptr, const int *values)
+static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values)
{
View3D *v3d= (View3D*)(ptr->data);
- v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values);
+ v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
}
static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
{
View3D *v3d= (View3D*)(ptr->data);
ScrArea *sa= rna_area_from_space(ptr);
- ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
- ARegion *ar= regionbase->last; /* always last in list, weak .. */
+ void *regiondata= NULL;
+ if(sa) {
+ ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
+ ARegion *ar= regionbase->last; /* always last in list, weak .. */
+ regiondata= ar->regiondata;
+ }
- return rna_pointer_inherit_refine(ptr, &RNA_Region3DView, ar->regiondata);
+ return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
}
static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr)
{
View3D *v3d= (View3D*)(ptr->data);
ScrArea *sa= rna_area_from_space(ptr);
- ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
- ARegion *ar= regionbase->last; /* always before last in list, weak .. */
-
- ar= (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL;
+ void *regiondata= NULL;
+ if(sa) {
+ ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
+ ARegion *ar= regionbase->last; /* always before last in list, weak .. */
+
+ ar= (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL;
+ if(ar) {
+ regiondata= ar->regiondata;
+ }
+ }
- return rna_pointer_inherit_refine(ptr, &RNA_Region3DView, (ar)? ar->regiondata: NULL);
+ return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
}
-static void rna_Region3DView_quadview_update(Main *main, Scene *scene, PointerRNA *ptr)
+static void rna_RegionView3D_quadview_update(Main *main, Scene *scene, PointerRNA *ptr)
{
ScrArea *sa;
ARegion *ar;
@@ -338,6 +348,18 @@ static void rna_Region3DView_quadview_update(Main *main, Scene *scene, PointerRN
ED_view3d_quadview_update(sa, ar);
}
+static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
+{
+ RegionView3D *rv3d= (RegionView3D *)(ptr->data);
+ negate_v3_v3(values, rv3d->ofs);
+}
+
+static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
+{
+ RegionView3D *rv3d= (RegionView3D *)(ptr->data);
+ negate_v3_v3(rv3d->ofs, values);
+}
+
/* Space Image Editor */
static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
@@ -458,7 +480,7 @@ static void rna_SpaceImageEditor_curves_update(Main *bmain, Scene *scene, Pointe
WM_main_add_notifier(NC_IMAGE, sima->image);
}
-static void rna_SpaceImageEditor_histogram_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_SpaceImageEditor_scopes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
SpaceImage *sima= (SpaceImage*)ptr->data;
ImBuf *ibuf;
@@ -466,13 +488,12 @@ static void rna_SpaceImageEditor_histogram_update(Main *bmain, Scene *scene, Poi
ibuf= ED_space_image_acquire_buffer(sima, &lock);
if(ibuf) {
- histogram_update(&sima->hist, ibuf);
+ scopes_update(&sima->scopes, ibuf, scene->r.color_mgt_flag & R_COLOR_MANAGEMENT);
WM_main_add_notifier(NC_IMAGE, sima->image);
}
ED_space_image_release_buffer(sima, lock);
}
-
/* Space Text Editor */
static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
@@ -493,6 +514,13 @@ static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
/* Space Properties */
+/* note: this function exists only to avoid id refcounting */
+static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value)
+{
+ SpaceButs *sbuts= (SpaceButs*)(ptr->data);
+ sbuts->pinid= value.data;
+}
+
static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
{
SpaceButs *sbuts= (SpaceButs*)(ptr->data);
@@ -503,6 +531,33 @@ static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
return &RNA_ID;
}
+static void rna_SpaceProperties_pin_id_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ SpaceButs *sbuts= (SpaceButs*)(ptr->data);
+ ID *id = sbuts->pinid;
+
+ if (id == NULL) {
+ sbuts->flag &= ~SB_PIN_CONTEXT;
+ return;
+ }
+
+ switch (GS(id->name)) {
+ case ID_MA:
+ WM_main_add_notifier(NC_MATERIAL|ND_SHADING, NULL);
+ break;
+ case ID_TE:
+ WM_main_add_notifier(NC_TEXTURE, NULL);
+ break;
+ case ID_WO:
+ WM_main_add_notifier(NC_WORLD, NULL);
+ break;
+ case ID_LA:
+ WM_main_add_notifier(NC_LAMP, NULL);
+ break;
+ }
+}
+
+
static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
{
SpaceButs *sbuts= (SpaceButs*)(ptr->data);
@@ -512,31 +567,30 @@ static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
}
/* Space Console */
-static void rna_ConsoleLine_line_get(PointerRNA *ptr, char *value)
+static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
{
ConsoleLine *ci= (ConsoleLine*)ptr->data;
strcpy(value, ci->line);
}
-static int rna_ConsoleLine_line_length(PointerRNA *ptr)
+static int rna_ConsoleLine_body_length(PointerRNA *ptr)
{
ConsoleLine *ci= (ConsoleLine*)ptr->data;
return ci->len;
}
-static void rna_ConsoleLine_line_set(PointerRNA *ptr, const char *value)
+static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
{
ConsoleLine *ci= (ConsoleLine*)ptr->data;
int len= strlen(value);
- if(len < ci->len_alloc) { /* allocated size is enough? */
- strcpy(ci->line, value);
- }
- else { /* allocate a new strnig */
+ if((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new strnig */
MEM_freeN(ci->line);
- ci->line= BLI_strdup(value);
- ci->len_alloc= len;
+ ci->line= MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline");
+ ci->len_alloc= len + 1;
}
+
+ memcpy(ci->line, value, len + 1);
ci->len= len;
if(ci->cursor > len) /* clamp the cursor */
@@ -558,7 +612,7 @@ static void rna_SpaceTime_redraw_update(Main *bmain, Scene *scene, PointerRNA *p
SpaceTime *st= (SpaceTime*)ptr->data;
bScreen *screen= (bScreen*)ptr->id.data;
- ED_screen_animation_timer_update(screen, st->redraws);
+ ED_screen_animation_timer_update(screen, st->redraws, SPACE_TIME);
}
/* Space Dopesheet */
@@ -680,7 +734,7 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
/* selection */
- prop= RNA_def_property(srna, "sticky_selection_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sticky");
RNA_def_property_enum_items(prop, sticky_mode_items);
RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected");
@@ -693,12 +747,12 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "draw_smooth_edges", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV);
RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "draw_stretch", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
@@ -709,17 +763,17 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "draw_modified_edges", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW);
RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "draw_other_objects", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER);
RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "normalized_coordinates", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
@@ -732,22 +786,22 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
/* todo: move edge and face drawing options here from G.f */
- prop= RNA_def_property(srna, "snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP);
RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "constrain_to_image_bounds", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV);
RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "live_unwrap", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "around");
RNA_def_property_enum_items(prop, pivot_items);
RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
@@ -760,20 +814,20 @@ static void rna_def_space_outliner(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem display_mode_items[] = {
- {0, "ALL_SCENES", 0, "All Scenes", ""},
- {1, "CURRENT_SCENE", 0, "Current Scene", ""},
- {2, "VISIBLE_LAYERS", 0, "Visible Layers", ""},
- {3, "SELECTED", 0, "Selected", ""},
- {4, "ACTIVE", 0, "Active", ""},
- {5, "SAME_TYPES", 0, "Same Types", ""},
- {6, "GROUPS", 0, "Groups", ""},
- {7, "LIBRARIES", 0, "Libraries", ""},
- {10, "SEQUENCE", 0, "Sequence", ""},
- {11, "DATABLOCKS", 0, "Datablocks", ""},
- {12, "USER_PREFERENCES", 0, "User Preferences", ""},
- {13, "KEYMAPS", 0, "Key Maps", ""},
+ {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", ""},
+ {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", ""},
+ {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", ""},
+ {SO_SELECTED, "SELECTED", 0, "Selected", ""},
+ {SO_ACTIVE, "ACTIVE", 0, "Active", ""},
+ {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", ""},
+ {SO_GROUPS, "GROUPS", 0, "Groups", ""},
+ {SO_LIBRARIES, "LIBRARIES", 0, "Libraries", ""},
+ {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", ""},
+ {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", ""},
+ {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", ""},
+ {SO_KEYMAP, "KEYMAPS", 0, "Key Maps", ""},
{0, NULL, 0, NULL, NULL}};
-
+
srna= RNA_def_struct(brna, "SpaceOutliner", "Space");
RNA_def_struct_sdna(srna, "SpaceOops");
RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
@@ -783,12 +837,26 @@ static void rna_def_space_outliner(BlenderRNA *brna)
RNA_def_property_enum_items(prop, display_mode_items);
RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
-
- prop= RNA_def_property(srna, "show_restriction_columns", PROP_BOOLEAN, PROP_NONE);
+
+ prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "search_string");
+ RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
+
+ prop= RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_CASE_SENSITIVE);
+ RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
+
+ prop= RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLETE);
+ RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
+
+ prop= RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
- RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show colum");
+ RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
-
}
static void rna_def_background_image(BlenderRNA *brna)
@@ -866,7 +934,7 @@ static void rna_def_background_image(BlenderRNA *brna)
}
-static void rna_def_space_3dview(BlenderRNA *brna)
+static void rna_def_space_view3d(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -879,8 +947,14 @@ static void rna_def_space_3dview(BlenderRNA *brna)
{V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", ""},
{V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", ""},
{0, NULL, 0, NULL, NULL}};
-
- srna= RNA_def_struct(brna, "Space3DView", "Space");
+
+ static EnumPropertyItem rv3d_persp_items[] = {
+ {RV3D_PERSP, "PERSP", 0, "Perspective", ""},
+ {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
+ {RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "SpaceView3D", "Space");
RNA_def_struct_sdna(srna, "View3D");
RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
@@ -901,9 +975,9 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lock Bone", "3D View center is locked to this bone's position");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "viewport_shading", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "drawtype");
- RNA_def_property_enum_items(prop, viewport_shading_items);
+ RNA_def_property_enum_items(prop, viewport_shade_items);
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);
@@ -911,7 +985,7 @@ static void rna_def_space_3dview(BlenderRNA *brna)
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");
- prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ|PROP_UNIT_LENGTH);
+ prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_View3D_CursorLocation_get", "rna_View3D_CursorLocation_set", NULL);
RNA_def_property_ui_text(prop, "3D Cursor Location", "3D cursor location for this view (dependent on local view setting)");
@@ -954,52 +1028,52 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "display_floor", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "display_x_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "display_y_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y);
RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "display_z_axis", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z);
RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "outline_selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline highlight around selected objects in non-wireframe views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "all_object_origins", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
RNA_def_property_ui_text(prop, "All Object Origins", "Show the object origin center dot for all (selected and unselected) objects");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "relationship_lines", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES);
RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "textured_solid", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_textured_solid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX);
RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "display_render_override", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE);
RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "occlude_geometry", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ZBUF_SELECT);
RNA_def_property_ui_text(prop, "Occlude Geometry", "Limit selection to visible (clipped with depth buffer)");
RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
@@ -1011,7 +1085,7 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Background Images", "List of background images");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "display_background_images", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPICS);
RNA_def_property_ui_text(prop, "Display Background Images", "Display reference images behind objects in the 3D View");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
@@ -1022,31 +1096,31 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "pivot_point_align", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN);
RNA_def_property_ui_text(prop, "Align", "Manipulate object centers only");
RNA_def_property_ui_icon(prop, ICON_ALIGN, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "manipulator", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "manipulator_translate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_manipulator_translate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE);
RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations");
RNA_def_property_ui_icon(prop, ICON_MAN_TRANS, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "manipulator_rotate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_manipulator_rotate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE);
RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations");
RNA_def_property_ui_icon(prop, ICON_MAN_ROT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "manipulator_scale", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_manipulator_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE);
RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations");
RNA_def_property_ui_icon(prop, ICON_MAN_SCALE, 0);
@@ -1061,59 +1135,59 @@ static void rna_def_space_3dview(BlenderRNA *brna)
prop= RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "TransformOrientation");
- RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current Transformation orientation");
prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_Space3DView_lock_camera_and_layers_set");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set");
RNA_def_property_ui_text(prop, "Lock Camera and Layers", "Use the scene's active camera and layers in this view, rather than local layers");
RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_Space3DView_layer_set");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_layer_set");
RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible in this 3D View");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "used_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop= RNA_def_property(srna, "layers_used", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "lay_used", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain something");
prop= RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Region3DView");
- RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL);
+ RNA_def_property_struct_type(prop, "RegionView3D");
+ RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region");
prop= RNA_def_property(srna, "region_quadview", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Region3DView");
- RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", NULL, NULL);
+ RNA_def_property_struct_type(prop, "RegionView3D");
+ RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Quad View Region", "3D region that defines the quad view settings");
/* region */
- srna= RNA_def_struct(brna, "Region3DView", "Region");
+ srna= RNA_def_struct(brna, "RegionView3D", NULL);
RNA_def_struct_sdna(srna, "RegionView3D");
RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_LOCKED);
RNA_def_property_ui_text(prop, "Lock", "Lock view rotation in side views");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Region3DView_quadview_update");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
- prop= RNA_def_property(srna, "box_preview", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXVIEW);
RNA_def_property_ui_text(prop, "Box", "Sync view position between side views");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Region3DView_quadview_update");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
- prop= RNA_def_property(srna, "box_clip", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXCLIP);
RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's visible in other side views");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Region3DView_quadview_update");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
prop= RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "persmat");
@@ -1126,6 +1200,34 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix of the 3D region");
+
+ prop= RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "persp");
+ RNA_def_property_enum_items(prop, rv3d_persp_items);
+ RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
+ prop= RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
+#if 0
+ RNA_def_property_float_sdna(prop, NULL, "ofs"); // cant use because its negated
+#else
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", NULL);
+#endif
+ RNA_def_property_ui_text(prop, "View Location", "View pivot location");
+ RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
+
+ prop= RNA_def_property(srna, "view_rotate_method", PROP_FLOAT, PROP_QUATERNION);
+ RNA_def_property_float_sdna(prop, NULL, "viewquat");
+ RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
+ /* not sure we need rna access to these but adding anyway */
+ prop= RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
+ RNA_def_property_float_sdna(prop, NULL, "dist");
+ RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
}
static void rna_def_space_buttons(BlenderRNA *brna)
@@ -1171,7 +1273,7 @@ static void rna_def_space_buttons(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
- prop= RNA_def_property(srna, "brush_texture", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_brush_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_BRUSH_TEX);
RNA_def_property_ui_text(prop, "Brush Texture", "Show brush textures");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
@@ -1180,9 +1282,10 @@ static void rna_def_space_buttons(BlenderRNA *brna)
prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pinid");
RNA_def_property_struct_type(prop, "ID");
- RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceProperties_pin_id_typef");
+ /* note: custom set function is ONLY to avoid rna setting a user for this. */
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set", "rna_SpaceProperties_pin_id_typef", NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
prop= RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT);
@@ -1200,7 +1303,7 @@ static void rna_def_space_image(BlenderRNA *brna)
/* image */
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
@@ -1215,14 +1318,14 @@ static void rna_def_space_image(BlenderRNA *brna)
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, "rna_SpaceImageEditor_curves_update");
-
- prop= RNA_def_property(srna, "histogram", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "hist");
- RNA_def_property_struct_type(prop, "Histogram");
- RNA_def_property_ui_text(prop, "Histogram", "Histogram for viewing image statistics");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_histogram_update");
- prop= RNA_def_property(srna, "image_pin", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "scopes");
+ RNA_def_property_struct_type(prop, "Scopes");
+ RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics.");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
+
+ prop= RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection");
RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
@@ -1234,7 +1337,7 @@ static void rna_def_space_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line");
/* image draw */
- prop= RNA_def_property(srna, "draw_repeated", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
@@ -1250,11 +1353,11 @@ static void rna_def_space_image(BlenderRNA *brna)
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_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
/* paint */
- prop= RNA_def_property(srna, "image_painting", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_image_paint", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL);
RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode");
RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0);
@@ -1272,7 +1375,7 @@ static void rna_def_space_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
/* update */
- prop= RNA_def_property(srna, "update_automatically", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
RNA_def_property_ui_text(prop, "Update Automatically", "Update other affected window spaces automatically to reflect changes during interactive operations such as transform");
@@ -1290,7 +1393,7 @@ static void rna_def_space_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Show UV Editor", "Show uv editing related properties");
+ RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
rna_def_space_image_uv(brna);
}
@@ -1303,7 +1406,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
static EnumPropertyItem view_type_items[] = {
{SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
{SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
- {SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SEQUENCER, "Sequencer and Image Preview", ""},
+ {SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SPLITVIEW, "Sequencer and Image Preview", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem display_mode_items[] = {
@@ -1312,6 +1415,15 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
{SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
{SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
{0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem proxy_render_size_items[] = {
+ {SEQ_PROXY_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
+ {SEQ_PROXY_RENDER_SIZE_SCENE, "SCENE", 0, "Scene render size", ""},
+ {SEQ_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "Proxy size 25%", ""},
+ {SEQ_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "Proxy size 50%", ""},
+ {SEQ_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""},
+ {SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceSeq");
@@ -1321,7 +1433,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
prop= RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "view");
RNA_def_property_enum_items(prop, view_type_items);
- RNA_def_property_ui_text(prop, "View Type", "The type of the Sequencere view (sequencer, preview or both)");
+ RNA_def_property_ui_text(prop, "View Type", "The type of the Sequencer view (sequencer, preview or both)");
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, 0, "rna_Sequencer_display_mode_update");
@@ -1333,14 +1445,14 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
/* flag's */
- prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_NO_DRAW_CFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "draw_frames", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
- RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather then seconds");
+ RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather than seconds");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
@@ -1348,12 +1460,12 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "separate_color_preview", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED);
- RNA_def_property_ui_text(prop, "Seperate Colors", "Seperate color channels in preview");
+ RNA_def_property_ui_text(prop, "Separate Colors", "Separate color channels in preview");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "draw_safe_margin", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_safe_margin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS);
RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
@@ -1373,7 +1485,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "chanshown");
RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined");
- RNA_def_property_range(prop, 0, 32); // MAXSEQ --- todo, move from BKE_sequencer.h
+ RNA_def_property_range(prop, -5, 32); // MAXSEQ --- todo, move from BKE_sequencer.h, allow up to 5 layers up the metastack. Should be dynamic...
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
@@ -1382,6 +1494,12 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 110);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
+ prop= RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "render_size");
+ RNA_def_property_enum_items(prop, proxy_render_size_items);
+ RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
+
/* not sure we need rna access to these but adding anyway */
prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
@@ -1413,42 +1531,39 @@ static void rna_def_space_text(BlenderRNA *brna)
prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL, NULL);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
/* display */
- prop= RNA_def_property(srna, "syntax_highlight", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
- RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
- RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
-
- prop= RNA_def_property(srna, "word_wrap", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0);
RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set");
RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "line_numbers", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0);
RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "overwrite", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
+ prop= RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
+ RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
+ RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "live_edit", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing");
+ prop= RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "line_hlight", 0);
+ RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tabnumber");
RNA_def_property_range(prop, 2, 8);
RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
+ RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL);
prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "lheight");
@@ -1456,13 +1571,24 @@ static void rna_def_space_text(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
+ /* functionality options */
+ prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "overwrite", 1);
+ RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
+
+ prop= RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "live_edit", 1);
+ RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
+
/* find */
- prop= RNA_def_property(srna, "find_all", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL);
RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "find_wrap", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP);
RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
@@ -1486,8 +1612,8 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
static EnumPropertyItem mode_items[] = {
{SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", ""},
{SACTCONT_ACTION, "ACTION", 0, "Action Editor", ""},
- {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", ""}, // XXX to be depreceated?
- {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", ""},
+ {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", ""},
+ //{SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", ""}, // XXX: to be reimplemented, but not enough time before 2.53 - Aligorith, 2010Jul14
{0, NULL, 0, NULL, NULL}};
@@ -1498,9 +1624,9 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
/* 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_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, "rna_SpaceDopeSheetEditor_action_update");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
/* mode */
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
@@ -1516,7 +1642,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
- prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
@@ -1527,12 +1653,12 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
/* editing */
- prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
- RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points");
+ RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
- prop= RNA_def_property(srna, "realtime_updates", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREALTIMEUPDATES);
RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
@@ -1548,7 +1674,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
/* autosnap */
- prop= RNA_def_property(srna, "autosnap", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "autosnap");
RNA_def_property_enum_items(prop, autosnap_items);
RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
@@ -1594,7 +1720,7 @@ static void rna_def_space_graph(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
@@ -1609,23 +1735,23 @@ static void rna_def_space_graph(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes", "Only keyframes of selected F-Curves are visible and editable");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY);
RNA_def_property_ui_text(prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* editing */
- prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
- RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points");
+ RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "realtime_updates", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTIMEUPDATES);
RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
@@ -1636,7 +1762,7 @@ static void rna_def_space_graph(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "cursor_value", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cursorVal");
RNA_def_property_ui_text(prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
@@ -1654,7 +1780,7 @@ static void rna_def_space_graph(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
/* autosnap */
- prop= RNA_def_property(srna, "autosnap", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "autosnap");
RNA_def_property_enum_items(prop, autosnap_items);
RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
@@ -1684,7 +1810,7 @@ static void rna_def_space_nla(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
- prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
@@ -1695,7 +1821,7 @@ static void rna_def_space_nla(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
/* editing */
- prop= RNA_def_property(srna, "realtime_updates", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTIMEUPDATES);
RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming strips, changes to the animation data are flushed to other views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
@@ -1707,7 +1833,7 @@ static void rna_def_space_nla(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
/* autosnap */
- prop= RNA_def_property(srna, "autosnap", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "autosnap");
RNA_def_property_enum_items(prop, autosnap_items);
RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
@@ -1724,51 +1850,77 @@ static void rna_def_space_time(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data");
/* Define Anim Playback Areas */
- prop= RNA_def_property(srna, "play_top_left", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_REGION);
RNA_def_property_ui_text(prop, "Top-Left 3D Editor", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
- prop= RNA_def_property(srna, "play_all_3d", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_3D_WIN);
RNA_def_property_ui_text(prop, "All 3D View Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
- prop= RNA_def_property(srna, "play_anim", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_ANIM_WIN);
RNA_def_property_ui_text(prop, "Animation Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
- prop= RNA_def_property(srna, "play_buttons", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_BUTS_WIN);
RNA_def_property_ui_text(prop, "Property Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
- prop= RNA_def_property(srna, "play_image", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_IMAGE_WIN);
RNA_def_property_ui_text(prop, "Image Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
- prop= RNA_def_property(srna, "play_sequencer", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_SEQ);
RNA_def_property_ui_text(prop, "Sequencer Editors", "");
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);
+ prop= RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_NODES);
RNA_def_property_ui_text(prop, "Node Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
/* Other options */
- prop= RNA_def_property(srna, "only_selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes for active Object and/or its selected channels only");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
- prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_CFRA_NUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
+
+ /* displaying cache status */
+ prop= RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DISPLAY);
+ RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
+
+ prop= RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SOFTBODY);
+ RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
+
+ prop= RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_PARTICLES);
+ RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
+
+ prop= RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_CLOTH);
+ RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
+
+ prop= RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SMOKE);
+ RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
}
static void rna_def_console_line(BlenderRNA *brna)
@@ -1780,8 +1932,8 @@ static void rna_def_console_line(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console");
// XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
- prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE);
- RNA_def_property_string_funcs(prop, "rna_ConsoleLine_line_get", "rna_ConsoleLine_line_length", "rna_ConsoleLine_line_set");
+ prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_funcs(prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
RNA_def_property_ui_text(prop, "Line", "Text in the line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
@@ -1818,11 +1970,11 @@ static void rna_def_space_console(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "Console type");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
- prop= RNA_def_property(srna, "selection_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
+ prop= RNA_def_property(srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
RNA_def_property_int_sdna(prop, NULL, "sel_start");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
- prop= RNA_def_property(srna, "selection_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
+ prop= RNA_def_property(srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
RNA_def_property_int_sdna(prop, NULL, "sel_end");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
@@ -1842,7 +1994,7 @@ static void rna_def_space_console(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL);
- prop= RNA_def_property(srna, "show_report_warn", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_WARN);
RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL);
@@ -1900,76 +2052,76 @@ static void rna_def_fileselect_params(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "file", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "file");
RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "display", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "display");
RNA_def_property_enum_items(prop, file_display_items);
RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "do_filter", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER);
RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "hide_dot", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_HIDE_DOT);
- RNA_def_property_ui_text(prop, "Hide Dot Files", "Hide hidden dot files");
+ prop= RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FILE_HIDE_DOT);
+ RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS , NULL);
- prop= RNA_def_property(srna, "sort", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sort");
RNA_def_property_enum_items(prop, file_sort_items);
RNA_def_property_ui_text(prop, "Sort", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "filter_image", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE);
RNA_def_property_ui_text(prop, "Filter Images", "Show image files");
RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "filter_blender", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE);
RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files");
RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "filter_movie", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE);
RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files");
RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "filter_script", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE);
RNA_def_property_ui_text(prop, "Filter Script", "Show script files");
RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "filter_font", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE);
RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files");
RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "filter_sound", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE);
RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files");
RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "filter_text", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE);
RNA_def_property_ui_text(prop, "Filter Text", "Show text files");
RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "filter_folder", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE);
RNA_def_property_ui_text(prop, "Filter Folder", "Show folders");
RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
@@ -2003,10 +2155,16 @@ static void rna_def_space_info(BlenderRNA *brna)
static void rna_def_space_userpref(BlenderRNA *brna)
{
StructRNA *srna;
-
+ PropertyRNA *prop;
+
srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space");
RNA_def_struct_sdna(srna, "SpaceUserPref");
RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data");
+
+ prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "filter");
+ RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
+
}
static void rna_def_space_node(BlenderRNA *brna)
@@ -2055,7 +2213,7 @@ static void rna_def_space_node(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited");
- prop= RNA_def_property(srna, "backdrop", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW);
RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
@@ -2064,10 +2222,70 @@ static void rna_def_space_node(BlenderRNA *brna)
static void rna_def_space_logic(BlenderRNA *brna)
{
StructRNA *srna;
+ PropertyRNA *prop;
srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceLogic");
RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data");
+
+ /* sensors */
+ prop= RNA_def_property(srna, "show_sensors_selected_objects", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_SEL);
+ RNA_def_property_ui_text(prop, "Show Selected Object", "Show sensors of all selected objects");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_sensors_active_object", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_ACT);
+ RNA_def_property_ui_text(prop, "Show Active Object", "Show sensors of active object");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_sensors_linked_controller", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_LINK);
+ RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to the controller");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_sensors_active_states", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_STATE);
+ RNA_def_property_ui_text(prop, "Show Active States", "Show only sensors connected to active states");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ /* controllers */
+ prop= RNA_def_property(srna, "show_controllers_selected_objects", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_SEL);
+ RNA_def_property_ui_text(prop, "Show Selected Object", "Show controllers of all selected objects");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_controllers_active_object", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_ACT);
+ RNA_def_property_ui_text(prop, "Show Active Object", "Show controllers of active object");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_controllers_linked_controller", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_LINK);
+ RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to sensor/actuator");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ /* actuators */
+ prop= RNA_def_property(srna, "show_actuators_selected_objects", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_SEL);
+ RNA_def_property_ui_text(prop, "Show Selected Object", "Show actuators of all selected objects");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_actuators_active_object", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_ACT);
+ RNA_def_property_ui_text(prop, "Show Active Object", "Show actuators of active object");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_actuators_linked_controller", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_LINK);
+ RNA_def_property_ui_text(prop, "Show Linked to Actuator", "Show linked objects to the actuator");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop= RNA_def_property(srna, "show_actuators_active_states", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_STATE);
+ RNA_def_property_ui_text(prop, "Show Active States", "Show only actuators connected to active states");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
}
void RNA_def_space(BlenderRNA *brna)
@@ -2080,7 +2298,7 @@ void RNA_def_space(BlenderRNA *brna)
rna_def_space_filebrowser(brna);
rna_def_space_outliner(brna);
rna_def_background_image(brna);
- rna_def_space_3dview(brna);
+ rna_def_space_view3d(brna);
rna_def_space_buttons(brna);
rna_def_space_dopesheet(brna);
rna_def_space_graph(brna);
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index ad90afb84a6..15e7ce525ba 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -76,7 +76,7 @@ static int rna_Text_modified_get(PointerRNA *ptr)
return text_file_modified(text);
}
-static void rna_TextLine_line_get(PointerRNA *ptr, char *value)
+static void rna_TextLine_body_get(PointerRNA *ptr, char *value)
{
TextLine *line= (TextLine*)ptr->data;
@@ -86,21 +86,23 @@ static void rna_TextLine_line_get(PointerRNA *ptr, char *value)
strcpy(value, "");
}
-static int rna_TextLine_line_length(PointerRNA *ptr)
+static int rna_TextLine_body_length(PointerRNA *ptr)
{
TextLine *line= (TextLine*)ptr->data;
return line->len;
}
-static void rna_TextLine_line_set(PointerRNA *ptr, const char *value)
+static void rna_TextLine_body_set(PointerRNA *ptr, const char *value)
{
TextLine *line= (TextLine*)ptr->data;
+ int len= strlen(value);
if(line->line)
MEM_freeN(line->line);
-
- line->line= BLI_strdup(value);
- line->len= strlen(line->line);
+
+ line->line= MEM_mallocN((len + 1) * sizeof(char), "rna_text_body");
+ line->len= len;
+ memcpy(line->line, value, len + 1);
if(line->format) {
MEM_freeN(line->format);
@@ -118,8 +120,8 @@ static void rna_def_text_line(BlenderRNA *brna)
srna = RNA_def_struct(brna, "TextLine", NULL);
RNA_def_struct_ui_text(srna, "Text Line", "Line of text in a Text datablock");
- prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE);
- RNA_def_property_string_funcs(prop, "rna_TextLine_line_get", "rna_TextLine_line_length", "rna_TextLine_line_set");
+ prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_funcs(prop, "rna_TextLine_body_get", "rna_TextLine_body_length", "rna_TextLine_body_set");
RNA_def_property_ui_text(prop, "Line", "Text in the line");
RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL);
}
@@ -137,11 +139,13 @@ static void rna_def_text_marker(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Line", "Line in which the marker is located");
- prop= RNA_def_property(srna, "start", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "character_index_start", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Start", "Start position of the marker in the line");
- prop= RNA_def_property(srna, "end", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "character_index_end", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "end");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "End", "Start position of the marker in the line");
@@ -150,12 +154,12 @@ static void rna_def_text_marker(BlenderRNA *brna)
RNA_def_property_range(prop, 0, (int)0xFFFF);
RNA_def_property_ui_text(prop, "Group", "");
- prop= RNA_def_property(srna, "temporary", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_temporary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TMARK_TEMP);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Temporary", "Marker is temporary");
- prop= RNA_def_property(srna, "edit_all", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_edit_all", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TMARK_EDITALL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Edit All", "Edit all markers of the same group as one");
@@ -174,30 +178,30 @@ static void rna_def_text(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_TEXT);
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_Text_filename_get", "rna_Text_filename_length", "rna_Text_filename_set");
- RNA_def_property_ui_text(prop, "Filename", "Filename of the text file");
+ RNA_def_property_ui_text(prop, "File Path", "Filename of the text file");
- prop= RNA_def_property(srna, "dirty", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISDIRTY);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dirty", "Text file has been edited since last save");
- prop= RNA_def_property(srna, "modified", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Text_modified_get", NULL);
RNA_def_property_ui_text(prop, "Modified", "Text file on disk is different than the one in memory");
- prop= RNA_def_property(srna, "memory", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_in_memory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISMEM);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Memory", "Text file is in memory, without a corresponding file on disk");
prop= RNA_def_property(srna, "use_module", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISSCRIPT);
- RNA_def_property_ui_text(prop, "Register", "Register this text as a module on loading");
+ RNA_def_property_ui_text(prop, "Register", "Register this text as a module on loading, Text name must end with \".py\"");
- prop= RNA_def_property(srna, "tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_TABSTOSPACES);
RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces");
@@ -217,14 +221,14 @@ 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_NONE);
+ prop= RNA_def_property(srna, "select_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");
RNA_def_property_ui_text(prop, "Selection End Line", "End line of selection");
- prop= RNA_def_property(srna, "selection_end_character", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "select_end_character", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "selc");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Selection End Character", "Index of character after end of selection in the selection end line");
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index ba91cdf690a..567166fd15f 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -60,7 +60,7 @@ EnumPropertyItem texture_type_items[] = {
{TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", ""},
{TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", ""},
{TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", ""},
- {TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""},
+ //{TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""}, /* Nothing yet */
{TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""},
{TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", ""},
{TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", ""},
@@ -75,6 +75,7 @@ EnumPropertyItem texture_type_items[] = {
#include "RNA_access.h"
#include "BKE_depsgraph.h"
+#include "BKE_image.h"
#include "BKE_texture.h"
#include "BKE_main.h"
@@ -131,6 +132,22 @@ static void rna_Texture_update(Main *bmain, Scene *scene, PointerRNA *ptr)
WM_main_add_notifier(NC_TEXTURE, tex);
}
+static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ tex->vd->ok = 0;
+ rna_Texture_update(bmain, scene, ptr);
+}
+
+static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ tex->ima->source = IMA_SRC_SEQUENCE;
+ rna_Texture_voxeldata_update(bmain, scene, ptr);
+}
+
/* Used for Texture Properties, used (also) for/in Nodes */
static void rna_Texture_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -143,24 +160,8 @@ static void rna_Texture_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Texture_type_set(PointerRNA *ptr, int value)
{
Tex *tex= (Tex*)ptr->data;
-
- switch(value) {
-
- case TEX_VOXELDATA:
- if (tex->vd == NULL)
- tex->vd = BKE_add_voxeldata();
- break;
- case TEX_POINTDENSITY:
- if (tex->pd == NULL)
- tex->pd = BKE_add_pointdensity();
- break;
- case TEX_ENVMAP:
- if (tex->env == NULL)
- tex->env = BKE_add_envmap();
- break;
- }
- tex->type = value;
+ tex_set_type(tex, value);
}
void rna_TextureSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -387,22 +388,22 @@ static void rna_def_texmapping(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Scale", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_XYZ);
+ prop= RNA_def_property(srna, "min", 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, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_XYZ);
+ prop= RNA_def_property(srna, "max", 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, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "has_minimum", PROP_BOOLEAN, PROP_NONE);
+ 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, "Has Minimum", "Whether to use minimum clipping value");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "has_maximum", PROP_BOOLEAN, PROP_NONE);
+ 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, "Has Maximum", "Whether to use maximum clipping value");
RNA_def_property_update(prop, 0, "rna_Texture_update");
@@ -463,7 +464,8 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Offset", "Fine tunes texture mapping X, Y and Z locations");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_XYZ);
+ prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "size");
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, 0, "rna_TextureSlot_update");
@@ -480,17 +482,17 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Blend Type", "");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "stencil", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "negate", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert", 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, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "rgb_to_intensity", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_TextureSlot_update");
@@ -513,18 +515,18 @@ static void rna_def_filter_common(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "mipmap", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mipmap", PROP_BOOLEAN, PROP_NONE);
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, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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 Gaussian filter", "Uses Gauss filter to sample down MIP maps");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texfilter");
RNA_def_property_enum_items(prop, texture_filter_items);
RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image");
@@ -542,7 +544,7 @@ static void rna_def_filter_common(StructRNA *srna)
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, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "filter_size_minimum", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_filter_size_min", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN);
RNA_def_property_ui_text(prop, "Minimum Filter Size", "Use Filter Size as a minimal filter value in pixels");
RNA_def_property_update(prop, 0, "rna_Texture_update");
@@ -614,19 +616,19 @@ static void rna_def_environment_map(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Zoom", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "ignore_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop= RNA_def_property(srna, "layers_ignore", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "notlay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Ignore Layers", "Hide objects on these layers when generating the Environment Map");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED);
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, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
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, 0, "rna_Texture_update");
@@ -665,7 +667,7 @@ static void rna_def_texture_clouds(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Clouds Texture", "Procedural noise texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "noise_scale", 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);
@@ -691,7 +693,7 @@ static void rna_def_texture_clouds(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "cloud_type", 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", "");
@@ -726,7 +728,7 @@ static void rna_def_texture_wood(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Wood Texture", "Procedural noise texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "noise_scale", 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);
@@ -752,13 +754,13 @@ static void rna_def_texture_wood(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "wood_type", 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, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "noisebasis_2", 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", "");
@@ -793,7 +795,7 @@ static void rna_def_texture_marble(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Marble Texture", "Procedural noise texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "noise_scale", 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);
@@ -820,7 +822,7 @@ static void rna_def_texture_marble(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "marble_type", 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", "");
@@ -832,7 +834,7 @@ static void rna_def_texture_marble(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "noisebasis_2", 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", "");
@@ -900,7 +902,7 @@ static void rna_def_texture_blend(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "flip_axis", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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");
@@ -936,7 +938,7 @@ static void rna_def_texture_stucci(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "noise_scale", 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);
@@ -949,7 +951,7 @@ static void rna_def_texture_stucci(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "stucci_type", 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", "");
@@ -989,13 +991,13 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Image Texture", "");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "interpolation", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 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);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Texture_update");
@@ -1005,7 +1007,7 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Alpha", "Uses the alpha channel information in the image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "calculate_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Texture_update");
@@ -1035,22 +1037,22 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Repeat Y", "Sets a repetition multiplier in the Y direction");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "mirror_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "mirror_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "checker_odd", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "checker_even", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Texture_update");
@@ -1117,7 +1119,7 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Texture_update");
/* Normal Map */
- prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Texture_update");
@@ -1196,7 +1198,7 @@ static void rna_def_texture_musgrave(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "highest_dimension", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "dimension_max", 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");
@@ -1205,7 +1207,7 @@ static void rna_def_texture_musgrave(BlenderRNA *brna)
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_ui_text(prop, "Lacunarity", "Gap between successive frequencies");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE);
@@ -1232,7 +1234,7 @@ static void rna_def_texture_musgrave(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Noise Intensity", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "noise_scale", 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);
@@ -1315,7 +1317,7 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Distance Metric", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "color_mode", 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", "");
@@ -1327,7 +1329,7 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Noise Intensity", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "noise_scale", 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);
@@ -1356,7 +1358,7 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Distortion Amount", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "noise_scale", 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);
@@ -1446,17 +1448,17 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points");
RNA_def_property_struct_type(prop, "ParticleSystem");
- RNA_def_property_pointer_funcs(prop, "rna_PointDensity_psys_get", "rna_PointDensity_psys_set", NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_PointDensity_psys_get", "rna_PointDensity_psys_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "particle_cache", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "particle_cache_space", 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, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "vertices_cache", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "vertex_cache_space", 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");
@@ -1474,7 +1476,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Falloff", "Method of attenuating density by distance from the point");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "falloff_softness", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "falloff_soft", 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");
@@ -1489,7 +1491,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
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_ui_text(prop, "Scale", "Multiplier to bring particle speed within an acceptable range");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
@@ -1499,12 +1501,12 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Texture_update");
/* Turbulence */
- prop= RNA_def_property(srna, "turbulence", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "turbulence_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "turbulence_scale", 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");
@@ -1531,7 +1533,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
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_ui_text(prop, "Noise Basis", "Noise formula used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_update");
@@ -1539,7 +1541,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "Tex");
RNA_def_struct_ui_text(srna, "Point Density", "Settings for the Point Density texture");
- prop= RNA_def_property(srna, "pointdensity", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "point_density", PROP_POINTER, PROP_NONE);
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");
@@ -1593,7 +1595,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "smoked_type");
RNA_def_property_enum_items(prop, smoked_type_items);
RNA_def_property_ui_text(prop, "Source", "Simulation value to be used as a texture");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
@@ -1611,41 +1613,41 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
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, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
- prop= RNA_def_property(srna, "source_path", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", 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, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_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, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
- prop= RNA_def_property(srna, "still", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_still_frame", 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, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
- prop= RNA_def_property(srna, "still_frame_number", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "still_frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "still_frame");
RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_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, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture");
RNA_def_struct_sdna(srna, "Tex");
RNA_def_struct_ui_text(srna, "Voxel Data", "Settings for the Voxel Data texture");
- prop= RNA_def_property(srna, "voxeldata", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "voxel_data", PROP_POINTER, PROP_NONE);
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");
@@ -1656,12 +1658,12 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
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_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_image_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");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
}
static void rna_def_texture(BlenderRNA *brna)
@@ -1695,7 +1697,7 @@ static void rna_def_texture(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Color Ramp", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "brightness", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "intensity", 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", "");
@@ -1705,6 +1707,11 @@ static void rna_def_texture(BlenderRNA *brna)
RNA_def_property_range(prop, 0.01, 5);
RNA_def_property_ui_text(prop, "Contrast", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0, 2);
+ RNA_def_property_ui_text(prop, "Saturation", "");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* RGB Factor */
prop= RNA_def_property(srna, "factor_red", PROP_FLOAT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_timeline.c b/source/blender/makesrna/intern/rna_timeline.c
index afc1d087cf2..a436c746910 100644
--- a/source/blender/makesrna/intern/rna_timeline.c
+++ b/source/blender/makesrna/intern/rna_timeline.c
@@ -55,9 +55,9 @@ static void rna_def_timeline_marker(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Frame", "The frame on which the timeline marker appears");
RNA_def_property_update(prop, NC_ANIMATION, NULL);
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1 /*SELECT*/);
- RNA_def_property_ui_text(prop, "Selected", "Marker selection state");
+ RNA_def_property_ui_text(prop, "Select", "Marker selection state");
RNA_def_property_update(prop, NC_ANIMATION, NULL);
#ifdef DURIAN_CAMERA_SWITCH
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index d25efd23da0..f2c33f354c2 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -207,6 +207,7 @@ static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, voi
pt->ext.call= call;
pt->ext.free= free;
RNA_struct_blender_type_set(pt->ext.srna, pt);
+ RNA_def_struct_flag(pt->ext.srna, STRUCT_NO_IDPROPERTIES);
pt->poll= (have_function[0])? panel_poll: NULL;
pt->draw= (have_function[1])? panel_draw: NULL;
@@ -418,6 +419,7 @@ static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void
mt->ext.call= call;
mt->ext.free= free;
RNA_struct_blender_type_set(mt->ext.srna, mt);
+ RNA_def_struct_flag(mt->ext.srna, STRUCT_NO_IDPROPERTIES);
mt->poll= (have_function[0])? menu_poll: NULL;
mt->draw= (have_function[1])? menu_draw: NULL;
@@ -545,10 +547,11 @@ static void rna_def_ui_layout(BlenderRNA *brna)
prop= RNA_def_property(srna, "operator_context", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, operator_context_items);
RNA_def_property_enum_funcs(prop, "rna_UILayout_op_context_get", "rna_UILayout_op_context_set", NULL);
-
+
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set");
-
+ RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is greyed out.");
+
#if 0
prop= RNA_def_property(srna, "red_alert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_red_alert_get", "rna_UILayout_red_alert_set");
@@ -565,10 +568,11 @@ static void rna_def_ui_layout(BlenderRNA *brna)
prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_funcs(prop, "rna_UILayout_scale_x_get", "rna_UILayout_scale_x_set", NULL);
-
+ RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout.");
+
prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL);
-
+ RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout.");
RNA_api_ui_layout(srna);
}
@@ -579,69 +583,79 @@ static void rna_def_panel(BlenderRNA *brna)
PropertyRNA *parm;
FunctionRNA *func;
+ static EnumPropertyItem panel_flag_items[] = {
+ {PNL_DEFAULT_CLOSED, "DEFAULT_CLOSED", 0, "Default Closed", "Defines if the panel has to be open or collapsed at the time of its creation."},
+ {PNL_NO_HEADER, "HIDE_HEADER", 0, "Show Header", "If set to True, the panel shows a header, which contains a clickable arrow to collapse the panel and the label (see bl_label)."},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "Panel", NULL);
- RNA_def_struct_ui_text(srna, "Panel", "Panel containing buttons");
+ RNA_def_struct_ui_text(srna, "Panel", "Panel containing UI elements");
RNA_def_struct_sdna(srna, "Panel");
RNA_def_struct_refine_func(srna, "rna_Panel_refine");
RNA_def_struct_register_funcs(srna, "rna_Panel_register", "rna_Panel_unregister");
/* poll */
func= RNA_def_function(srna, "poll", NULL);
- RNA_def_function_ui_description(func, "Test if the panel is visible or not.");
- RNA_def_function_flag(func, FUNC_REGISTER|FUNC_REGISTER_OPTIONAL);
+ RNA_def_function_ui_description(func, "If this method returns a non-null output, then the panel can be drawn.");
+ RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* draw */
func= RNA_def_function(srna, "draw", NULL);
- RNA_def_function_ui_description(func, "Draw buttons into the panel UI layout.");
+ RNA_def_function_ui_description(func, "Draw UI elements into the panel UI layout.");
RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "draw_header", NULL);
- RNA_def_function_ui_description(func, "Draw buttons into the panel header UI layout.");
+ RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout.");
RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "UILayout");
-
+ RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI.");
+
prop= RNA_def_property(srna, "text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "drawname");
-
+ RNA_def_property_ui_text(prop, "Text", "XXX todo");
+
/* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER);
-
+ RNA_def_property_ui_text(prop, "ID Name", "If this is set, the panel gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is \"OBJECT_PT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_PT_hello\"");
+
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER);
-
+ RNA_def_property_ui_text(prop, "Label", "The panel label, shows up in the panel header at the right of the triangle used to collapse the panel.");
+
prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_flag(prop, PROP_REGISTER);
-
+ RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in.");
+
prop= RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->region_type");
RNA_def_property_enum_items(prop, region_type_items);
RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_property_ui_text(prop, "Region Type", "The region where the panel is going to be used in.");
prop= RNA_def_property(srna, "bl_context", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->context");
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); /* should this be optional? - Campbell */
-
- prop= RNA_def_property(srna, "bl_default_closed", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_DEFAULT_CLOSED);
- RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
-
- prop= RNA_def_property(srna, "bl_show_header", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", PNL_NO_HEADER);
- RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
+ RNA_def_property_ui_text(prop, "Context", "The context in which the panel belongs to. (TODO: explain the possible combinations bl_context/bl_region_type/bl_space_type)");
+
+ prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type->flag");
+ RNA_def_property_enum_items(prop, panel_flag_items);
+ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG);
+ RNA_def_property_ui_text(prop, "Options", "Options for this panel type");
}
static void rna_def_header(BlenderRNA *brna)
@@ -652,14 +666,14 @@ static void rna_def_header(BlenderRNA *brna)
FunctionRNA *func;
srna= RNA_def_struct(brna, "Header", NULL);
- RNA_def_struct_ui_text(srna, "Header", "Editor header containing buttons");
+ RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements.");
RNA_def_struct_sdna(srna, "Header");
RNA_def_struct_refine_func(srna, "rna_Header_refine");
RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister");
/* draw */
func= RNA_def_function(srna, "draw", NULL);
- RNA_def_function_ui_description(func, "Draw buttons into the header UI layout.");
+ RNA_def_function_ui_description(func, "Draw UI elements into the header UI layout.");
RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -669,16 +683,19 @@ static void rna_def_header(BlenderRNA *brna)
prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "layout");
RNA_def_property_struct_type(prop, "UILayout");
+ RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the header in the UI.");
/* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_property_ui_text(prop, "ID Name", "If this is set, the header gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is \"OBJECT_HT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_HT_hello\"");
prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_property_ui_text(prop, "Space type", "The space where the header is going to be used in.");
RNA_define_verify_sdna(1);
}
@@ -698,15 +715,15 @@ static void rna_def_menu(BlenderRNA *brna)
/* poll */
func= RNA_def_function(srna, "poll", NULL);
- RNA_def_function_ui_description(func, "Test if the menu is visible or not.");
- RNA_def_function_flag(func, FUNC_REGISTER|FUNC_REGISTER_OPTIONAL);
+ RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn.");
+ RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* draw */
func= RNA_def_function(srna, "draw", NULL);
- RNA_def_function_ui_description(func, "Draw buttons into the menu UI layout.");
+ RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout.");
RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -716,15 +733,18 @@ static void rna_def_menu(BlenderRNA *brna)
prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "layout");
RNA_def_property_struct_type(prop, "UILayout");
+ RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the menu in the UI.");
/* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_property_ui_text(prop, "ID Name", "If this is set, the menu gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is \"OBJECT_MT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_MT_hello\"");
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_property_ui_text(prop, "Label", "The menu label");
RNA_define_verify_sdna(1);
}
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 89c7876f6e0..4f5c8094c14 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -35,13 +35,13 @@
#ifdef RNA_RUNTIME
-static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, char *propname, char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int no_bg, int index)
+static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, char *propname, char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int emboss, int index)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
int flag= 0;
if(!prop) {
- printf("rna_uiItemR: property not found: %s\n", propname);
+ printf("rna_uiItemR: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
return;
}
@@ -51,14 +51,16 @@ static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, char *propname, char
flag |= (icon_only)? UI_ITEM_R_ICON_ONLY: 0;
flag |= (event)? UI_ITEM_R_EVENT: 0;
flag |= (full_event)? UI_ITEM_R_FULL_EVENT: 0;
- flag |= (no_bg)? UI_ITEM_R_NO_BG: 0;
+ flag |= (emboss)? 0: UI_ITEM_R_NO_BG;
uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon);
}
-static PointerRNA rna_uiItemO(uiLayout *layout, char *opname, char *name, int icon)
+static PointerRNA rna_uiItemO(uiLayout *layout, char *opname, char *name, int icon, int emboss)
{
- return uiItemFullO(layout, opname, name, icon, NULL, uiLayoutGetOperatorContext(layout), UI_ITEM_O_RETURN_PROPS);
+ int flag= UI_ITEM_O_RETURN_PROPS;
+ flag |= (emboss)? 0: UI_ITEM_R_NO_BG;
+ return uiItemFullO(layout, opname, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag);
}
#else
@@ -85,7 +87,7 @@ static void api_ui_item_op(FunctionRNA *func)
{
PropertyRNA *parm;
parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
}
static void api_ui_item_op_common(FunctionRNA *func)
@@ -125,11 +127,13 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "row", "uiLayoutRow");
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
RNA_def_function_return(func, parm);
+ RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed next to each other in a row.");
RNA_def_boolean(func, "align", 0, "", "Align buttons to each other.");
-
+
func= RNA_def_function(srna, "column", "uiLayoutColumn");
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
RNA_def_function_return(func, parm);
+ RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed under each other in a column.");
RNA_def_boolean(func, "align", 0, "", "Align buttons to each other.");
func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
@@ -142,7 +146,8 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "box", "uiLayoutBox");
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
RNA_def_function_return(func, parm);
-
+ RNA_def_function_ui_description(func, "Sublayout. Items placed in this sublayout are placed under each other in a column and are surrounded by a box.");
+
/* split layout */
func= RNA_def_function(srna, "split", "uiLayoutSplit");
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
@@ -152,6 +157,7 @@ void RNA_api_ui_layout(StructRNA *srna)
/* items */
func= RNA_def_function(srna, "prop", "rna_uiItemR");
+ RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout.");
api_ui_item_rna_common(func);
api_ui_item_common(func);
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
@@ -160,7 +166,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_boolean(func, "icon_only", 0, "", "Draw only icons in buttons, no text.");
RNA_def_boolean(func, "event", 0, "", "Use button to input key events.");
RNA_def_boolean(func, "full_event", 0, "", "Use button to input full events including modifiers.");
- RNA_def_boolean(func, "no_bg", 0, "", "Don't draw the button itself, just the icon/text.");
+ RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text.");
RNA_def_int(func, "index", -1, -2, INT_MAX, "", "The index of this button, when set a single member of an array can be accessed, when set to -1 all array members are used.", -2, INT_MAX); /* RNA_NO_INDEX == -1 */
func= RNA_def_function(srna, "props_enum", "uiItemsEnumR");
@@ -176,7 +182,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func);
- func= RNA_def_function(srna, "prop_object", "uiItemPointerR");
+ func= RNA_def_function(srna, "prop_search", "uiItemPointerR");
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|PROP_NEVER_NULL);
@@ -186,9 +192,11 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "operator", "rna_uiItemO");
api_ui_item_op_common(func);
+ RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text.");
parm= RNA_def_pointer(func, "properties", "OperatorProperties", "", "Operator properties to fill in, return when 'properties' is set to true.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
RNA_def_function_return(func, parm);
+ RNA_def_function_ui_description(func, "Item. Places a button into the layout to call an Operator.");
/* func= RNA_def_function(srna, "operator_enum", "uiItemEnumO_string");
api_ui_item_op_common(func);
@@ -238,6 +246,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED); */
func= RNA_def_function(srna, "label", "uiItemL");
+ RNA_def_function_ui_description(func, "Item. Display text in the layout.");
api_ui_item_common(func);
func= RNA_def_function(srna, "menu", "uiItemM");
@@ -247,6 +256,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "separator", "uiItemS");
+ RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items.");
/* context */
func= RNA_def_function(srna, "set_context_pointer", "uiLayoutSetContextPointer");
@@ -260,11 +270,6 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander.");
- func= RNA_def_function(srna, "template_dopesheet_filter", "uiTemplateDopeSheetFilter");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "dopesheet", "DopeSheet", "", "DopeSheet settings holding filter options.");
- RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
-
func= RNA_def_function(srna, "template_ID", "uiTemplateID");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
@@ -303,35 +308,50 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers.");
parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data.");
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);
- RNA_def_boolean(func, "compact", 0, "", "Show a smaller version of the template, split on two lines.");
func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
+ RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints.");
parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data.");
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");
+ RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps, etc.");
parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock.");
RNA_def_property_flag(parm, PROP_REQUIRED);
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");
+ RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps.");
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, "levels", 0, "", "Show black/white levels.");
RNA_def_boolean(func, "brush", 0, "", "Show brush options.");
func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
+ RNA_def_function_ui_description(func, "Item. A color ramp widget.");
api_ui_item_rna_common(func);
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
func= RNA_def_function(srna, "template_histogram", "uiTemplateHistogram");
+ RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data.");
+ api_ui_item_rna_common(func);
+ RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
+
+ func= RNA_def_function(srna, "template_waveform", "uiTemplateWaveform");
+ RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data.");
+ api_ui_item_rna_common(func);
+ RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
+
+ func= RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope");
+ RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data.");
api_ui_item_rna_common(func);
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
@@ -345,12 +365,12 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "template_color_wheel", "uiTemplateColorWheel");
+ RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors.");
api_ui_item_rna_common(func);
RNA_def_boolean(func, "value_slider", 0, "", "Display the value slider to the right of the color wheel");
RNA_def_boolean(func, "lock", 0, "", "Lock the color wheel display to value 1.0 regardless of actual color");
-
- func= RNA_def_function(srna, "template_triColorSet", "uiTemplateTriColorSet");
- api_ui_item_rna_common(func);
+ RNA_def_boolean(func, "lock_luminosity", 0, "", "Keep the color at its original vector length");
+ RNA_def_boolean(func, "cubic", 1, "", "Cubic saturation for picking values close to white");
func= RNA_def_function(srna, "template_image_layers", "uiTemplateImageLayers");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
@@ -360,6 +380,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "template_image", "uiTemplateImage");
+ RNA_def_function_ui_description(func, "Item(s). User interface for selecting images and their source paths.");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
parm= RNA_def_pointer(func, "image_user", "ImageUser", "", "");
@@ -367,6 +388,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_boolean(func, "compact", 0, "", "Use more compact layout.");
func= RNA_def_function(srna, "template_list", "uiTemplateList");
+ RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups.");
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);
@@ -390,10 +412,6 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "operator", "Operator", "", "");
- RNA_def_property_flag(parm, PROP_REQUIRED);
-
-
func= RNA_def_function(srna, "introspect", "uiLayoutIntrospect");
parm= RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR");
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 6b78ddaeae1..632d8c1be29 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -32,6 +32,7 @@
#include "DNA_curve_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
+#include "DNA_brush_types.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -50,6 +51,7 @@
#include "BKE_global.h"
#include "MEM_guardedalloc.h"
+#include "MEM_CacheLimiterC-Api.h"
static void rna_userdef_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -170,6 +172,11 @@ static void rna_UserDef_audio_update(Main *bmain, Scene *scene, PointerRNA *ptr)
sound_init(bmain);
}
+static void rna_Userdef_memcache_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
+}
+
static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Object *ob;
@@ -250,12 +257,14 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "shadx", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "shadow_offset_x", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "shadx");
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "shady", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "shady");
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -286,21 +295,21 @@ 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_NONE);
+ prop= RNA_def_property(srna, "panel_title", 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_NONE);
+ prop= RNA_def_property(srna, "group_label", 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_NONE);
+ prop= RNA_def_property(srna, "widget_label", 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");
@@ -355,7 +364,7 @@ static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Text Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "shaded", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1);
RNA_def_property_ui_text(prop, "Shaded", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -524,6 +533,13 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
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_progress", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "wcol_progress");
+ RNA_def_property_struct_type(prop, "ThemeWidgetColors");
+ RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
@@ -671,6 +687,11 @@ static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Edge Sharp", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop= RNA_def_property(srna, "edge_crease", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Edge Crease", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
@@ -786,6 +807,12 @@ static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurb
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Align handle selected color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop= RNA_def_property(srna, "lastsel_point", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "lastsel_point");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Last selected point", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
}
static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
@@ -849,7 +876,7 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Transform", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
-
+
rna_def_userdef_theme_spaces_vertex(srna);
rna_def_userdef_theme_spaces_edge(srna);
rna_def_userdef_theme_spaces_face(srna);
@@ -1145,7 +1172,7 @@ static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
prop= RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "syntaxb");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Syntax Builtin", "");
+ RNA_def_property_ui_text(prop, "Syntax Built-in", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR);
@@ -1186,7 +1213,7 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
rna_def_userdef_theme_spaces_main(srna, SPACE_NODE);
- prop= RNA_def_property(srna, "wires", PROP_FLOAT, PROP_COLOR);
+ prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "wire");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Wires", "");
@@ -1603,10 +1630,10 @@ static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Normal", "Color used for the surface of bones");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "selected", PROP_FLOAT, PROP_COLOR);
+ prop= RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "select");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Selected", "Color used for selected bones");
+ RNA_def_property_ui_text(prop, "Select", "Color used for selected bones");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR);
@@ -1614,7 +1641,7 @@ static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Active", "Color used for active bones");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "colored_constraints", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_colored_constraints", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TH_WIRECOLOR_CONSTCOLS);
RNA_def_property_ui_text(prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -1818,7 +1845,7 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SolidLight");
RNA_def_struct_ui_text(srna, "Solid Light", "Light used for OpenGL lighting in solid draw mode");
- prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode");
RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
@@ -1863,21 +1890,21 @@ static void rna_def_userdef_view(BlenderRNA *brna)
/* View */
/* display */
- prop= RNA_def_property(srna, "tooltips", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);
RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips");
- prop= RNA_def_property(srna, "display_object_info", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "global_scene", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL);
RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "use_large_cursors", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0);
RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -1897,7 +1924,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* menus */
- prop= RNA_def_property(srna, "open_mouse_over", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);
RNA_def_property_ui_text(prop, "Open On Mouse Over", "Open menu buttons and pulldowns automatically when the mouse is hovering");
@@ -1922,37 +1949,33 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_range(prop, 1, 40);
RNA_def_property_ui_text(prop, "Hold RMB Open Toolbox Delay", "Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox");
- prop= RNA_def_property(srna, "pin_floating_panels", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PANELPINNED);
- RNA_def_property_ui_text(prop, "Pin Floating Panels", "Make floating panels invoked by a hotkey (eg. N Key) open at the previous location");
-
- prop= RNA_def_property(srna, "use_column_layout", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS);
RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox");
- prop= RNA_def_property(srna, "directional_menus", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_directional_menus", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
RNA_def_property_ui_text(prop, "Contents Follow Opening Direction", "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction");
- prop= RNA_def_property(srna, "global_pivot", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views");
- prop= RNA_def_property(srna, "auto_depth", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mouse_auto_depth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_ZBUF);
RNA_def_property_ui_text(prop, "Auto Depth", "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
/* view zoom */
- prop= RNA_def_property(srna, "zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
RNA_def_property_ui_text(prop, "Zoom To Mouse Position", "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center");
/* view rotation */
- prop= RNA_def_property(srna, "auto_perspective", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
RNA_def_property_ui_text(prop, "Auto Perspective", "Automatically switch between orthographic and perspective when changing from top/front/side views");
- prop= RNA_def_property(srna, "rotate_around_selection", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point");
@@ -1974,20 +1997,6 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- /* middle mouse button */
- prop= RNA_def_property(srna, "use_middle_mouse_paste", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MMB_PASTE);
- RNA_def_property_ui_text(prop, "Middle Mouse Paste", "In text window, paste with middle mouse button instead of panning");
-
- prop= RNA_def_property(srna, "wheel_invert_zoom", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
- RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
-
- prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "wheellinescroll");
- RNA_def_property_range(prop, 0, 32);
- RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "The number of lines scrolled at a time with the mouse wheel");
-
prop= RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "smooth_viewtx");
RNA_def_property_range(prop, 0, 1000);
@@ -1999,7 +2008,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Rotation Angle", "The rotation step for numerical pad keys (2 4 6 8)");
/* 3D transform widget */
- prop= RNA_def_property(srna, "use_manipulator", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", 1);
RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -2028,7 +2037,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* View2D Grid Displays */
- prop= RNA_def_property(srna, "view2d_grid_minimum_spacing", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize");
RNA_def_property_range(prop, 1, 500); // XXX: perhaps the lower range should only go down to 5?
RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing", "Minimum number of pixels between each gridline in 2D Viewports");
@@ -2059,8 +2068,8 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
{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, "WORLD", 0, "World", "Align newly added objects to the world coordinates"},
+ {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
@@ -2078,13 +2087,13 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
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");
+ RNA_def_property_ui_text(prop, "Align Object To", "When adding objects from a 3D View menu, either align them to that view's direction or the world coordinates");
- prop= RNA_def_property(srna, "enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, "drag_immediately", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_drag_immediately", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELEASECONFIRM);
RNA_def_property_ui_text(prop, "Release confirm", "Moving things with a mouse drag confirms when releasing the button");
@@ -2099,43 +2108,31 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 32767);
RNA_def_property_ui_text(prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
- prop= RNA_def_property(srna, "global_undo", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
RNA_def_property_ui_text(prop, "Global Undo", "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory");
- /* snapping */
- prop= RNA_def_property(srna, "snap_translate", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOGRABGRID);
- RNA_def_property_ui_text(prop, "Enable Translation Snap", "Snap objects and sub-objects to grid units when moving");
-
- prop= RNA_def_property(srna, "snap_rotate", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOROTGRID);
- RNA_def_property_ui_text(prop, "Enable Rotation Snap", "Snap objects and sub-objects to grid units when rotating");
-
- prop= RNA_def_property(srna, "snap_scale", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSIZEGRID);
- RNA_def_property_ui_text(prop, "Enable Scaling Snap", "Snap objects and sub-objects to grid units when scaling");
-
/* auto keyframing */
prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
RNA_def_property_ui_text(prop, "Auto Keying Enable", "Automatic keyframe insertion for Objects and Bones");
+ RNA_def_property_ui_icon(prop, ICON_REC, 0);
prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, auto_key_modes);
RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL);
RNA_def_property_ui_text(prop, "Auto Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
- prop= RNA_def_property(srna, "auto_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available curves");
- prop= RNA_def_property(srna, "auto_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set");
/* keyframing settings */
- prop= RNA_def_property(srna, "keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED);
RNA_def_property_ui_text(prop, "Keyframe Insert Needed", "Keyframe insertion only when keyframe needed");
@@ -2143,7 +2140,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY);
RNA_def_property_ui_text(prop, "Visual Keying", "Use Visual keying automatically for constrained objects");
- prop= RNA_def_property(srna, "insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB);
RNA_def_property_ui_text(prop, "New F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis");
@@ -2173,11 +2170,11 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance", "Distance moved by mouse when drawing stroke (in pixels) to include");
- prop= RNA_def_property(srna, "grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
RNA_def_property_ui_text(prop, "Grease Pencil Smooth Stroke", "Smooth the final stroke");
- prop= RNA_def_property(srna, "grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke");
@@ -2185,54 +2182,61 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "gp_eraser");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'");
-
+
+ /* sculpt and paint */
+
+ prop= RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "sculpt_paint_overlay_col");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Sculpt/Paint Overlay Color", "Color of texture overlay");
+
/* duplication linking */
- prop= RNA_def_property(srna, "duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH);
RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object");
- prop= RNA_def_property(srna, "duplicate_surface", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF);
RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object");
- prop= RNA_def_property(srna, "duplicate_curve", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE);
RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object");
- prop= RNA_def_property(srna, "duplicate_text", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_text", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT);
RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object");
- prop= RNA_def_property(srna, "duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL);
RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object");
- prop= RNA_def_property(srna, "duplicate_armature", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM);
RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object");
- prop= RNA_def_property(srna, "duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP);
RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object");
- prop= RNA_def_property(srna, "duplicate_material", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT);
RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object");
- prop= RNA_def_property(srna, "duplicate_texture", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
// xxx
- prop= RNA_def_property(srna, "duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object");
// xxx
- prop= RNA_def_property(srna, "duplicate_action", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object");
- prop= RNA_def_property(srna, "duplicate_particle", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS);
RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
}
@@ -2356,7 +2360,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
/* Language */
- prop= RNA_def_property(srna, "international_fonts", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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");
@@ -2372,6 +2376,11 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_range(prop, 32, 32768);
RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
+ prop= RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "author");
+ RNA_def_property_string_maxlength(prop, 80);
+ RNA_def_property_ui_text(prop, "Author", "Name that will be used in exported files when format supports such feature");
+
/* Language Selection */
prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
@@ -2379,17 +2388,17 @@ static void rna_def_userdef_system(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "use_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);
+ prop= RNA_def_property(srna, "use_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);
+ prop= RNA_def_property(srna, "use_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");
@@ -2423,16 +2432,16 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
- prop= RNA_def_property(srna, "enable_all_codecs", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
RNA_def_property_ui_text(prop, "Enable All Codecs", "Enables automatic saving of preview images in the .blend file (Windows only)");
- prop= RNA_def_property(srna, "auto_execute_scripts", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
RNA_def_property_ui_text(prop, "Auto Run Python Scripts", "Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source)");
RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
- prop= RNA_def_property(srna, "tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces for new and loaded text files");
@@ -2445,13 +2454,14 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
RNA_def_property_range(prop, 0, (sizeof(void *) ==8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit in sequencer (megabytes)");
+ RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
prop= RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frameserverport");
RNA_def_property_range(prop, 0, 32727);
- RNA_def_property_ui_text(prop, "Frame Server Port", "Frameserver Port for Framserver-Rendering");
+ RNA_def_property_ui_text(prop, "Frame Server Port", "Frameserver Port for Frameserver Rendering");
- prop= RNA_def_property(srna, "clip_alpha", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
@@ -2462,7 +2472,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)");
RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
- prop= RNA_def_property(srna, "use_vbos", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
@@ -2580,26 +2590,26 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL);
RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection");
- prop= RNA_def_property(srna, "zoom_style", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
RNA_def_property_enum_items(prop, view_zoom_styles);
RNA_def_property_ui_text(prop, "Zoom Style", "Which style to use for viewport scaling");
- prop= RNA_def_property(srna, "zoom_axis", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag");
RNA_def_property_enum_items(prop, view_zoom_axes);
RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
- prop= RNA_def_property(srna, "invert_zoom_direction", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "invert_mouse_wheel_zoom", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT);
RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
- prop= RNA_def_property(srna, "view_rotation", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, view_rotation_items);
RNA_def_property_ui_text(prop, "View Rotation", "Rotation style in the viewport");
- prop= RNA_def_property(srna, "continuous_mouse", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
@@ -2613,18 +2623,38 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 200);
RNA_def_property_ui_text(prop, "NDof Rotation Speed", "The overall rotation speed of an NDOF device, as percent of standard");
- prop= RNA_def_property(srna, "double_click_time", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dbl_click_time");
RNA_def_property_range(prop, 1, 1000);
RNA_def_property_ui_text(prop, "Double Click Timeout", "The time (in ms) for a double click");
- prop= RNA_def_property(srna, "emulate_3_button_mouse", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
- RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse", "Emulates Middle Mouse with Alt+LeftMouse (doesnt work with Left Mouse Select option)");
+ RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse", "Emulates Middle Mouse with Alt+LeftMouse (doesn't work with Left Mouse Select option)");
- prop= RNA_def_property(srna, "emulate_numpad", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD);
RNA_def_property_ui_text(prop, "Emulate Numpad", "Causes the 1 to 0 keys to act as the numpad (useful for laptops)");
+
+ /* middle mouse button */
+ prop= RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MMB_PASTE);
+ RNA_def_property_ui_text(prop, "Middle Mouse Paste", "In text window, paste with middle mouse button instead of panning");
+
+ prop= RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
+ RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
+
+ prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "wheellinescroll");
+ RNA_def_property_range(prop, 0, 32);
+ RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "The number of lines scrolled at a time with the mouse wheel");
+
+ /* U.keymaps - custom keymaps that have been edited from default configs */
+ prop= RNA_def_property(srna, "edited_keymaps", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "keymaps", NULL);
+ RNA_def_property_struct_type(prop, "KeyMap");
+ RNA_def_property_ui_text(prop, "Edited Keymaps", "");
}
static void rna_def_userdef_filepaths(BlenderRNA *brna)
@@ -2647,11 +2677,11 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "show_hidden_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);
+ prop= RNA_def_property(srna, "use_filter_files", 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");
@@ -2659,19 +2689,19 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
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");
- prop= RNA_def_property(srna, "compress_file", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files");
- prop= RNA_def_property(srna, "load_ui", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_load_ui", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_FILENOUI);
RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
- prop= RNA_def_property(srna, "fonts_directory", PROP_STRING, PROP_DIRPATH);
+ prop= RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "fontdir");
RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts");
- prop= RNA_def_property(srna, "textures_directory", PROP_STRING, PROP_DIRPATH);
+ prop= RNA_def_property(srna, "texture_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "textudir");
RNA_def_property_ui_text(prop, "Textures Directory", "The default directory to search for textures");
@@ -2687,11 +2717,11 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "renderdir");
RNA_def_property_ui_text(prop, "Render Output Directory", "The default directory for rendering output");
- prop= RNA_def_property(srna, "python_scripts_directory", PROP_STRING, PROP_DIRPATH);
+ prop= RNA_def_property(srna, "script_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "pythondir");
RNA_def_property_ui_text(prop, "Python Scripts Directory", "The default directory to search for Python scripts (resets python module search path: sys.path)");
- prop= RNA_def_property(srna, "sounds_directory", PROP_STRING, PROP_DIRPATH);
+ prop= RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "sounddir");
RNA_def_property_ui_text(prop, "Sounds Directory", "The default directory to search for sounds");
@@ -2721,7 +2751,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 32);
RNA_def_property_ui_text(prop, "Save Versions", "The number of old versions to maintain in the current directory, when manually saving");
- prop= RNA_def_property(srna, "auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSAVE);
RNA_def_property_ui_text(prop, "Auto Save Temporary Files", "Automatic saving of temporary files");
RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
@@ -2736,7 +2766,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember");
- prop= RNA_def_property(srna, "save_preview_images", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS);
RNA_def_property_ui_text(prop, "Save Preview Images", "Enables automatic saving of preview images in the .blend file");
}
@@ -2762,7 +2792,7 @@ void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_NO_SELF);
RNA_def_function_ui_description(func, "Remove addon.");
parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_def_userdef(BlenderRNA *brna)
@@ -2798,7 +2828,7 @@ void RNA_def_userdef(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Theme");
RNA_def_property_ui_text(prop, "Themes", "");
- prop= RNA_def_property(srna, "uistyles", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "ui_styles", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "uistyles", NULL);
RNA_def_property_struct_type(prop, "ThemeStyle");
RNA_def_property_ui_text(prop, "Styles", "");
@@ -2814,31 +2844,31 @@ void RNA_def_userdef(BlenderRNA *brna)
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_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data");
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_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data");
prop= RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesInput");
- RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices");
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_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files");
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_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings");
rna_def_userdef_view(brna);
@@ -2851,4 +2881,3 @@ void RNA_def_userdef(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_vfont.c b/source/blender/makesrna/intern/rna_vfont.c
index 1f8be906eb3..41387e806b9 100644
--- a/source/blender/makesrna/intern/rna_vfont.c
+++ b/source/blender/makesrna/intern/rna_vfont.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * Contributor(s): Blender Foundation (2008), Juho Vepsäläinen
+ * Contributor(s): Blender Foundation (2008), Juho Vepsäläinen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -44,10 +44,10 @@ void RNA_def_vfont(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "VFont");
RNA_def_struct_ui_icon(srna, ICON_FILE_FONT);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Filename", "");
+ RNA_def_property_ui_text(prop, "File Path", "");
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index b8d8a5ab790..d13e4f9f616 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -114,6 +114,7 @@ EnumPropertyItem event_type_items[] = {
{SELECTMOUSE, "SELECTMOUSE", 0, "Select Mouse", ""},
{0, "", 0, NULL, NULL},
{MOUSEMOVE, "MOUSEMOVE", 0, "Mouse Move", ""},
+ {INBETWEEN_MOUSEMOVE, "INBETWEEN_MOUSEMOVE", 0, "Inbetween Move", ""},
{MOUSEPAN, "TRACKPADPAN", 0, "Mouse/Trackpad Pan", ""},
{MOUSEZOOM, "TRACKPADZOOM", 0, "Mouse/Trackpad Zoom", ""},
{MOUSEROTATE, "MOUSEROTATE", 0, "Mouse/Trackpad Rotate", ""},
@@ -226,6 +227,13 @@ EnumPropertyItem event_type_items[] = {
{F10KEY, "F10", 0, "F10", ""},
{F11KEY, "F11", 0, "F11", ""},
{F12KEY, "F12", 0, "F12", ""},
+ {F13KEY, "F13", 0, "F13", ""},
+ {F14KEY, "F14", 0, "F14", ""},
+ {F15KEY, "F15", 0, "F15", ""},
+ {F16KEY, "F16", 0, "F16", ""},
+ {F17KEY, "F17", 0, "F17", ""},
+ {F18KEY, "F18", 0, "F18", ""},
+ {F19KEY, "F19", 0, "F19", ""},
{PAUSEKEY, "PAUSE", 0, "Pause", ""},
{INSERTKEY, "INSERT", 0, "Insert", ""},
{HOMEKEY, "HOME", 0, "Home", ""},
@@ -316,7 +324,7 @@ static StructRNA *rna_OperatorProperties_refine(PointerRNA *ptr)
return ptr->type;
}
-static IDProperty *rna_OperatorProperties_idproperties(PointerRNA *ptr, int create)
+static IDProperty *rna_OperatorProperties_idprops(PointerRNA *ptr, int create)
{
if(create && !ptr->data) {
IDPropertyTemplate val = {0};
@@ -353,7 +361,7 @@ static PointerRNA rna_Operator_properties_get(PointerRNA *ptr)
static PointerRNA rna_OperatorTypeMacro_properties_get(PointerRNA *ptr)
{
wmOperatorTypeMacro *otmacro= (wmOperatorTypeMacro*)ptr->data;
- wmOperatorType *ot = WM_operatortype_exists(otmacro->idname);
+ wmOperatorType *ot = WM_operatortype_find(otmacro->idname, TRUE);
return rna_pointer_inherit_refine(ptr, ot->srna, otmacro->properties);
}
@@ -604,6 +612,34 @@ static int rna_wmKeyMapItem_name_length(PointerRNA *ptr)
return 0;
}
+static void rna_wmClipboard_get(PointerRNA *ptr, char *value)
+{
+ char *pbuf;
+
+ pbuf= WM_clipboard_text_get(FALSE);
+ strcpy(value, pbuf);
+
+ MEM_freeN(pbuf);
+}
+
+static int rna_wmClipboard_length(PointerRNA *ptr)
+{
+ char *clipboard;
+ int length;
+
+ clipboard = WM_clipboard_text_get(FALSE);
+ length = (clipboard?strlen(clipboard):0);
+ MEM_freeN(clipboard);
+
+ return length;
+}
+
+static void rna_wmClipboard_set(PointerRNA *ptr, const char *value)
+{
+ WM_clipboard_text_set((void *) value, FALSE);
+}
+
+#ifndef DISABLE_PYTHON
static void rna_Operator_unregister(const bContext *C, StructRNA *type)
{
char *idname;
@@ -739,7 +775,6 @@ static void operator_draw(bContext *C, wmOperator *op)
RNA_parameter_list_free(&list);
}
-#ifndef DISABLE_PYTHON
void operator_wrapper(wmOperatorType *ot, void *userdata);
void macro_wrapper(wmOperatorType *ot, void *userdata);
@@ -788,7 +823,7 @@ static StructRNA *rna_Operator_register(const bContext *C, ReportList *reports,
/* check if we have registered this operator type before, and remove it */
{
- wmOperatorType *ot= WM_operatortype_exists(dummyot.idname);
+ wmOperatorType *ot= WM_operatortype_find(dummyot.idname, TRUE);
if(ot && ot->ext.srna)
rna_Operator_unregister(C, ot->ext.srna);
}
@@ -857,7 +892,7 @@ static StructRNA *rna_MacroOperator_register(const bContext *C, ReportList *repo
/* check if we have registered this operator type before, and remove it */
{
- wmOperatorType *ot= WM_operatortype_exists(dummyot.idname);
+ wmOperatorType *ot= WM_operatortype_find(dummyot.idname, TRUE);
if(ot && ot->ext.srna)
rna_Operator_unregister(C, ot->ext.srna);
}
@@ -879,7 +914,7 @@ static StructRNA *rna_MacroOperator_register(const bContext *C, ReportList *repo
return dummyot.ext.srna;
}
-#endif
+#endif /* DISABLE_PYTHON */
static StructRNA* rna_Operator_refine(PointerRNA *opr)
{
@@ -953,7 +988,7 @@ static wmKeyMapItem *rna_KeyMap_add_modal_item(wmKeyMap *km, bContext *C, Report
return WM_modalkeymap_add_item(km, type, value, modifier, keymodifier, propvalue);
}
-#else
+#else /* RNA_RUNTIME */
static void rna_def_operator(BlenderRNA *brna)
{
@@ -972,13 +1007,12 @@ static void rna_def_operator(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "");
- RNA_def_struct_name_property(srna, prop);
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);
+ RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "has_reports", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* this is 'virtual' property */
@@ -993,6 +1027,7 @@ static void rna_def_operator(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */
RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
@@ -1015,7 +1050,7 @@ static void rna_def_operator(BlenderRNA *brna)
srna= RNA_def_struct(brna, "OperatorProperties", NULL);
RNA_def_struct_ui_text(srna, "Operator Properties", "Input properties of an Operator");
RNA_def_struct_refine_func(srna, "rna_OperatorProperties_refine");
- RNA_def_struct_idproperties_func(srna, "rna_OperatorProperties_idproperties");
+ RNA_def_struct_idprops_func(srna, "rna_OperatorProperties_idprops");
}
static void rna_def_macro_operator(BlenderRNA *brna)
@@ -1035,19 +1070,19 @@ static void rna_def_macro_operator(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "");
- RNA_def_struct_name_property(srna, prop);
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);
+ RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL, NULL);
/* Registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */
RNA_def_property_flag(prop, PROP_REGISTER);
+ RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
@@ -1087,7 +1122,7 @@ static void rna_def_operator_type_macro(BlenderRNA *brna)
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_OperatorTypeMacro_properties_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_OperatorTypeMacro_properties_get", NULL, NULL, NULL);
}
static void rna_def_operator_utils(BlenderRNA *brna)
@@ -1224,11 +1259,50 @@ static void rna_def_window(BlenderRNA *brna)
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);
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, 0, "rna_Window_screen_update");
}
+/* curve.splines */
+static void rna_def_wm_keyconfigs(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ //FunctionRNA *func;
+ //PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "KeyConfigurations");
+ srna= RNA_def_struct(brna, "KeyConfigurations", NULL);
+ RNA_def_struct_sdna(srna, "wmWindowManager");
+ RNA_def_struct_ui_text(srna, "KeyConfigs", "Collection of KeyConfigs");
+/*
+ func= RNA_def_function(srna, "new", "rna_Curve_spline_new");
+ RNA_def_function_ui_description(func, "Add a new spline to the curve.");
+ parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+*/
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "KeyConfig");
+ RNA_def_property_pointer_funcs(prop, "rna_WindowManager_active_keyconfig_get", "rna_WindowManager_active_keyconfig_set", NULL, NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Active KeyConfig", "Active wm KeyConfig");
+
+ prop= RNA_def_property(srna, "default", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "defaultconf");
+ RNA_def_property_struct_type(prop, "KeyConfig");
+ RNA_def_property_ui_text(prop, "Default Key Configuration", "");
+}
+
static void rna_def_windowmanager(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1250,17 +1324,11 @@ static void rna_def_windowmanager(BlenderRNA *brna)
prop= RNA_def_property(srna, "keyconfigs", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyConfig");
RNA_def_property_ui_text(prop, "Key Configurations", "Registered key configurations");
+ rna_def_wm_keyconfigs(brna, prop);
- prop= RNA_def_property(srna, "active_keyconfig", PROP_POINTER, PROP_NEVER_NULL);
- RNA_def_property_struct_type(prop, "KeyConfig");
- RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_pointer_funcs(prop, "rna_WindowManager_active_keyconfig_get", "rna_WindowManager_active_keyconfig_set", 0);
- RNA_def_property_ui_text(prop, "Active Key Configuration", "");
-
- prop= RNA_def_property(srna, "default_keyconfig", PROP_POINTER, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "defaultconf");
- RNA_def_property_struct_type(prop, "KeyConfig");
- RNA_def_property_ui_text(prop, "Default Key Configuration", "");
+ prop= RNA_def_property(srna, "clipboard", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_funcs(prop, "rna_wmClipboard_get", "rna_wmClipboard_length", "rna_wmClipboard_set");
+ RNA_def_property_ui_text(prop, "Text Clipboard", "");
RNA_api_wm(srna);
}
@@ -1340,15 +1408,11 @@ static void rna_def_keyconfig(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "Name of the key configuration");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "filter", PROP_STRING, PROP_NONE);
- RNA_def_property_string_sdna(prop, NULL, "filter");
- RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
-
prop= RNA_def_property(srna, "keymaps", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyMap");
RNA_def_property_ui_text(prop, "Key Maps", "Key maps configured as part of this configuration");
- prop= RNA_def_property(srna, "user_defined", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYCONF_USER);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "User Defined", "Indicates that a keyconfig was defined by the user");
@@ -1383,21 +1447,21 @@ static void rna_def_keyconfig(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Items", "Items in the keymap, linking an operator to an input event");
rna_def_keymap_items(brna, prop);
- prop= RNA_def_property(srna, "user_defined", PROP_BOOLEAN, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NEVER_NULL);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_USER);
RNA_def_property_ui_text(prop, "User Defined", "Keymap is defined by the user");
- prop= RNA_def_property(srna, "modal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "is_modal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_MODAL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Modal Keymap", "Indicates that a keymap is used for translate modal events for an operator");
- prop= RNA_def_property(srna, "items_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_expanded_items", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_EXPANDED);
RNA_def_property_ui_text(prop, "Items Expanded", "Expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
- prop= RNA_def_property(srna, "children_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_expanded_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_CHILDREN_EXPANDED);
RNA_def_property_ui_text(prop, "Children Expanded", "Children expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
@@ -1423,7 +1487,7 @@ static void rna_def_keyconfig(BlenderRNA *brna)
prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "OperatorProperties");
- RNA_def_property_pointer_funcs(prop, "rna_KeyMapItem_properties_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_KeyMapItem_properties_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Properties", "Properties to set when the operator is called");
prop= RNA_def_property(srna, "map_type", PROP_ENUM, PROP_NONE);
@@ -1482,7 +1546,7 @@ static void rna_def_keyconfig(BlenderRNA *brna)
RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_ui_text(prop, "Key Modifier", "Regular key pressed as a modifier");
- prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KMI_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "Show key map event and property details in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
@@ -1514,5 +1578,5 @@ void RNA_def_wm(BlenderRNA *brna)
rna_def_keyconfig(brna);
}
-#endif
+#endif /* RNA_RUNTIME */
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 5df35ed4210..0f72cfa8b9d 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -186,7 +186,7 @@ void RNA_api_operator(StructRNA *srna)
/* poll */
func= RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "Test if the operator can be called or not.");
- RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
+ RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
RNA_def_pointer(func, "context", "Context", "", "");
@@ -246,7 +246,7 @@ void RNA_api_macro(StructRNA *srna)
/* poll */
func= RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "Test if the operator can be called or not.");
- RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
+ RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
RNA_def_pointer(func, "context", "Context", "", "");
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index 3b0f53df43b..907042e7453 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -33,6 +33,8 @@
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
+#include "WM_types.h"
+
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
@@ -42,7 +44,6 @@
#include "BKE_texture.h"
#include "WM_api.h"
-#include "WM_types.h"
static PointerRNA rna_World_lighting_get(PointerRNA *ptr)
{
@@ -118,22 +119,22 @@ static void rna_def_world_mtex(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "World Texture Slot", "Texture slot for textures in a World datablock");
/* map to */
- prop= RNA_def_property(srna, "map_blend", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_World_update");
- prop= RNA_def_property(srna, "map_horizon", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_World_update");
- prop= RNA_def_property(srna, "map_zenith_up", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_World_update");
- prop= RNA_def_property(srna, "map_zenith_down", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, 0, "rna_World_update");
@@ -143,7 +144,7 @@ static void rna_def_world_mtex(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_MIST);
RNA_def_property_ui_text(prop, "Mist", "Causes the texture to affect the intensity of the mist");*/
- prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
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");
@@ -226,21 +227,21 @@ static void rna_def_lighting(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "ao_blend_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "ao_blend_type", 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");
/* environment lighting */
- prop= RNA_def_property(srna, "use_environment_lighting", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_environment_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_ENV_LIGHT);
RNA_def_property_ui_text(prop, "Use Environment Lighting", "Add light coming from the environment");
RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "environment_energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_env_energy");
- RNA_def_property_ui_range(prop, 0, FLT_MAX, 0.1, 2);
+ RNA_def_property_ui_range(prop, 0, FLT_MAX, 1, 3);
RNA_def_property_ui_text(prop, "Environment Color", "Defines the strength of environment light");
RNA_def_property_update(prop, 0, "rna_World_update");
@@ -251,7 +252,7 @@ static void rna_def_lighting(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_World_update");
/* indirect lighting */
- prop= RNA_def_property(srna, "use_indirect_lighting", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_indirect_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_INDIRECT_LIGHT);
RNA_def_property_ui_text(prop, "Use Indirect Lighting", "Add indirect light bouncing of surrounding objects");
RNA_def_property_update(prop, 0, "rna_World_update");
@@ -310,7 +311,7 @@ static void rna_def_lighting(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "error_threshold", 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)");
@@ -323,12 +324,12 @@ static void rna_def_lighting(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "use_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);
+ prop= RNA_def_property(srna, "use_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");
@@ -362,9 +363,9 @@ static void rna_def_world_mist(BlenderRNA *brna)
RNA_def_struct_nested(brna, srna, "World");
RNA_def_struct_ui_text(srna, "World Mist", "Mist settings for a World data-block");
- prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mist", 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_ui_text(prop, "Use Mist", "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);
@@ -410,9 +411,9 @@ static void rna_def_world_stars(BlenderRNA *brna)
RNA_def_struct_nested(brna, srna, "World");
RNA_def_struct_ui_text(srna, "World Stars", "Stars setting for a World data-block");
- prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stars", 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_ui_text(prop, "Use Stars", "Enable starfield generation");
RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
@@ -421,7 +422,7 @@ static void rna_def_world_stars(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_DISTANCE);
+ prop= RNA_def_property(srna, "distance_min", 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");
@@ -433,7 +434,7 @@ static void rna_def_world_stars(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Average Separation", "Average distance between any two stars");
RNA_def_property_update(prop, 0, "rna_World_draw_update");
- prop= RNA_def_property(srna, "color_randomization", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "color_random", 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");
@@ -476,7 +477,11 @@ void RNA_def_world(BlenderRNA *brna)
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, 0, "rna_World_update");
+ /* RNA_def_property_update(prop, 0, "rna_World_update"); */
+ /* render-only uses this, the notifier could be made to be more spesific */
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_World_update");
+
+
prop= RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "zenr");
@@ -497,45 +502,45 @@ void RNA_def_world(BlenderRNA *brna)
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);
+ prop= RNA_def_property(srna, "color_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);
+ prop= RNA_def_property(srna, "use_sky_blend", 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, 0, "rna_World_update");
- prop= RNA_def_property(srna, "paper_sky", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_sky_paper", 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, 0, "rna_World_update");
- prop= RNA_def_property(srna, "real_sky", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_sky_real", 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, 0, "rna_World_update");
/* nested structs */
- prop= RNA_def_property(srna, "lighting", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "light_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldLighting");
- RNA_def_property_pointer_funcs(prop, "rna_World_lighting_get", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_World_lighting_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Lighting", "World lighting settings");
- prop= RNA_def_property(srna, "mist", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "mist_settings", 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_pointer_funcs(prop, "rna_World_mist_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Mist", "World mist settings");
- prop= RNA_def_property(srna, "stars", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "star_settings", 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_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Stars", "World stars settings");
rna_def_lighting(brna);