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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-07 22:22:48 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-07 22:22:48 +0300
commit82ddfbf99fc0776a7fe439b81cf71bab87ceaaf9 (patch)
treefb1eda53eeeab12b093f5178693923b606708b05 /source/blender/makesrna/intern
parent4ca2581b77112c488938f0a2dc226042e0390b71 (diff)
parentfc69c54c4ce810e6236eaa45017130f27ba3f1e2 (diff)
Sculpt Branch:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r24889:25180
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/makesrna.c4
-rw-r--r--source/blender/makesrna/intern/rna_ID.c3
-rw-r--r--source/blender/makesrna/intern/rna_access.c171
-rw-r--r--source/blender/makesrna/intern/rna_action.c125
-rw-r--r--source/blender/makesrna/intern/rna_armature.c65
-rw-r--r--source/blender/makesrna/intern/rna_armature_api.c66
-rw-r--r--source/blender/makesrna/intern/rna_brush.c2
-rw-r--r--source/blender/makesrna/intern/rna_color.c4
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c165
-rw-r--r--source/blender/makesrna/intern/rna_curve.c66
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c42
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c2
-rw-r--r--source/blender/makesrna/intern/rna_group.c2
-rw-r--r--source/blender/makesrna/intern/rna_internal.h1
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c39
-rw-r--r--source/blender/makesrna/intern/rna_material.c2
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c3
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c10
-rw-r--r--source/blender/makesrna/intern/rna_object.c117
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c2
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c4
-rw-r--r--source/blender/makesrna/intern/rna_particle.c1
-rw-r--r--source/blender/makesrna/intern/rna_pose.c2
-rw-r--r--source/blender/makesrna/intern/rna_rna.c2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c146
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c8
-rw-r--r--source/blender/makesrna/intern/rna_sequence.c8
-rw-r--r--source/blender/makesrna/intern/rna_space.c130
-rw-r--r--source/blender/makesrna/intern/rna_texture.c33
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c30
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c50
-rw-r--r--source/blender/makesrna/intern/rna_wm.c64
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c15
-rw-r--r--source/blender/makesrna/intern/rna_world.c11
34 files changed, 1065 insertions, 330 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 3d4e128c3ac..037b866edba 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -1430,7 +1430,7 @@ static const char *rna_property_subtypename(PropertyType type)
case PROP_VELOCITY: return "PROP_VELOCITY";
case PROP_ACCELERATION: return "PROP_ACCELERATION";
case PROP_XYZ: return "PROP_XYZ";
- case PROP_RGB: return "PROP_RGB";
+ case PROP_COLOR_GAMMA: return "PROP_COLOR_GAMMA";
case PROP_LAYER: return "PROP_LAYER";
case PROP_LAYER_MEMBER: return "PROP_LAYER_MEMBER";
default: {
@@ -1984,7 +1984,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_actuator.c", NULL, RNA_def_actuator},
- {"rna_armature.c", NULL, RNA_def_armature},
+ {"rna_armature.c", "rna_armature_api.c", RNA_def_armature},
{"rna_boid.c", NULL, RNA_def_boid},
{"rna_brush.c", NULL, RNA_def_brush},
{"rna_camera.c", NULL, RNA_def_camera},
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index cb1a1211d24..3bcdf373c43 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -31,6 +31,8 @@
#include "DNA_ID.h"
+#include "WM_types.h"
+
#include "rna_internal.h"
/* enum of ID-block types
@@ -301,6 +303,7 @@ static void rna_def_ID(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name.");
RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set");
RNA_def_property_string_maxlength(prop, sizeof(((ID*)NULL)->name)-2);
+ RNA_def_property_update(prop, NC_ID|ND_ID_RENAME, NULL);
RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED);
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 669810bb39b..360f43428d1 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include "MEM_guardedalloc.h"
@@ -692,10 +693,58 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index)
return quatitem[index];
else if((index < 4) && ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
return vectoritem[index];
- else if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_RGB))
+ else if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA))
return coloritem[index];
- else
- return '\0';
+
+ return '\0';
+}
+
+int RNA_property_array_item_index(PropertyRNA *prop, char name)
+{
+ PropertySubType subtype= rna_ensure_property(prop)->subtype;
+
+ name= toupper(name);
+
+ /* get index based on string name/alias */
+ /* maybe a function to find char index in string would be better than all the switches */
+ if (ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE)) {
+ switch (name) {
+ case 'W':
+ return 0;
+ case 'X':
+ return 1;
+ case 'Y':
+ return 2;
+ case 'Z':
+ return 3;
+ }
+ }
+ else if(ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION)) {
+ switch (name) {
+ case 'X':
+ return 0;
+ case 'Y':
+ return 1;
+ case 'Z':
+ return 2;
+ case 'W':
+ return 3;
+ }
+ }
+ else if (ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) {
+ switch (name) {
+ case 'R':
+ return 0;
+ case 'G':
+ return 1;
+ case 'B':
+ return 2;
+ case 'A':
+ return 3;
+ }
+ }
+
+ return -1;
}
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
@@ -923,6 +972,18 @@ int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **id
return 0;
}
+int RNA_enum_bitflag_identifiers(EnumPropertyItem *item, const int value, const char **identifier)
+{
+ int index= 0;
+ for (; item->identifier; item++) {
+ if(item->identifier[0] && item->value & value) {
+ identifier[index++] = item->identifier;
+ }
+ }
+ identifier[index]= NULL;
+ return index;
+}
+
int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name)
{
for (; item->identifier; item++) {
@@ -950,6 +1011,22 @@ int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop
return 0;
}
+int RNA_property_enum_bitflag_identifiers(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
+{
+ EnumPropertyItem *item= NULL;
+ int result, free;
+
+ RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
+ if(item) {
+ result= RNA_enum_bitflag_identifiers(item, value, identifier);
+ if(free)
+ MEM_freeN(item);
+
+ return result;
+ }
+ return 0;
+}
+
const char *RNA_property_ui_name(PropertyRNA *prop)
{
return rna_ensure_property_name(prop);
@@ -2446,10 +2523,15 @@ static int rna_token_strip_quotes(char *token)
/* Resolve the given RNA path to find the pointer+property indicated at the end of the path */
int RNA_path_resolve(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
{
+ return RNA_path_resolve_full(ptr, path, r_ptr, r_prop, NULL);
+}
+
+int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *index)
+{
PropertyRNA *prop;
PointerRNA curptr, nextptr;
char fixedbuf[256], *token;
- int len, intkey;
+ int type, len, intkey;
prop= NULL;
curptr= *ptr;
@@ -2484,43 +2566,78 @@ int RNA_path_resolve(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, Prope
if(!prop)
return 0;
+ type= RNA_property_type(prop);
+
/* now look up the value of this property if it is a pointer or
* collection, otherwise return the property rna so that the
* caller can read the value of the property itself */
- if(RNA_property_type(prop) == PROP_POINTER) {
+ switch (type) {
+ case PROP_POINTER:
nextptr= RNA_property_pointer_get(&curptr, prop);
if(nextptr.data)
curptr= nextptr;
else
return 0;
- }
- else if(RNA_property_type(prop) == PROP_COLLECTION && *path) {
- /* resolve the lookup with [] brackets */
- token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
- if(!token)
- return 0;
+ break;
+ case PROP_COLLECTION:
+ if(*path) {
+ /* resolve the lookup with [] brackets */
+ token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
- len= strlen(token);
-
- /* 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);
+ if(!token)
+ return 0;
+
+ len= strlen(token);
+
+ /* 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);
+ }
+
+ if(token != fixedbuf)
+ MEM_freeN(token);
+
+ if(nextptr.data)
+ curptr= nextptr;
+ else
+ return 0;
}
- if(token != fixedbuf)
- MEM_freeN(token);
+ break;
+ default:
+ if (index==NULL)
+ break;
+
+ *index= -1;
- if(nextptr.data)
- curptr= nextptr;
- else
- return 0;
+ if (*path) {
+ if (*path=='[') {
+ token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
+
+ /* check for "" to see if it is a string */
+ if(rna_token_strip_quotes(token)) {
+ *index= RNA_property_array_item_index(prop, *(token+1));
+ }
+ else {
+ /* otherwise do int lookup */
+ *index= atoi(token);
+ }
+ }
+ else {
+ token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 0);
+ *index= RNA_property_array_item_index(prop, *token);
+ }
+
+ if(token != fixedbuf)
+ MEM_freeN(token);
+ }
}
}
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index eaa11b4ad38..3708d810cca 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -34,10 +34,126 @@
#include "MEM_guardedalloc.h"
+#include "WM_types.h"
+
+
#ifdef RNA_RUNTIME
#else
+static void rna_def_dopesheet(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "DopeSheet", NULL);
+ RNA_def_struct_sdna(srna, "bDopeSheet");
+ RNA_def_struct_ui_text(srna, "DopeSheet", "Storage for Dopesheet/Grease-Pencil Editor data.");
+
+ prop= RNA_def_property(srna, "source", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ID");
+ RNA_def_property_ui_text(prop, "Source", "ID-Block representing source data, currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil).");
+
+ prop= RNA_def_property(srna, "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.");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+
+ prop= RNA_def_property(srna, "only_nla", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYNLA);
+ RNA_def_property_ui_text(prop, "Only NLA", "Only include NLA data from Animation data.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+
+ prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_SELEDIT);
+ RNA_def_property_ui_text(prop, "Use Filter", "Indicates if filtering options must be taken into account.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+
+ prop= RNA_def_property(srna, "display_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.");
+ RNA_def_property_ui_icon(prop, ICON_BORDERMOVE, 0);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+
+ prop= RNA_def_property(srna, "display_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);
+
+ prop= RNA_def_property(srna, "display_camera", 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);
+
+ prop= RNA_def_property(srna, "display_material", 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);
+
+ prop= RNA_def_property(srna, "display_lamp", 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);
+
+ prop= RNA_def_property(srna, "display_curve", 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);
+
+ prop= RNA_def_property(srna, "display_world", 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);
+
+ prop= RNA_def_property(srna, "display_scene", 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);
+
+ prop= RNA_def_property(srna, "display_particle", 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);
+
+ prop= RNA_def_property(srna, "display_metaball", 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);
+
+ prop= RNA_def_property(srna, "display_armature", 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);
+
+ prop= RNA_def_property(srna, "display_node", 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);
+
+ prop= RNA_def_property(srna, "include_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.");
+ RNA_def_property_ui_icon(prop, ICON_ACTION, 0);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+
+ prop= RNA_def_property(srna, "collapse_summary", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_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.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+}
+
static void rna_def_action_group(BlenderRNA *brna)
{
StructRNA *srna;
@@ -80,22 +196,22 @@ static void rna_def_action(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
-
+
srna= RNA_def_struct(brna, "Action", "ID");
RNA_def_struct_sdna(srna, "bAction");
RNA_def_struct_ui_text(srna, "Action", "A collection of F-Curves for animation.");
RNA_def_struct_ui_icon(srna, ICON_ACTION);
-
+
prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
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.");
-
+
prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "groups", NULL);
RNA_def_property_struct_type(prop, "ActionGroup");
RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of F-Curves.");
-
+
prop= RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
RNA_def_property_struct_type(prop, "TimelineMarker");
@@ -110,6 +226,7 @@ void RNA_def_action(BlenderRNA *brna)
{
rna_def_action(brna);
rna_def_action_group(brna);
+ rna_def_dopesheet(brna);
}
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 36fd457e173..371f14be753 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -139,19 +139,19 @@ static IDProperty *rna_EditBone_idproperties(PointerRNA *ptr, int create)
return ebone->prop;
}
-static void rna_bone_layer_set(short *layer, const int *values)
+static void rna_bone_layer_set(int *layer, const int *values)
{
int i, tot= 0;
/* ensure we always have some layer selected */
- for(i=0; i<16; i++)
+ for(i=0; i<32; i++)
if(values[i])
tot++;
if(tot==0)
return;
- for(i=0; i<16; i++) {
+ for(i=0; i<32; i++) {
if(values[i]) *layer |= (1<<i);
else *layer &= ~(1<<i);
}
@@ -169,14 +169,14 @@ static void rna_Armature_layer_set(PointerRNA *ptr, const int *values)
int i, tot= 0;
/* ensure we always have some layer selected */
- for(i=0; i<20; i++)
+ for(i=0; i<32; i++)
if(values[i])
tot++;
if(tot==0)
return;
- for(i=0; i<20; i++) {
+ for(i=0; i<32; i++) {
if(values[i]) arm->layer |= (1<<i);
else arm->layer &= ~(1<<i);
}
@@ -236,28 +236,7 @@ static void rna_Bone_name_set(PointerRNA *ptr, const char *value)
ED_armature_bone_rename(arm, oldname, newname);
}
-static void rna_EditBone_layer_get(PointerRNA *ptr, int values[16])
-{
- EditBone *data= (EditBone*)(ptr->data);
- values[0]= ((data->layer & (1<<0)) != 0);
- values[1]= ((data->layer & (1<<1)) != 0);
- values[2]= ((data->layer & (1<<2)) != 0);
- values[3]= ((data->layer & (1<<3)) != 0);
- values[4]= ((data->layer & (1<<4)) != 0);
- values[5]= ((data->layer & (1<<5)) != 0);
- values[6]= ((data->layer & (1<<6)) != 0);
- values[7]= ((data->layer & (1<<7)) != 0);
- values[8]= ((data->layer & (1<<8)) != 0);
- values[9]= ((data->layer & (1<<9)) != 0);
- values[10]= ((data->layer & (1<<10)) != 0);
- values[11]= ((data->layer & (1<<11)) != 0);
- values[12]= ((data->layer & (1<<12)) != 0);
- values[13]= ((data->layer & (1<<13)) != 0);
- values[14]= ((data->layer & (1<<14)) != 0);
- values[15]= ((data->layer & (1<<15)) != 0);
-}
-
-static void rna_EditBone_layer_set(PointerRNA *ptr, const int values[16])
+static void rna_EditBone_layer_set(PointerRNA *ptr, const int values[])
{
EditBone *data= (EditBone*)(ptr->data);
rna_bone_layer_set(&data->layer, values);
@@ -405,8 +384,8 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
/* flags */
prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
- RNA_def_property_array(prop, 16);
- if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_layer_get", "rna_EditBone_layer_set");
+ RNA_def_property_array(prop, 32);
+ if(editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_layer_set");
else RNA_def_property_boolean_funcs(prop, NULL, "rna_Bone_layer_set");
RNA_def_property_ui_text(prop, "Layers", "Layers bone exists in");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
@@ -420,7 +399,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
prop= RNA_def_property(srna, "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 doesn't inherit rotation or scale from parent bone.");
+ 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);
@@ -437,6 +416,11 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
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);
+ 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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE);
@@ -544,7 +528,7 @@ static void rna_def_bone(BlenderRNA *brna)
RNA_def_property_array(prop, 9);
RNA_def_property_ui_text(prop, "Bone Matrix", "3x3 bone matrix.");
- prop= RNA_def_property(srna, "armature_matrix", PROP_FLOAT, PROP_MATRIX);
+ prop= RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "arm_mat");
RNA_def_property_array(prop, 16);
RNA_def_property_ui_text(prop, "Bone Armature-Relative Matrix", "4x4 bone matrix relative to armature.");
@@ -554,7 +538,7 @@ static void rna_def_bone(BlenderRNA *brna)
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone.");
- prop= RNA_def_property(srna, "armature_tail", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "tail_local", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "arm_tail");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Armature-Relative Tail", "Location of tail end of the bone relative to armature.");
@@ -562,9 +546,9 @@ static void rna_def_bone(BlenderRNA *brna)
prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "head");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone.");
+ RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone relative to its parent.");
- prop= RNA_def_property(srna, "armature_head", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "head_local", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "arm_head");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Armature-Relative Head", "Location of head end of the bone relative to armature.");
@@ -634,6 +618,8 @@ static void rna_def_edit_bone(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Tail Selected", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
+ RNA_api_armature_edit_bone(srna);
+
RNA_define_verify_sdna(1);
}
@@ -678,7 +664,7 @@ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_sdna(srna, "bArmature");
RNA_def_struct_ui_text(srna, "Armature EditBones", "Collection of armature edit bones.");
- prop= RNA_def_property(srna, "edit_bones", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EditBone");
RNA_def_property_pointer_sdna(prop, NULL, "act_edbone");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -758,11 +744,6 @@ static void rna_def_armature(BlenderRNA *brna)
rna_def_armature_edit_bones(brna, prop);
/* Enum values */
-// prop= RNA_def_property(srna, "rest_position", PROP_BOOLEAN, PROP_NONE);
-// RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_RESTPOS);
-// RNA_def_property_ui_text(prop, "Rest Position", "Show Armature in Rest Position. No posing possible.");
-// RNA_def_property_update(prop, 0, "rna_Armature_update_data");
-
prop= RNA_def_property(srna, "pose_position", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_pose_position_items);
@@ -796,7 +777,7 @@ static void rna_def_armature(BlenderRNA *brna)
/* layer */
prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
- RNA_def_property_array(prop, 16);
+ RNA_def_property_array(prop, 32);
RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility.");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Armature_redraw_data");
@@ -805,7 +786,7 @@ static void rna_def_armature(BlenderRNA *brna)
/* layer protection */
prop= RNA_def_property(srna, "layer_protection", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1);
- RNA_def_property_array(prop, 16);
+ 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");
diff --git a/source/blender/makesrna/intern/rna_armature_api.c b/source/blender/makesrna/intern/rna_armature_api.c
new file mode 100644
index 00000000000..31bd7275487
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_armature_api.c
@@ -0,0 +1,66 @@
+/**
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include <stddef.h>
+
+#include "BLI_blenlib.h"
+
+#include "ED_armature.h"
+
+void rna_EditBone_align(EditBone *ebo, float *no)
+{
+ if(!is_zero_v3(no)) {
+ float normal[3];
+ copy_v3_v3(normal, no);
+ normalize_v3(normal);
+ ebo->roll= ED_rollBoneToVector(ebo, normal);
+ }
+}
+
+#else
+
+void RNA_api_armature_edit_bone(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "align", "rna_EditBone_align");
+ RNA_def_function_ui_description(func, "Align the bone to a localspace vector.");
+ parm= RNA_def_float_vector(func, "vector", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 714526eb280..417750189fc 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -203,7 +203,7 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Rate", "Number of paints per second for Airbrush.");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "rgb");
RNA_def_property_ui_text(prop, "Color", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 2a97eb78382..c4edd00045b 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -216,13 +216,13 @@ static void rna_def_curvemapping(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "CurveMap");
RNA_def_property_ui_text(prop, "Curves", "");
- prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_RGB);
+ prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "black");
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Black Level", "For RGB curves, the color that black is mapped to");
RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_black_level_set", NULL);
- prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_RGB);
+ prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "white");
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "White Level", "For RGB curves, the color that white is mapped to");
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 74dabea318e..226554f9ee6 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -92,6 +92,8 @@ EnumPropertyItem constraint_ik_axisref_items[] ={
#ifdef RNA_RUNTIME
+#include <stdio.h>
+
#include "BKE_animsys.h"
#include "BKE_action.h"
#include "BKE_constraint.h"
@@ -168,7 +170,7 @@ static void rna_Constraint_name_set(PointerRNA *ptr, const char *value)
/* make sure name is unique */
if (ptr->id.data) {
Object *ob= ptr->id.data;
- ListBase *list= get_active_constraints(ob);
+ ListBase *list = get_constraint_lb(ob, con, NULL);
/* if we have the list, check for unique name, otherwise give up */
if (list)
@@ -183,19 +185,17 @@ static char *rna_Constraint_path(PointerRNA *ptr)
{
Object *ob= ptr->id.data;
bConstraint *con= ptr->data;
- bPoseChannel *pchan= get_active_posechannel(ob);
- ListBase *actlist= get_active_constraints(ob);
- short inList = 0;
-
- /* check if constraint is in the given list */
- if (actlist)
- inList= (BLI_findindex(actlist, con) != -1);
-
- /* if constraint is in the list, the list is for the active bone... */
- if ((inList) && (actlist != &ob->constraints) && (pchan))
+ bPoseChannel *pchan;
+ ListBase *lb = get_constraint_lb(ob, con, &pchan);
+
+ if(lb == NULL)
+ printf("rna_Constraint_path: internal error, constraint '%s' not found in object '%s'\n", con->name, ob->id.name);
+
+ if(pchan) {
return BLI_sprintfN("pose.bones[\"%s\"].constraints[\"%s\"]", pchan->name, con->name);
- else
- return BLI_sprintfN("constraints[\"%s\"]", con->name);
+ }
+
+ return BLI_sprintfN("constraints[\"%s\"]", con->name);
}
static void rna_Constraint_update(bContext *C, PointerRNA *ptr)
@@ -286,6 +286,35 @@ static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float
}
}
+static int rna_SplineIKConstraint_joint_bindings_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
+{
+ bConstraint *con= (bConstraint*)ptr->data;
+ bSplineIKConstraint *ikData= (bSplineIKConstraint *)con->data;
+
+ if (ikData)
+ length[0]= ikData->numpoints;
+ else
+ length[0]= 256; /* for raw_access, untested */
+
+ return length[0];
+}
+
+static void rna_SplineIKConstraint_joint_bindings_get(PointerRNA *ptr, float *values)
+{
+ bConstraint *con= (bConstraint*)ptr->data;
+ bSplineIKConstraint *ikData= (bSplineIKConstraint *)con->data;
+
+ memcpy(values, ikData->points, ikData->numpoints * sizeof(float));
+}
+
+static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const float *values)
+{
+ bConstraint *con= (bConstraint*)ptr->data;
+ bSplineIKConstraint *ikData= (bSplineIKConstraint *)con->data;
+
+ memcpy(ikData->points, values, ikData->numpoints * sizeof(float));
+}
+
#else
EnumPropertyItem constraint_distance_items[] = {
@@ -339,49 +368,49 @@ static void rna_def_constraint_childof(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, "locationx", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_location_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCX);
RNA_def_property_ui_text(prop, "Location X", "Use X Location of Parent.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "locationy", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_location_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCY);
RNA_def_property_ui_text(prop, "Location Y", "Use Y Location of Parent.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "locationz", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_location_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCZ);
RNA_def_property_ui_text(prop, "Location Z", "Use Z Location of Parent.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "rotationx", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_rotation_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTX);
RNA_def_property_ui_text(prop, "Rotation X", "Use X Rotation of Parent.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "rotationy", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_rotation_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTY);
RNA_def_property_ui_text(prop, "Rotation Y", "Use Y Rotation of Parent.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "rotationz", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_rotation_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTZ);
RNA_def_property_ui_text(prop, "Rotation Z", "Use Z Rotation of Parent.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "sizex", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_scale_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEX);
- RNA_def_property_ui_text(prop, "Size X", "Use X Scale of Parent.");
+ RNA_def_property_ui_text(prop, "Scale X", "Use X Scale of Parent.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "sizey", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_scale_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEY);
- RNA_def_property_ui_text(prop, "Size Y", "Use Y Scale of Parent.");
+ RNA_def_property_ui_text(prop, "Scale Y", "Use Y Scale of Parent.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "sizez", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_scale_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEZ);
- RNA_def_property_ui_text(prop, "Size Z", "Use Z Scale of Parent.");
+ RNA_def_property_ui_text(prop, "Scale Z", "Use Z Scale of Parent.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
@@ -478,7 +507,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "tail", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_tail", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_TIP);
RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@@ -489,7 +518,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
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, "position", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_position", 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");
@@ -509,7 +538,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
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");
- prop= RNA_def_property(srna, "rotation", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_ROT);
RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@@ -529,12 +558,12 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
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");
- prop= RNA_def_property(srna, "targetless", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO);
- RNA_def_property_ui_text(prop, "Targetless", "Use targetless IK.");
+ prop= RNA_def_property(srna, "use_target", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO);
+ RNA_def_property_ui_text(prop, "Target", "Disable for targetless IK.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "stretch", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_STRETCH);
RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@@ -581,6 +610,12 @@ static void rna_def_constraint_track_to(BlenderRNA *brna)
srna= RNA_def_struct(brna, "TrackToConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Track To Constraint", "Aims the constrained object toward the target.");
+
+ 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, "bTrackToConstraint", "data");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
@@ -632,19 +667,19 @@ static void rna_def_constraint_rotate_like(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, "rotate_like_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X);
- RNA_def_property_ui_text(prop, "Like X", "Copy the target's X rotation.");
+ RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X rotation.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "rotate_like_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Y);
- RNA_def_property_ui_text(prop, "Like Y", "Copy the target's Y rotation.");
+ RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y rotation.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "rotate_like_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Z);
- RNA_def_property_ui_text(prop, "Like Z", "Copy the target's Z rotation.");
+ RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z rotation.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
@@ -662,7 +697,7 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z rotation.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "offset", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_OFFSET);
RNA_def_property_ui_text(prop, "Offset", "Add original rotation into copied rotation.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -695,19 +730,19 @@ static void rna_def_constraint_locate_like(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, "locate_like_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X);
- RNA_def_property_ui_text(prop, "Like X", "Copy the target's X location.");
+ RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X location.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "locate_like_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y);
- RNA_def_property_ui_text(prop, "Like Y", "Copy the target's Y location.");
+ RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y location.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "locate_like_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z);
- RNA_def_property_ui_text(prop, "Like Z", "Copy the target's Z location.");
+ RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z location.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
@@ -725,7 +760,7 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z location.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "offset", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_OFFSET);
RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -778,7 +813,7 @@ static void rna_def_constraint_minmax(BlenderRNA *brna)
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0.0, 100.f);
- RNA_def_property_ui_text(prop, "Offset", "Offset of floor from object center.");
+ RNA_def_property_ui_text(prop, "Offset", "Offset of floor from object origin.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
@@ -803,22 +838,22 @@ static void rna_def_constraint_size_like(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, "size_like_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_X);
- RNA_def_property_ui_text(prop, "Like X", "Copy the target's X scale.");
+ RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X scale.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "size_like_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Y);
- RNA_def_property_ui_text(prop, "Like Y", "Copy the target's Y scale.");
+ RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y scale.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "size_like_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Z);
- RNA_def_property_ui_text(prop, "Like Z", "Copy the target's Z scale.");
+ RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z scale.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "offset", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_OFFSET);
RNA_def_property_ui_text(prop, "Offset", "Add original scale into copied scale.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1032,6 +1067,12 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
srna= RNA_def_struct(brna, "StretchToConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretches to meet the target object.");
+
+ 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, "bStretchToConstraint", "data");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
@@ -1621,17 +1662,17 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Distance", "Distance to Target.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "axis_x", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, "Axis X", "Projection over X Axis");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "axis_y", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, "Axis Y", "Projection over Y Axis");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "axis_z", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_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, "Axis Z", "Projection over Z Axis");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1703,9 +1744,13 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna)
/* direct access to bindings */
// NOTE: only to be used by experienced users
- //prop= RNA_def_property(srna, "joint_bindings", PROP_FLOAT, PROP_FACTOR);
- //RNA_def_property_collection_sdna(prop, NULL, "points", "numpoints");
- //RNA_def_property_ui_text(prop, "Joint Bindings", "(EXPERIENCED USERS ONLY) The relative positions of the joints along the chain as percentages.");
+ prop= RNA_def_property(srna, "joint_bindings", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_array(prop, 32); // XXX this is the maximum value allowed
+ RNA_def_property_flag(prop, PROP_DYNAMIC);
+ RNA_def_property_dynamic_array_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get_length");
+ RNA_def_property_float_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get", "rna_SplineIKConstraint_joint_bindings_set", NULL);
+ RNA_def_property_ui_text(prop, "Joint Bindings", "(EXPERIENCED USERS ONLY) The relative positions of the joints along the chain as percentages.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
/* settings */
prop= RNA_def_property(srna, "chain_offset", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 4c7a88d304b..faef93247d9 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -212,7 +212,7 @@ static void rna_Nurb_type_set(PointerRNA *ptr, int value)
static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Nurb *nu= (Nurb*)ptr->data;
- rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint*), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL);
+ rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL);
}
static void rna_Curve_update_data(bContext *C, PointerRNA *ptr)
@@ -229,6 +229,38 @@ static void rna_Curve_update_deps(bContext *C, PointerRNA *ptr)
rna_Curve_update_data(C, ptr);
}
+static void rna_Curve_resolution_u_update_data(bContext *C, PointerRNA *ptr)
+{
+ Curve *cu= (Curve*)ptr->id.data;
+ Nurb *nu=NULL;
+
+ if (cu->editnurb) nu= cu->editnurb->first;
+ else nu=cu->nurb.first;
+
+ while(nu) {
+ nu->resolu= cu->resolu;
+ nu= nu->next;
+ }
+
+ rna_Curve_update_data(C, ptr);
+}
+
+static void rna_Curve_resolution_v_update_data(bContext *C, PointerRNA *ptr)
+{
+ Curve *cu= (Curve*)ptr->id.data;
+ Nurb *nu=NULL;
+
+ if (cu->editnurb) nu= cu->editnurb->first;
+ else nu=cu->nurb.first;
+
+ while(nu) {
+ nu->resolv= cu->resolv;
+ nu= nu->next;
+ }
+
+ rna_Curve_update_data(C, ptr);
+}
+
/* name functions that ignore the first two ID characters */
void rna_Curve_body_get(PointerRNA *ptr, char *value)
{
@@ -298,9 +330,9 @@ static void rna_def_bpoint(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CurvePoint", NULL);
+ srna= RNA_def_struct(brna, "SplinePoint", NULL);
RNA_def_struct_sdna(srna, "BPoint");
- RNA_def_struct_ui_text(srna, "CurvePoint", "Curve point without handles.");
+ RNA_def_struct_ui_text(srna, "SplinePoint", "Spline point without handles.");
/* Boolean values */
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
@@ -314,12 +346,17 @@ static void rna_def_bpoint(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Vector value */
- prop= RNA_def_property(srna, "point", PROP_FLOAT, PROP_TRANSLATION);
- RNA_def_property_array(prop, 4);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_array(prop, 3);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+ prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "vec[3]");
+ RNA_def_property_ui_text(prop, "Weight", "Nurbs weight");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
/* Number values */
prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alfa");
@@ -327,7 +364,8 @@ static void rna_def_bpoint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3d View");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "weight_softbody", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight");
RNA_def_property_range(prop, 0.01f, 100.0f);
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
@@ -345,7 +383,7 @@ static void rna_def_beztriple(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "BezierCurvePoint", NULL);
+ srna= RNA_def_struct(brna, "BezierSplinePoint", NULL);
RNA_def_struct_sdna(srna, "BezTriple");
RNA_def_struct_ui_text(srna, "Bezier Curve Point", "Bezier curve point with two handles.");
@@ -402,7 +440,7 @@ static void rna_def_beztriple(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "control_point", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_BezTriple_ctrlpoint_get", "rna_BezTriple_ctrlpoint_set", NULL);
RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
@@ -541,13 +579,13 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
RNA_def_property_range(prop, -50.0f, 50.0f);
- RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object center");
+ RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object origin");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
RNA_def_property_range(prop, -50.0f, 50.0f);
- RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object center");
+ 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);
@@ -786,13 +824,13 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "resolu");
RNA_def_property_ui_range(prop, 1, 1024, 1, 0);
RNA_def_property_ui_text(prop, "Resolution U", "Surface resolution in U direction.");
- RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+ RNA_def_property_update(prop, 0, "rna_Curve_resolution_u_update_data");
prop= RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolv");
RNA_def_property_ui_range(prop, 1, 1024, 1, 0);
RNA_def_property_ui_text(prop, "Resolution V", "Surface resolution in V direction.");
- RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+ RNA_def_property_update(prop, 0, "rna_Curve_resolution_v_update_data");
prop= RNA_def_property(srna, "render_resolution_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolu_ren");
@@ -888,12 +926,12 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bp", NULL);
- RNA_def_property_struct_type(prop, "CurvePoint");
+ RNA_def_property_struct_type(prop, "SplinePoint");
RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", 0, 0);
RNA_def_property_ui_text(prop, "Points", "Collection of points that make up this poly or nurbs spline.");
prop= RNA_def_property(srna, "bezier_points", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, "BezierCurvePoint");
+ RNA_def_property_struct_type(prop, "BezierSplinePoint");
RNA_def_property_collection_sdna(prop, NULL, "bezt", "pntsu");
RNA_def_property_ui_text(prop, "Bezier Points", "Collection of points for bezier curves only.");
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index da14d937e6c..fbf4a8b41c5 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -252,7 +252,7 @@ static int rna_FCurve_modifiers_remove(FCurve *fcu, bContext *C, int index)
return remove_fmodifier_index(&fcu->modifiers, index);
}
-static void rna_Fmodifier_active_set(PointerRNA *ptr, int value)
+static void rna_FModifier_active_set(PointerRNA *ptr, int value)
{
FModifier *fm= (FModifier*)ptr->data;
@@ -260,7 +260,7 @@ static void rna_Fmodifier_active_set(PointerRNA *ptr, int value)
fm->flag |= FMODIFIER_FLAG_ACTIVE;
}
-static void rna_Fmodifier_active_update(bContext *C, PointerRNA *ptr)
+static void rna_FModifier_active_update(bContext *C, PointerRNA *ptr)
{
FModifier *fm, *fmo= (FModifier*)ptr->data;
@@ -278,8 +278,8 @@ static void rna_Fmodifier_active_update(bContext *C, PointerRNA *ptr)
static int rna_FModifierGenerator_coefficients_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
- FModifier *fm= (FModifier*)ptr->data;
- FMod_Generator *gen= fm->data;
+ FModifier *fcm= (FModifier*)ptr->data;
+ FMod_Generator *gen= fcm->data;
if(gen)
length[0]= gen->arraysize;
@@ -291,15 +291,15 @@ static int rna_FModifierGenerator_coefficients_get_length(PointerRNA *ptr, int l
static void rna_FModifierGenerator_coefficients_get(PointerRNA *ptr, float *values)
{
- FModifier *fm= (FModifier*)ptr->data;
- FMod_Generator *gen= fm->data;
+ FModifier *fcm= (FModifier*)ptr->data;
+ FMod_Generator *gen= fcm->data;
memcpy(values, gen->coefficients, gen->arraysize * sizeof(float));
}
static void rna_FModifierGenerator_coefficients_set(PointerRNA *ptr, const float *values)
{
- FModifier *fm= (FModifier*)ptr->data;
- FMod_Generator *gen= fm->data;
+ FModifier *fcm= (FModifier*)ptr->data;
+ FMod_Generator *gen= fcm->data;
memcpy(gen->coefficients, values, gen->arraysize * sizeof(float));
}
@@ -338,19 +338,13 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
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);
-
+ /* coefficients array */
prop= RNA_def_property(srna, "coefficients", PROP_FLOAT, PROP_NONE);
RNA_def_property_array(prop, 32);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_FModifierGenerator_coefficients_get_length");
RNA_def_property_float_funcs(prop, "rna_FModifierGenerator_coefficients_get", "rna_FModifierGenerator_coefficients_set", NULL);
RNA_def_property_ui_text(prop, "Coefficients", "Coefficients for 'x' (starting from lowest power of x^0).");
-
- /* coefficients array */
- // FIXME: this is quite difficult to try to wrap
- //prop= RNA_def_property(srna, "coefficients", PROP_COLLECTION, PROP_NONE);
- //RNA_def_property_collection_funcs(prop, "rna_FModifierGenerator_coefficients_begin", "rna_FModifierGenerator_coefficients_next", "rna_FModifierGenerator_coefficients_end", "rna_iterator_array_get", "rna_FModifierGenerator_coefficients_length", 0, 0, 0, 0);
- //RNA_def_property_ui_text(prop, "Coefficients", "Coefficients for 'x' (starting from lowest power of x^0).");
}
/* --------- */
@@ -707,8 +701,8 @@ static void rna_def_fmodifier(BlenderRNA *brna)
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "F-Curve Modifier is the one being edited ");
- RNA_def_property_boolean_funcs(prop, NULL, "rna_Fmodifier_active_set");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, "rna_Fmodifier_active_update");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_FModifier_active_set");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, "rna_FModifier_active_update");
RNA_def_property_ui_icon(prop, ICON_RADIOBUT_OFF, 1);
}
@@ -848,10 +842,9 @@ static void rna_def_fpoint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
}
-/* channeldriver.targets.* */
static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
{
- /* add target */
+ /* add modifiers */
StructRNA *srna;
PropertyRNA *prop;
@@ -861,7 +854,7 @@ static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_srna(cprop, "FCurveModifiers");
srna= RNA_def_struct(brna, "FCurveModifiers", NULL);
RNA_def_struct_sdna(srna, "FCurve");
- RNA_def_struct_ui_text(srna, "FCurve Modifiers", "Collection of fcurve modifiers.");
+ RNA_def_struct_ui_text(srna, "F-Curve Modifiers", "Collection of F-Curve Modifiers.");
/* Collection active property */
@@ -869,7 +862,7 @@ static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
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_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Active fcurve modifier", "Active fcurve modifier.");
+ 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");
@@ -917,6 +910,7 @@ static void rna_def_fcurve(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "extend");
RNA_def_property_enum_items(prop, prop_mode_extend_items);
RNA_def_property_ui_text(prop, "Extrapolation", "");
+ RNA_def_property_update(prop, NC_ANIMATION, NULL); // XXX need an update callback for this so that animation gets evaluated
/* Pointers */
prop= RNA_def_property(srna, "driver", PROP_POINTER, PROP_NONE);
@@ -927,18 +921,22 @@ static void rna_def_fcurve(BlenderRNA *brna)
prop= RNA_def_property(srna, "rna_path", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_FCurve_RnaPath_get", "rna_FCurve_RnaPath_length", "rna_FCurve_RnaPath_set");
RNA_def_property_ui_text(prop, "RNA Path", "RNA Path to property affected by F-Curve.");
+ RNA_def_property_update(prop, NC_ANIMATION, NULL); // XXX need an update callback for this to that animation gets evaluated
prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific property affected by F-Curve if applicable.");
+ RNA_def_property_update(prop, NC_ANIMATION, NULL); // XXX need an update callback for this so that animation gets evaluated
/* Color */
prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mode_color_items);
RNA_def_property_ui_text(prop, "Color Mode", "Method used to determine color of F-Curve in Graph Editor.");
+ RNA_def_property_update(prop, NC_ANIMATION, NULL);
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Color of the F-Curve in the Graph Editor.");
+ RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* Collections */
prop= RNA_def_property(srna, "sampled_points", PROP_COLLECTION, PROP_NONE);
@@ -948,7 +946,7 @@ static void rna_def_fcurve(BlenderRNA *brna)
prop= RNA_def_property(srna, "keyframe_points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bezt", "totvert");
- RNA_def_property_struct_type(prop, "BezierCurvePoint");
+ RNA_def_property_struct_type(prop, "BezierSplinePoint");
RNA_def_property_ui_text(prop, "Keyframes", "User-editable keyframes");
prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 2a4ff112c3c..129fad4e98c 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -77,7 +77,7 @@ static void rna_def_gpencil_stroke_point(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "bGPDspoint");
RNA_def_struct_ui_text(srna, "Grease Pencil Stroke Point", "Data point for freehand stroke curve.");
- prop= RNA_def_property(srna, "coordinates", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Coordinates", "");
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c
index a05485986d1..f13eb4fedc1 100644
--- a/source/blender/makesrna/intern/rna_group.c
+++ b/source/blender/makesrna/intern/rna_group.c
@@ -114,7 +114,7 @@ void RNA_def_group(BlenderRNA *brna)
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 center to use when instancing as DupliGroup.");
+ 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);
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 64af7e07fd5..52945b67275 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -204,6 +204,7 @@ char *rna_TextureSlot_path(struct PointerRNA *ptr);
/* API functions */
void RNA_api_action(StructRNA *srna);
+void RNA_api_armature_edit_bone(StructRNA *srna);
void RNA_api_drivers(StructRNA *srna);
void RNA_api_image(struct StructRNA *srna);
void RNA_api_keyconfig(struct StructRNA *srna);
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 379cf75d450..70dab957fb9 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -33,21 +33,22 @@
#include "RNA_types.h"
#include "RNA_enum_types.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-
#ifdef RNA_RUNTIME
#include "BKE_main.h"
#include "BKE_mesh.h"
+#include "BKE_armature.h"
#include "BKE_library.h"
#include "BKE_object.h"
#include "BKE_material.h"
#include "BKE_image.h"
#include "BKE_texture.h"
+#include "DNA_armature_types.h"
#include "DNA_lamp_types.h"
+#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_object_types.h"
static Mesh *rna_Main_add_mesh(Main *main, char *name)
{
@@ -66,6 +67,23 @@ static void rna_Main_remove_mesh(Main *main, ReportList *reports, Mesh *me)
/* XXX python now has invalid pointer? */
}
+static void rna_Main_remove_armature(Main *main, ReportList *reports, bArmature *arm)
+{
+ if(arm->id.us == 0)
+ free_libblock(&main->armature, arm);
+ else
+ BKE_report(reports, RPT_ERROR, "Armature must have zero users to be removed.");
+
+ /* XXX python now has invalid pointer? */
+}
+
+static bArmature *rna_Main_add_armature(Main *main, char *name)
+{
+ bArmature *arm= add_armature(name);
+ arm->id.us--;
+ return arm;
+}
+
static Lamp *rna_Main_add_lamp(Main *main, char *name)
{
Lamp *la= add_lamp(name);
@@ -164,6 +182,19 @@ void RNA_api_main(StructRNA *srna)
parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED);
+ func= RNA_def_function(srna, "add_armature", "rna_Main_add_armature");
+ RNA_def_function_ui_description(func, "Add a new armature.");
+ parm= RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "armature", "Armature", "", "New armature.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove_armature", "rna_Main_remove_armature");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove an armature if it has zero users.");
+ parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
func= RNA_def_function(srna, "add_lamp", "rna_Main_add_lamp");
RNA_def_function_ui_description(func, "Add a new lamp.");
parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock.");
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 5ff8bffe715..85007482dc4 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -1239,7 +1239,7 @@ static void rna_def_material_sss(BlenderRNA *brna)
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Subsurface Scattering", "Diffuse subsurface scattering settings for a Material datablock.");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_RGB|PROP_UNIT_LENGTH);
+ prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_COLOR|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "sss_radius");
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 10000, 1, 3);
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 2eb360aa35c..bacd7fc2b72 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -1727,7 +1727,8 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_paint_mask", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK);
RNA_def_property_ui_text(prop, "Paint Mask", "Face selection masking for painting");
-
+ RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0);
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index b84e1e21011..dedd072011d 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -225,7 +225,7 @@ static void rna_Smoke_set_type(bContext *C, PointerRNA *ptr)
case MOD_SMOKE_TYPE_COLL:
case 0:
default:
- ob->dt = OB_SHADED;
+ ob->dt = OB_TEXTURE;
break;
}
@@ -1443,6 +1443,10 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
+ static EnumPropertyItem prop_mode_items[] = {
+ {0, "VOLUME", 0, "Volume", "Bind to volume inside cage mesh."},
+ {1, "SURFACE", 0, "Surface", "Bind to surface of cage mesh."},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MeshDeformModifier", "Modifier");
RNA_def_struct_ui_text(srna, "MeshDeform Modifier", "Mesh deformation modifier to deform with other meshes.");
@@ -1482,6 +1486,10 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna)
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");
+ prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_mode_items);
+ RNA_def_property_ui_text(prop, "Mode", "Method of binding vertices are bound to cage mesh.");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_particlesystem(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index aadff579f05..a630e912b1b 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -65,6 +65,16 @@ static EnumPropertyItem parent_type_items[] = {
{PARVERT3, "VERTEX_3", 0, "3 Vertices", ""},
{PARBONE, "BONE", 0, "Bone", ""},
{0, NULL, 0, NULL, NULL}};
+
+static EnumPropertyItem collision_bounds_items[] = {
+ {OB_BOUND_BOX, "BOX", 0, "Box", ""},
+ {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""},
+ {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
+ {OB_BOUND_CONE, "CONE", 0, "Cone", ""},
+ {OB_BOUND_POLYT, "CONVEX_HULL", 0, "Convex Hull", ""},
+ {OB_BOUND_POLYH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""},
+ //{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""},
+ {0, NULL, 0, NULL, NULL}};
EnumPropertyItem object_type_items[] = {
{OB_MESH, "MESH", 0, "Mesh", ""},
@@ -79,8 +89,7 @@ EnumPropertyItem object_type_items[] = {
{0, "", 0, NULL, NULL},
{OB_CAMERA, "CAMERA", 0, "Camera", ""},
{OB_LAMP, "LAMP", 0, "Lamp", ""},
- {0, NULL, 0, NULL, NULL}
-};
+ {0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
@@ -296,6 +305,28 @@ static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *C, PointerRNA *p
return item;
}
+static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ Object *ob= (Object*)ptr->data;
+ EnumPropertyItem *item= NULL;
+ int totitem= 0;
+
+ RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_POLYH);
+ RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_POLYT);
+
+ if(ob->body_type!=OB_BODY_TYPE_SOFT) {
+ RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CONE);
+ RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CYLINDER);
+ RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_SPHERE);
+ RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_BOX);
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+ *free= 1;
+
+ return item;
+}
+
static void rna_Object_parent_bone_set(PointerRNA *ptr, const char *value)
{
Object *ob= (Object*)ptr->data;
@@ -939,13 +970,13 @@ static void rna_Object_active_constraint_set(PointerRNA *ptr, PointerRNA value)
constraints_set_active(&ob->constraints, (bConstraint *)value.data);
}
-static bConstraint *rna_Object_constraints_new(Object *object, bContext *C, int type)
+static bConstraint *rna_Object_constraint_new(Object *object, bContext *C, int type)
{
WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
return add_ob_constraint(object, NULL, type);
}
-static int rna_Object_constraints_remove(Object *object, bContext *C, int index)
+static int rna_Object_constraint_remove(Object *object, bContext *C, int index)
{
int ok = remove_constraint_index(&object->constraints, index);
if(ok) {
@@ -956,6 +987,16 @@ static int rna_Object_constraints_remove(Object *object, bContext *C, int index)
return ok;
}
+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);
+}
+
+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);
+}
+
#else
static void rna_def_vertex_group(BlenderRNA *brna)
@@ -1031,16 +1072,6 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
{OB_BODY_TYPE_SENSOR, "SENSOR", 0, "Sensor", "Collision Sensor, detects static and dynamic objects but not the other collision sensor objects"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem collision_bounds_items[] = {
- {OB_BOUND_BOX, "BOX", 0, "Box", ""},
- {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""},
- {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
- {OB_BOUND_CONE, "CONE", 0, "Cone", ""},
- {OB_BOUND_POLYT, "CONVEX_HULL", 0, "Convex Hull", ""},
- {OB_BOUND_POLYH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""},
- //{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""},
- {0, NULL, 0, NULL, NULL}};
-
srna= RNA_def_struct(brna, "GameObjectSettings", NULL);
RNA_def_struct_sdna(srna, "Object");
RNA_def_struct_nested(brna, srna, "Object");
@@ -1190,6 +1221,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "collision_bounds", 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);
@@ -1247,7 +1279,7 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
/* Constraint collection */
- func= RNA_def_function(srna, "new", "rna_Object_constraints_new");
+ func= RNA_def_function(srna, "new", "rna_Object_constraint_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Add a new constraint to this object");
/* return type */
@@ -1257,7 +1289,7 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
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_constraints_remove");
+ 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 */
@@ -1268,6 +1300,54 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_flag(parm, PROP_REQUIRED);
}
+/* armature.bones.* */
+static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "ObjectModifiers");
+ srna= RNA_def_struct(brna, "ObjectModifiers", NULL);
+ RNA_def_struct_sdna(srna, "Object");
+ RNA_def_struct_ui_text(srna, "Object Modifiers", "Collection of object modifiers.");
+
+#if 0
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "EditBone");
+ RNA_def_property_pointer_sdna(prop, NULL, "act_edbone");
+ 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);
+
+ /* todo, redraw */
+// RNA_def_property_collection_active(prop, prop_act);
+#endif
+
+ /* 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.");
+ parm= RNA_def_string(func, "name", "Name", 0, "", "New name for the bone.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* modifier to add */
+ parm= RNA_def_enum(func, "type", modifier_type_items, 1, "", "Modifier type to add.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Newly created modifier.");
+ RNA_def_function_return(func, parm);
+
+ /* remove target */
+ func= RNA_def_function(srna, "remove", "rna_Object_modifier_remove");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
+ 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);
+}
+
static void rna_def_object(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1316,7 +1396,7 @@ static void rna_def_object(BlenderRNA *brna)
{OB_BOUNDBOX, "BOUNDS", 0, "Bounds", ""},
{OB_WIRE, "WIRE", 0, "Wire", ""},
{OB_SOLID, "SOLID", 0, "Solid", ""},
- {OB_SHADED, "SHADED", 0, "Shaded", ""},
+ // disabled {OB_SHADED, "SHADED", 0, "Shaded", ""},
{OB_TEXTURE, "TEXTURED", 0, "Textured", ""},
{0, NULL, 0, NULL, NULL}};
@@ -1580,6 +1660,7 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Modifier");
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the geometric data of the Object.");
+ rna_def_object_modifiers(brna, prop);
/* game engine */
prop= RNA_def_property(srna, "game", PROP_POINTER, PROP_NONE);
@@ -1808,7 +1889,7 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "draw_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 center and 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);
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 827e0cc60d9..63b4549f7c9 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -311,7 +311,7 @@ static Object *rna_Object_find_armature(Object *ob)
int rna_Object_is_visible(Object *ob, bContext *C)
{
- return ob->lay & CTX_data_scene(C)->lay;
+ return !(ob->restrictflag & OB_RESTRICT_VIEW) && ob->lay & CTX_data_scene(C)->lay;
}
/*
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 0669344ec82..c601622fcc3 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -485,7 +485,7 @@ static void rna_FieldSettings_shape_update(bContext *C, PointerRNA *ptr)
if(!md) {
if(pd && (pd->shape == PFIELD_SHAPE_SURFACE) && ELEM(pd->forcefield,PFIELD_GUIDE,PFIELD_TEXTURE)==0)
if(ELEM4(ob->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE))
- ED_object_modifier_add(NULL, scene, ob, eModifierType_Surface);
+ ED_object_modifier_add(NULL, scene, ob, NULL, eModifierType_Surface);
}
else {
if(!pd || pd->shape != PFIELD_SHAPE_SURFACE)
@@ -620,7 +620,7 @@ static void rna_CollisionSettings_dependency_update(bContext *C, PointerRNA *ptr
/* add/remove modifier as needed */
if(ob->pd->deflect && !md)
- ED_object_modifier_add(NULL, scene, ob, eModifierType_Collision);
+ ED_object_modifier_add(NULL, scene, ob, NULL, eModifierType_Collision);
else if(!ob->pd->deflect && md)
ED_object_modifier_remove(NULL, scene, ob, md);
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index f458ee86091..6ddec53c28d 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -917,6 +917,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
static EnumPropertyItem integrator_type_items[] = {
{PART_INT_EULER, "EULER", 0, "Euler", ""},
+ {PART_INT_VERLET, "VERLET", 0, "Verlet", ""},
{PART_INT_MIDPOINT, "MIDPOINT", 0, "Midpoint", ""},
{PART_INT_RK4, "RK4", 0, "RK4", ""},
{0, NULL, 0, NULL, NULL}
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 8d43d72c02e..8a4aadcba57 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -611,7 +611,7 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro
/* return type */
parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint.");
RNA_def_function_return(func, parm);
- /* object to add */
+ /* constraint to add */
parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add.");
RNA_def_property_flag(parm, PROP_REQUIRED);
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index f8adb1a79d8..5997867030d 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -869,7 +869,7 @@ static void rna_def_property(BlenderRNA *brna)
{PROP_EULER, "EULER", 0, "Euler", ""},
{PROP_QUATERNION, "QUATERNION", 0, "Quaternion", ""},
{PROP_XYZ, "XYZ", 0, "XYZ", ""},
- {PROP_RGB, "RGB", 0, "RGB", ""},
+ {PROP_COLOR_GAMMA, "COLOR_GAMMA", 0, "Gamma Corrected Color", ""},
{PROP_LAYER, "LAYER", 0, "Layer", ""},
{PROP_LAYER_MEMBER, "LAYER_MEMBERSHIP", 0, "Layer Membership", ""},
{0, NULL, 0, NULL, NULL}};
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index bc9fa9d5573..458fdbf2ea9 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -48,7 +48,7 @@
#include "WM_types.h"
-EnumPropertyItem snap_mode_items[] = {
+EnumPropertyItem snap_target_items[] = {
{SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target."},
{SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target."},
{SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target."},
@@ -56,20 +56,34 @@ EnumPropertyItem snap_mode_items[] = {
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem proportional_falloff_items[] ={
- {PROP_SMOOTH, "SMOOTH", 0, "Smooth", ""},
- {PROP_SPHERE, "SPHERE", 0, "Sphere", ""},
- {PROP_ROOT, "ROOT", 0, "Root", ""},
- {PROP_SHARP, "SHARP", 0, "Sharp", ""},
- {PROP_LIN, "LINEAR", 0, "Linear", ""},
- {PROP_CONST, "CONSTANT", 0, "Constant", ""},
- {PROP_RANDOM, "RANDOM", 0, "Random", ""},
+ {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
+ {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
+ {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
+ {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
+ {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", ""},
+ {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", ""},
+ {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem proportional_editing_items[] = {
- {PROP_EDIT_OFF, "DISABLED", 0, "Disable", ""},
- {PROP_EDIT_ON, "ENABLED", 0, "Enable", ""},
- {PROP_EDIT_CONNECTED, "CONNECTED", 0, "Connected", ""},
+ {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", ""},
+ {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", ""},
+ {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+EnumPropertyItem mesh_select_mode_items[] = {
+ {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."},
+ {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."},
+ {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."},
+ {0, NULL, 0, NULL, NULL}};
+
+EnumPropertyItem snap_element_items[] = {
+ {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid."},
+ {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices."},
+ {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges."},
+ {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces."},
+ {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume."},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
@@ -169,31 +183,11 @@ static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
scene->set= set;
}
-static int layer_set(int lay, const int *values)
-{
- int i, tot= 0;
-
- /* ensure we always have some layer selected */
- for(i=0; i<20; i++)
- if(values[i])
- tot++;
-
- if(tot==0)
- return lay;
-
- for(i=0; i<20; i++) {
- if(values[i]) lay |= (1<<i);
- else lay &= ~(1<<i);
- }
-
- return lay;
-}
-
static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
{
Scene *scene= (Scene*)ptr->data;
- scene->lay= layer_set(scene->lay, values);
+ scene->lay= ED_view3d_scene_layer_set(scene->lay, values);
}
static void rna_Scene_layer_update(bContext *C, PointerRNA *ptr)
@@ -396,6 +390,48 @@ static void rna_SceneRenderData_jpeg2k_depth_set(PointerRNA *ptr, int value)
}
#endif
+#ifdef WITH_QUICKTIME
+static int rna_SceneRenderData_qtcodecsettings_codecType_get(PointerRNA *ptr)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+
+ return quicktime_rnatmpvalue_from_codectype(rd->qtcodecsettings.codecType);
+}
+
+static void rna_SceneRenderData_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+
+ rd->qtcodecsettings.codecType = quicktime_codecType_from_rnatmpvalue(value);
+}
+
+static EnumPropertyItem *rna_SceneRenderData_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ EnumPropertyItem *item= NULL;
+ EnumPropertyItem tmp = {0, "", 0, "", ""};
+ QuicktimeCodecTypeDesc *codecTypeDesc;
+ int i=1, totitem= 0;
+ char id[5];
+
+ for(i=0;i<quicktime_get_num_codecs();i++) {
+ codecTypeDesc = quicktime_get_codecType_desc(i);
+ if (!codecTypeDesc) break;
+
+ tmp.value= codecTypeDesc->rnatmpvalue;
+ *((int*)id) = codecTypeDesc->codecType;
+ id[4] = 0;
+ tmp.identifier= id;
+ tmp.name= codecTypeDesc->codecName;
+ RNA_enum_item_add(&item, &totitem, &tmp);
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+ *free= 1;
+
+ return item;
+}
+#endif
+
static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr)
{
RenderData *rd= (RenderData*)ptr->data;
@@ -499,7 +535,7 @@ static int rna_SceneRenderData_use_game_engine_get(PointerRNA *ptr)
static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
{
SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
- rl->lay= layer_set(rl->lay, values);
+ rl->lay= ED_view3d_scene_layer_set(rl->lay, values);
}
static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr)
@@ -561,19 +597,6 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode."},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem mesh_select_mode_items[] = {
- {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."},
- {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."},
- {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."},
- {0, NULL, 0, NULL, NULL}};
-
- static EnumPropertyItem snap_element_items[] = {
- {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices."},
- {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges."},
- {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces."},
- {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume."},
- {0, NULL, 0, NULL, NULL}};
-
static EnumPropertyItem auto_key_items[] = {
{AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
{AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
@@ -647,8 +670,8 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
- RNA_def_property_ui_text(prop, "Snap", "Snap while Ctrl is held during transform.");
- RNA_def_property_ui_icon(prop, ICON_SNAP_GEAR, 1);
+ 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_MODE, NULL); /* header redraw */
prop= RNA_def_property(srna, "snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
@@ -663,10 +686,10 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to.");
RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */
- prop= RNA_def_property(srna, "snap_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "snap_target");
- RNA_def_property_enum_items(prop, snap_mode_items);
- RNA_def_property_ui_text(prop, "Snap Mode", "Which part to snap onto the target.");
+ RNA_def_property_enum_items(prop, snap_target_items);
+ RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target.");
RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */
prop= RNA_def_property(srna, "snap_peel_object", PROP_BOOLEAN, PROP_NONE);
@@ -1456,7 +1479,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
# ifdef USE_QTKIT
{R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", ""},
# else
- {R_QUICKTIME, "QUICKTIME", ICON_FILE_MOVIE, "QuickTime", ""},
+ {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", ""},
# endif
#endif
#ifdef __sgi
@@ -1507,18 +1530,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
#ifdef WITH_QUICKTIME
static EnumPropertyItem quicktime_codec_type_items[] = {
- {QT_CODECTYPE_RAW, "RAW", 0, "Uncompressed", ""},
- {QT_CODECTYPE_JPEG, "JPEG", 0, "JPEG", ""},
- {QT_CODECTYPE_MJPEGA, "MJPEG_A", 0, "M-JPEG A", ""},
- {QT_CODECTYPE_MJPEGB, "MJPEG_B", 0, "M-JPEG B", ""},
- {QT_CODECTYPE_DVCPAL, "DVCPAL", 0, "DV PAL", ""},
- {QT_CODECTYPE_DVCNTSC, "DVCNTSC", 0, "DV/DVCPRO NTSC", ""},
- {QT_CODECTYPE_DVCPROHD720p, "DVCPROHD720P", 0, "DVCPRO HD 720p"},
- {QT_CODECTYPE_DVCPROHD1080i50, "DVCPROHD1080I50", 0, "DVCPRO HD 1080i50"},
- {QT_CODECTYPE_DVCPROHD1080i60, "DVCPROHD1080I60", 0, "DVCPRO HD 1080i60"},
- {QT_CODECTYPE_MPEG4, "MPEG4", 0, "MPEG4", ""},
- {QT_CODECTYPE_H263, "H263", 0, "H.263", ""},
- {QT_CODECTYPE_H264, "H264", 0, "H.264", ""},
+ {0, "codec", 0, "codec", ""},
{0, NULL, 0, NULL, NULL}};
#endif
@@ -1717,6 +1729,9 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType");
RNA_def_property_enum_items(prop, quicktime_codec_type_items);
+ RNA_def_property_enum_funcs(prop, "rna_SceneRenderData_qtcodecsettings_codecType_get",
+ "rna_SceneRenderData_qtcodecsettings_codecType_set",
+ "rna_SceneRenderData_qtcodecsettings_codecType_itemf");
RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2313,7 +2328,6 @@ void RNA_def_scene(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
-// PropertyRNA *prop_act;
FunctionRNA *func;
static EnumPropertyItem audio_distance_model_items[] = {
@@ -2524,7 +2538,7 @@ void RNA_def_scene(BlenderRNA *brna)
prop= RNA_def_property(srna, "sync_audio", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
- RNA_def_property_ui_text(prop, "Audio Sync", "Play back and sync with audio from Sequence Editor.");
+ RNA_def_property_ui_text(prop, "Audio Sync", "Play back and sync with audio from Sequence Editor for realtime playback.");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "scrub_audio", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index e2a8e9f2131..8b2b4890e05 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -341,9 +341,9 @@ static void rna_def_particle_edit(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem select_mode_items[] = {
- {SCE_SELECT_PATH, "PATH", ICON_EDGESEL, "Path", ""}, // XXX icon
- {SCE_SELECT_POINT, "POINT", ICON_VERTEXSEL, "Point", ""}, // XXX icon
- {SCE_SELECT_END, "END", ICON_FACESEL, "End", "E"}, // XXX icon
+ {SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"},
+ {SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"},
+ {SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem puff_mode[] = {
@@ -380,7 +380,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
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, "rna_ParticleEdit_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
prop= RNA_def_property(srna, "keep_lengths", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS);
diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c
index 9f9298c66f6..2e31facfd19 100644
--- a/source/blender/makesrna/intern/rna_sequence.c
+++ b/source/blender/makesrna/intern/rna_sequence.c
@@ -538,6 +538,12 @@ 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, NULL);
+ prop= RNA_def_property(srna, "use_effect_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_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
+
+
prop= RNA_def_property(srna, "speed_fader", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "speed_fader");
RNA_def_property_ui_text(prop, "Speed effect fader position", "");
@@ -637,7 +643,7 @@ static void rna_def_filter_video(StructRNA *srna)
RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing.");
RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_translation_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
-
+
prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
RNA_def_property_ui_text(prop, "Transform", "");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index ac93f75156f..ef5f8ccb87b 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -93,10 +93,12 @@ static EnumPropertyItem transform_orientation_items[] = {
#include "BKE_brush.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
+#include "BKE_depsgraph.h"
#include "BKE_paint.h"
#include "ED_image.h"
#include "ED_screen.h"
+#include "ED_view3d.h"
#include "IMB_imbuf_types.h"
@@ -202,6 +204,37 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, i
return item;
}
+/* Space 3D View */
+static void rna_Space3DView_lock_camera_and_layers_set(PointerRNA *ptr, int value)
+{
+ View3D *v3d= (View3D*)(ptr->data);
+ bScreen *sc= (bScreen*)ptr->id.data;
+
+ v3d->scenelock = value;
+
+ if(value) {
+ int bit;
+ v3d->lay= sc->scene->lay;
+ /* seek for layact */
+ bit= 0;
+ while(bit<32) {
+ if(v3d->lay & (1<<bit)) {
+ v3d->layact= 1<<bit;
+ break;
+ }
+ bit++;
+ }
+ v3d->camera= sc->scene->camera;
+ }
+}
+
+static void rna_Space3DView_layer_set(PointerRNA *ptr, const int *values)
+{
+ View3D *v3d= (View3D*)(ptr->data);
+
+ v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values);
+}
+
/* Space Image Editor */
static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
@@ -418,6 +451,9 @@ static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
/* set action */
adt->action= saction->action;
id_us_plus(&adt->action->id);
+
+ /* force depsgraph flush too */
+ DAG_id_flush_update(&obact->id, OB_RECALC_OB|OB_RECALC_DATA);
}
}
@@ -603,12 +639,12 @@ static void rna_def_background_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
- RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
+ RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the world origin");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
- RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the view center");
+ RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the world origin");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
@@ -633,16 +669,16 @@ static void rna_def_space_3dview(BlenderRNA *brna)
{OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
{OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
{OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
- {OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
+ //{OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
{OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem pivot_items[] = {
- {V3D_CENTER, "BOUNDING_BOX_CENTER", 0, "Bounding Box Center", ""},
- {V3D_CURSOR, "CURSOR", 0, "3D Cursor", ""},
- {V3D_LOCAL, "INDIVIDUAL_CENTERS", 0, "Individual Centers", ""},
- {V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""},
- {V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
+ {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
+ {V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", ""},
+ {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", ""},
+ {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");
@@ -656,10 +692,16 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "ob_centre");
RNA_def_property_ui_text(prop, "Lock Object", "3D View center is locked to this object's position");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+ prop= RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "ob_centre_bone");
+ 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, "background_image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "bgpic");
RNA_def_property_ui_text(prop, "Background Image", "Image and settings to display in the 3D View background");
@@ -735,9 +777,9 @@ static void rna_def_space_3dview(BlenderRNA *brna)
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_centers", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "all_object_origins", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
- RNA_def_property_ui_text(prop, "All Object Centers", "Show the object center dot for all (selected and unselected) objects.");
+ 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);
@@ -750,6 +792,12 @@ static void rna_def_space_3dview(BlenderRNA *brna)
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, "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);
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
prop= RNA_def_property(srna, "display_background_image", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_View3D_display_background_image_set");
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPIC);
@@ -765,26 +813,31 @@ static void rna_def_space_3dview(BlenderRNA *brna)
prop= RNA_def_property(srna, "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);
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);
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);
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);
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);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
@@ -813,6 +866,26 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXCLIP);
RNA_def_property_ui_text(prop, "Clip", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
+ 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_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);
+ 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_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);
+ 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.");
}
static void rna_def_space_buttons(BlenderRNA *brna)
@@ -1158,7 +1231,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL);
RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space.");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_action_update");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, "rna_SpaceDopeSheetEditor_action_update");
/* mode */
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
@@ -1205,13 +1278,20 @@ static void rna_def_space_graph(BlenderRNA *brna)
/* this is basically the same as the one for the 3D-View, but with some entries ommitted */
static EnumPropertyItem gpivot_items[] = {
- {V3D_CENTER, "BOUNDING_BOX_CENTER", 0, "Bounding Box Center", ""},
- {V3D_CURSOR, "CURSOR", 0, "2D Cursor", ""},
- {V3D_LOCAL, "INDIVIDUAL_CENTERS", 0, "Individual Centers", ""},
+ {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
+ {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
+ {V3D_LOCAL, "INDIVIDUAL_CENTERS", ICON_ROTATECOLLECTION, "Individual Centers", ""},
//{V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""},
//{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
{0, NULL, 0, NULL, NULL}};
-
+
+ static EnumPropertyItem autosnap_items[] = {
+ {SACTSNAP_OFF, "NONE", 0, "None", ""},
+ {SACTSNAP_STEP, "STEP", 0, "Step", "Snap to 1.0 frame/second intervals."},
+ {SACTSNAP_FRAME, "FRAME", 0, "Frame", "Snap to actual frames/seconds (nla-action time)."},
+ {SACTSNAP_MARKER, "MARKER", 0, "Marker", "Snap to nearest marker."},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceIpo");
@@ -1251,6 +1331,11 @@ static void rna_def_space_graph(BlenderRNA *brna)
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);
+ 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);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
@@ -1273,8 +1358,19 @@ static void rna_def_space_graph(BlenderRNA *brna)
RNA_def_property_enum_items(prop, gpivot_items);
RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
-
- // TODO... autosnap, dopesheet?
+
+ /* dopesheet */
+ prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "DopeSheet");
+ RNA_def_property_pointer_sdna(prop, NULL, "ads");
+ RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data.");
+
+ /* autosnap */
+ prop= RNA_def_property(srna, "autosnap", 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.");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
}
static void rna_def_space_nla(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index ceb78d8cddf..be38139ce4e 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -114,6 +114,7 @@ static void rna_Texture_update(bContext *C, PointerRNA *ptr)
WM_event_add_notifier(C, NC_TEXTURE, tex);
}
+/* Used for Texture Properties, used (also) for/in Nodes */
static void rna_Texture_nodes_update(bContext *C, PointerRNA *ptr)
{
Tex *tex= ptr->id.data;
@@ -784,25 +785,25 @@ static void rna_def_texture_clouds(BlenderRNA *brna)
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_clouds_stype);
RNA_def_property_ui_text(prop, "Color", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
@@ -851,25 +852,25 @@ static void rna_def_texture_wood(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_wood_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_wood_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
@@ -925,25 +926,25 @@ static void rna_def_texture_marble(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_marble_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_marble_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
@@ -1005,13 +1006,13 @@ static void rna_def_texture_blend(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_blend_progression);
RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "flip_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_flip_axis_items);
RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
}
@@ -1500,13 +1501,13 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis for the distortion");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 025c8691652..6086cdfdec2 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -37,18 +37,24 @@
#ifdef RNA_RUNTIME
-static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle, int icon_only, int event, int full_event)
+static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle, int icon_only, int event, int full_event, int index)
{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
int flag= 0;
+ if(!prop) {
+ printf("rna_uiItemR: property not found: %s\n", propname);
+ return;
+ }
+
flag |= (slider)? UI_ITEM_R_SLIDER: 0;
flag |= (expand)? UI_ITEM_R_EXPAND: 0;
flag |= (toggle)? UI_ITEM_R_TOGGLE: 0;
flag |= (icon_only)? UI_ITEM_R_ICON_ONLY: 0;
flag |= (event)? UI_ITEM_R_EVENT: 0;
flag |= (full_event)? UI_ITEM_R_FULL_EVENT: 0;
-
- uiItemR(layout, name, icon, ptr, propname, flag);
+
+ uiItemFullR(layout, name, icon, ptr, prop, index, 0, flag);
}
static PointerRNA rna_uiItemO(uiLayout *layout, char *name, int icon, char *opname)
@@ -150,6 +156,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_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");
api_ui_item_rna_common(func);
@@ -247,6 +254,11 @@ 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,6 +315,12 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "template_layers", "uiTemplateLayers");
api_ui_item_rna_common(func);
+ parm= RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ parm= RNA_def_string(func, "used_layers_property", "", 0, "", "Identifier of property in data.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "template_triColorSet", "uiTemplateTriColorSet");
api_ui_item_rna_common(func);
@@ -341,6 +359,12 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+
+
+
+ func= RNA_def_function(srna, "introspect", "uiLayoutIntrospect");
+ parm= RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR");
+ RNA_def_function_return(func, parm);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 1d4e422c7d5..278d7855f3a 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -46,6 +46,7 @@
#include "BKE_DerivedMesh.h"
#include "BKE_depsgraph.h"
#include "DNA_object_types.h"
+// #include "GPU_draw.h"
static void rna_userdef_update(bContext *C, PointerRNA *ptr)
{
@@ -151,6 +152,15 @@ static void rna_UserDef_weight_color_update(bContext *C, PointerRNA *ptr)
rna_userdef_update(C, ptr);
}
+// XXX - todo, this is not accessible from here and it only works when the userprefs are in the same window.
+// extern int GPU_default_lights(void);
+static void rna_UserDef_viewport_lights_update(bContext *C, PointerRNA *ptr)
+{
+ // GPU_default_lights();
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+ rna_userdef_update(C, ptr);
+}
+
static void rna_userdef_autosave_update(bContext *C, PointerRNA *ptr)
{
WM_autosave_init(C);
@@ -1596,21 +1606,25 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", 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");
prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Direction", "The direction that the OpenGL light is shining.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Diffuse Color", "The diffuse color of the OpenGL light.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "spec");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Specular Color", "The color of the lights specular highlight.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
}
static void rna_def_userdef_view(BlenderRNA *brna)
@@ -1715,7 +1729,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "rotate_around_selection", 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 orbiting center.");
+ RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point.");
/* select with */
@@ -1790,10 +1804,10 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_range(prop, 4, 40);
RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Hotspot in pixels for clicking widget handles.");
- prop= RNA_def_property(srna, "object_center_size", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
RNA_def_property_range(prop, 4, 10);
- RNA_def_property_ui_text(prop, "Object Center Size", "Diameter in Pixels for Object/Lamp center display.");
+ RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display.");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -1967,9 +1981,9 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
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.");
- prop= RNA_def_property(srna, "duplicate_ipo", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
- RNA_def_property_ui_text(prop, "Duplicate Ipo", "Causes ipo data to be duplicated with the object.");
+ RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_action", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
@@ -2268,26 +2282,21 @@ static void rna_def_userdef_input(BlenderRNA *brna)
{USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport."},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem middle_mouse_mouse_items[] = {
- {0, "PAN", 0, "Pan", "Use the middle mouse button for panning the viewport."},
- {USER_VIEWMOVE, "ROTATE", 0, "Rotate", "Use the middle mouse button for rotation the viewport."},
- {0, NULL, 0, NULL, NULL}};
-
static EnumPropertyItem view_zoom_styles[] = {
{USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down."},
{USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement."},
{USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center."},
{0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem view_zoom_axes[] = {
+ {0, "VERTICAL", 0, "Vertical", "Zooms in and out based on vertical mouse movement."},
+ {USER_ZOOM_DOLLY_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zooms in and out based on horizontal mouse movement."},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "UserPreferencesInput", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
RNA_def_struct_ui_text(srna, "Input", "Settings for input devices.");
-
- prop= RNA_def_property(srna, "middle_mouse", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
- RNA_def_property_enum_items(prop, middle_mouse_mouse_items);
- RNA_def_property_ui_text(prop, "Middle Mouse", "Use the middle mouse button to pan or zoom the view.");
prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
@@ -2299,6 +2308,15 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_enum_items(prop, view_zoom_styles);
RNA_def_property_ui_text(prop, "Viewport Zoom Style", "Which style to use for viewport scaling.");
+ prop= RNA_def_property(srna, "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);
+ 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);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, view_rotation_items);
@@ -2306,7 +2324,7 @@ static void rna_def_userdef_input(BlenderRNA *brna)
prop= RNA_def_property(srna, "continuous_mouse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
- RNA_def_property_ui_text(prop, "Continuous Grab", "Experimental option to allow moving the mouse outside the view");
+ RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations (transform, ui control drag).");
prop= RNA_def_property(srna, "ndof_pan_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ndof_pan");
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 203c7991142..2e4c0690031 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -62,6 +62,7 @@ EnumPropertyItem event_value_items[] = {
{KM_NOTHING, "NOTHING", 0, "Nothing", ""},
{KM_PRESS, "PRESS", 0, "Press", ""},
{KM_RELEASE, "RELEASE", 0, "Release", ""},
+ {KM_CLICK, "CLICK", 0, "Click", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem event_tweak_type_items[]= {
@@ -242,6 +243,13 @@ EnumPropertyItem keymap_modifiers_items[] = {
{2, "SECOND", 0, "Second", ""},
{0, NULL, 0, NULL, NULL}};
+EnumPropertyItem operator_return_items[] = {
+ {OPERATOR_RUNNING_MODAL, "RUNNING_MODAL", 0, "Running Modal", ""},
+ {OPERATOR_CANCELLED, "CANCELLED", 0, "Cancelled", ""},
+ {OPERATOR_FINISHED, "FINISHED", 0, "Finished", ""},
+ {OPERATOR_PASS_THROUGH, "PASS_THROUGH", 0, "Pass Through", ""}, // used as a flag
+ {0, NULL, 0, NULL, NULL}};
+
#define KMI_TYPE_KEYBOARD 0
#define KMI_TYPE_MOUSE 1
#define KMI_TYPE_TWEAK 2
@@ -254,6 +262,8 @@ EnumPropertyItem keymap_modifiers_items[] = {
#include "BKE_idprop.h"
+#include "MEM_guardedalloc.h"
+
static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr)
{
wmWindowManager *wm= ptr->id.data;
@@ -306,6 +316,12 @@ static PointerRNA rna_Operator_properties_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, op->type->srna, op->properties);
}
+static PointerRNA rna_OperatorTypeMacro_properties_get(PointerRNA *ptr)
+{
+ wmOperatorTypeMacro *otmacro= (wmOperatorTypeMacro*)ptr->data;
+ wmOperatorType *ot = WM_operatortype_exists(otmacro->idname);
+ return rna_pointer_inherit_refine(ptr, ot->srna, otmacro->properties);
+}
static void rna_Event_ascii_get(PointerRNA *ptr, char *value)
{
@@ -557,6 +573,8 @@ static void rna_wmKeyMapItem_idname_set(PointerRNA *ptr, const char *value)
WM_operator_bl_idname(idname, value);
BLI_strncpy(kmi->idname, idname, sizeof(kmi->idname));
+
+ WM_keymap_properties_reset(kmi);
}
#else
@@ -588,6 +606,50 @@ static void rna_def_operator(BlenderRNA *brna)
RNA_def_struct_idproperties_func(srna, "rna_OperatorProperties_idproperties");
}
+static void rna_def_macro_operator(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Macro", NULL);
+ RNA_def_struct_ui_text(srna, "Macro Operator", "Storage of a macro operator being executed, or registered after execution.");
+ RNA_def_struct_sdna(srna, "wmOperator");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ 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);
+}
+
+static void rna_def_operator_type_macro(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "OperatorTypeMacro", NULL);
+ RNA_def_struct_ui_text(srna, "OperatorTypeMacro", "Storage of a sub operator in a macro after it has been added.");
+ RNA_def_struct_sdna(srna, "wmOperatorTypeMacro");
+
+// prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+// RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+// RNA_def_property_string_sdna(prop, NULL, "idname");
+// RNA_def_property_ui_text(prop, "Name", "Name of the sub operator.");
+// 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_OperatorTypeMacro_properties_get", NULL, NULL);
+}
+
static void rna_def_operator_utils(BlenderRNA *brna)
{
StructRNA *srna;
@@ -906,6 +968,8 @@ void RNA_def_wm(BlenderRNA *brna)
rna_def_operator(brna);
rna_def_operator_utils(brna);
rna_def_operator_filelist_element(brna);
+ rna_def_macro_operator(brna);
+ rna_def_operator_type_macro(brna);
rna_def_event(brna);
rna_def_window(brna);
rna_def_windowmanager(brna);
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 62c4fe642a1..ce26072e91b 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -146,7 +146,20 @@ void RNA_api_wm(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "event", "Event", "", "Event.");
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_function_return(func, RNA_def_int(func, "mode", 0, 0, INT_MAX, "Mode", "", 0, INT_MAX)); // XXX, should be an enum/flag thingo
+
+ parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", ""); // better name?
+ RNA_def_property_flag(parm, PROP_ENUM_FLAG);
+ RNA_def_function_return(func, parm);
+
+
+ /* invoke functions, for use with python */
+ func= RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup");
+ RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT);
+ RNA_def_function_ui_description(func, "Operator popup invoke.");
+ parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup.", 0, INT_MAX);
+ parm= RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup.", 0, INT_MAX);
}
void RNA_api_keyconfig(StructRNA *srna)
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index c0c9c1d6568..231faffef0f 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -312,6 +312,17 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce overocclusion (for Approximate).");
RNA_def_property_update(prop, 0, "rna_World_update");
+
+ prop= RNA_def_property(srna, "indirect_energy", PROP_FLOAT, PROP_UNSIGNED);
+ RNA_def_property_float_sdna(prop, NULL, "ao_indirect_energy");
+ RNA_def_property_ui_range(prop, 0, 10, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Indirect", "Use approximate ambient occlusion for indirect diffuse lighting.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
+
+ prop= RNA_def_property(srna, "indirect_bounces", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "ao_indirect_bounces");
+ RNA_def_property_ui_text(prop, "Bounces", "Number of indirect diffuse light bounces to use for approximate ambient occlusion.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
}
static void rna_def_world_mist(BlenderRNA *brna)