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:
authorJoshua Leung <aligorith@gmail.com>2009-06-02 05:40:53 +0400
committerJoshua Leung <aligorith@gmail.com>2009-06-02 05:40:53 +0400
commit37f47ef3862a85d4d95fe5b18ab3d6b9c88ccdd3 (patch)
treea648a61fbbc313c2833a5e4eb3c8d8d75da3c090 /source/blender/makesrna/intern
parent33267f58581ea8f9d89028958c6e64a8d048d4db (diff)
parenta117731aa23c25d699c405325c7bb7ac5680a5e7 (diff)
NLA SoC: Merge from 2.5 20441 to 20570 (HEAD)
There were a few conflicts/missing files. Hopefully everything updated ok...
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/makesrna.c44
-rw-r--r--source/blender/makesrna/intern/rna_ID.c2
-rw-r--r--source/blender/makesrna/intern/rna_access.c56
-rw-r--r--source/blender/makesrna/intern/rna_brush.c4
-rw-r--r--source/blender/makesrna/intern/rna_camera.c5
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c631
-rw-r--r--source/blender/makesrna/intern/rna_controller.c1
-rw-r--r--source/blender/makesrna/intern/rna_curve.c3
-rw-r--r--source/blender/makesrna/intern/rna_define.c17
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c1
-rw-r--r--source/blender/makesrna/intern/rna_material.c4
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c24
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c187
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c357
-rw-r--r--source/blender/makesrna/intern/rna_nodetree_types.h86
-rw-r--r--source/blender/makesrna/intern/rna_object.c27
-rw-r--r--source/blender/makesrna/intern/rna_particle.c12
-rw-r--r--source/blender/makesrna/intern/rna_rna.c4
-rw-r--r--source/blender/makesrna/intern/rna_scene.c3
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c1
-rw-r--r--source/blender/makesrna/intern/rna_space.c232
-rw-r--r--source/blender/makesrna/intern/rna_text.c1
-rw-r--r--source/blender/makesrna/intern/rna_texture.c4
-rw-r--r--source/blender/makesrna/intern/rna_ui.c90
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c8
-rw-r--r--source/blender/makesrna/intern/rna_world.c1
27 files changed, 1466 insertions, 341 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 2c383c191d8..438100243e3 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -156,6 +156,17 @@ static char *rna_alloc_function_name(const char *structname, const char *propnam
return result;
}
+static StructRNA *rna_find_struct(const char *identifier)
+{
+ StructDefRNA *ds;
+
+ for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
+ if(strcmp(ds->srna->identifier, identifier)==0)
+ return ds->srna;
+
+ return NULL;
+}
+
static const char *rna_find_type(const char *type)
{
StructDefRNA *ds;
@@ -250,8 +261,10 @@ static int rna_enum_bitmask(PropertyRNA *prop)
EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
int a, mask= 0;
- for(a=0; a<eprop->totitem; a++)
- mask |= eprop->item[a].value;
+ if(eprop->item) {
+ for(a=0; a<eprop->totitem; a++)
+ mask |= eprop->item[a].value;
+ }
return mask;
}
@@ -497,7 +510,16 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
else {
rna_print_data_get(f, dp);
+
+ if(prop->flag & PROP_ID_REFCOUNT) {
+ fprintf(f, "\n if(data->%s)\n", dp->dnaname);
+ fprintf(f, " id_us_min((ID*)data->%s);\n", dp->dnaname);
+ fprintf(f, " if(value.data)\n");
+ fprintf(f, " id_us_plus((ID*)value.data);\n\n");
+ }
+
fprintf(f, " data->%s= value.data;\n", dp->dnaname);
+
}
fprintf(f, "}\n\n");
break;
@@ -1188,9 +1210,16 @@ static void rna_auto_types()
if(dp->dnatype) {
if(dp->prop->type == PROP_POINTER) {
PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
+ StructRNA *type;
if(!pprop->type && !pprop->get)
pprop->type= (StructRNA*)rna_find_type(dp->dnatype);
+
+ if(pprop->type) {
+ type= rna_find_struct((char*)pprop->type);
+ if(type && (type->flag & STRUCT_ID_REFCOUNT))
+ pprop->property.flag |= PROP_ID_REFCOUNT;
+ }
}
else if(dp->prop->type== PROP_COLLECTION) {
CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
@@ -1454,6 +1483,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
DefRNA.error= 1;
}
}
+ else if(eprop->itemf);
else {
fprintf(stderr, "rna_generate_structs: %s%s.%s, enum must have items defined.\n", srna->identifier, errnest, prop->identifier);
DefRNA.error= 1;
@@ -1581,7 +1611,12 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
}
case PROP_ENUM: {
EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
- fprintf(f, "\t%s, %s, rna_%s%s_%s_items, %d, %d\n", rna_function_string(eprop->get), rna_function_string(eprop->set), srna->identifier, strnest, prop->identifier, eprop->totitem, eprop->defaultvalue);
+ fprintf(f, "\t%s, %s, %s, ", rna_function_string(eprop->get), rna_function_string(eprop->set), rna_function_string(eprop->itemf));
+ if(eprop->item)
+ fprintf(f, "rna_%s%s_%s_items, ", srna->identifier, strnest, prop->identifier);
+ else
+ fprintf(f, "NULL, ");
+ fprintf(f, "%d, %d\n", eprop->totitem, eprop->defaultvalue);
break;
}
case PROP_POINTER: {
@@ -1798,8 +1833,11 @@ static void rna_generate(BlenderRNA *brna, FILE *f, char *filename)
fprintf(f, "#include <limits.h>\n");
fprintf(f, "#include <string.h>\n\n");
+ fprintf(f, "#include \"DNA_ID.h\"\n");
+
fprintf(f, "#include \"BLI_blenlib.h\"\n\n");
+ fprintf(f, "#include \"BKE_library.h\"\n");
fprintf(f, "#include \"BKE_utildefines.h\"\n\n");
fprintf(f, "#include \"RNA_define.h\"\n");
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index ee1a1fedf2c..ad1c7eae95e 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -182,7 +182,7 @@ static void rna_def_ID(BlenderRNA *brna)
srna= RNA_def_struct(brna, "ID", NULL);
RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection.");
- RNA_def_struct_flag(srna, STRUCT_ID);
+ RNA_def_struct_flag(srna, STRUCT_ID|STRUCT_ID_REFCOUNT);
RNA_def_struct_refine_func(srna, "rna_ID_refine");
RNA_def_struct_idproperties_func(srna, "rna_ID_idproperties");
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index dad02b2fadd..cc952528302 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -599,9 +599,17 @@ StructRNA *RNA_property_pointer_type(PropertyRNA *prop)
void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **item, int *totitem)
{
EnumPropertyRNA *eprop= (EnumPropertyRNA*)rna_ensure_property(prop);
+ int tot;
- *item= eprop->item;
- *totitem= eprop->totitem;
+ if(eprop->itemf) {
+ *item= eprop->itemf(ptr);
+ for(tot=0; (*item)[tot].identifier; tot++);
+ *totitem= tot;
+ }
+ else {
+ *item= eprop->item;
+ *totitem= eprop->totitem;
+ }
}
int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value)
@@ -1182,6 +1190,23 @@ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
printf("RNA_property_pointer_add %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);
}
+void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop)
+{
+ IDProperty *idprop, *group;
+
+ if((idprop=rna_idproperty_check(&prop, ptr))) {
+ group= RNA_struct_idproperties(ptr, 0);
+
+ if(group) {
+ IDP_RemFromGroup(group, idprop);
+ IDP_FreeProperty(idprop);
+ MEM_freeN(idprop);
+ }
+ }
+ else
+ printf("RNA_property_pointer_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);
+}
+
static void rna_property_collection_get_idp(CollectionPropertyIterator *iter)
{
CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)iter->prop;
@@ -1309,6 +1334,33 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
}
}
+void RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
+{
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr))) {
+ IDProperty tmp, *array;
+ int len;
+
+ len= idprop->len;
+ array= IDP_IDPArray(idprop);
+
+ if(key >= 0 && key < len) {
+ if(key+1 < len) {
+ /* move element to be removed to the back */
+ memcpy(&tmp, &array[key], sizeof(IDProperty));
+ memmove(array+key, array+key+1, sizeof(IDProperty)*(len-key+1));
+ memcpy(&array[len-1], &tmp, sizeof(IDProperty));
+ }
+
+ IDP_ResizeIDPArray(idprop, len-1);
+ }
+ }
+ else if(prop->flag & PROP_IDPROPERTY);
+ else
+ printf("RNA_property_collection_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);
+}
+
void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop)
{
IDProperty *idprop;
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 9f5b3ba3af7..778485c6e20 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -189,7 +189,7 @@ void rna_def_brush(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX);
RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");*/
- prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve.");
/* texture */
@@ -198,7 +198,7 @@ void rna_def_brush(BlenderRNA *brna)
/* clone tool */
prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool.");
prop= RNA_def_property(srna, "clone_opacity", PROP_FLOAT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 3b1bb3b0785..1b2bd4b4aab 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -75,13 +75,13 @@ void RNA_def_camera(BlenderRNA *brna)
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
- RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
- RNA_def_property_range(prop, 1.0f, 5000.0f);
+ RNA_def_property_range(prop, 1.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
@@ -158,6 +158,7 @@ void RNA_def_camera(BlenderRNA *brna)
prop= RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "dof_ob");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define the depth of field focal point.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 774f2f9c0ef..b0b9e2079f1 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -27,12 +27,48 @@
#include "RNA_define.h"
#include "RNA_types.h"
+#include "DNA_action_types.h"
#include "DNA_constraint_types.h"
+#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "WM_types.h"
+
+EnumPropertyItem constraint_type_items[] ={
+ {CONSTRAINT_TYPE_NULL, "NULL", "Null", ""},
+ {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", "Child Of", ""},
+ {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", "Track To", ""},
+ {CONSTRAINT_TYPE_KINEMATIC, "IK", "IK", ""},
+ {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", "Follow Path", ""},
+ {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", "Limit Rotation", ""},
+ {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", "Limit Location", ""},
+ {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", "Limit Scale", ""},
+ {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", "Copy Rotation", ""},
+ {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", "Copy Location", ""},
+ {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", "Copy Scale", ""},
+ {CONSTRAINT_TYPE_PYTHON, "SCRIPT", "Script", ""},
+ {CONSTRAINT_TYPE_ACTION, "ACTION", "Action", ""},
+ {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", "Locked Track", ""},
+ {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", "Limit Distance", ""},
+ {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", "Stretch To", ""},
+ {CONSTRAINT_TYPE_MINMAX, "FLOOR", "Floor", ""},
+ {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", "Rigid Body Joint", ""},
+ {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", "Clamp To", ""},
+ {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", "Transformation", ""},
+ {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", "Shrinkwrap", ""},
+ {0, NULL, NULL, NULL}};
+
+
#ifdef RNA_RUNTIME
+#include "BKE_action.h"
+#include "BKE_constraint.h"
+#include "BKE_context.h"
+#include "BKE_depsgraph.h"
+
+#include "ED_object.h"
+
StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
{
bConstraint *con= (bConstraint*)ptr->data;
@@ -47,21 +83,21 @@ StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
case CONSTRAINT_TYPE_FOLLOWPATH:
return &RNA_FollowPathConstraint;
case CONSTRAINT_TYPE_ROTLIKE:
- return &RNA_RotateLikeConstraint;
+ return &RNA_CopyRotationConstraint;
case CONSTRAINT_TYPE_LOCLIKE:
- return &RNA_LocateLikeConstraint;
+ return &RNA_CopyLocationConstraint;
case CONSTRAINT_TYPE_SIZELIKE:
- return &RNA_SizeLikeConstraint;
+ return &RNA_CopyScaleConstraint;
case CONSTRAINT_TYPE_PYTHON:
return &RNA_PythonConstraint;
case CONSTRAINT_TYPE_ACTION:
return &RNA_ActionConstraint;
case CONSTRAINT_TYPE_LOCKTRACK:
- return &RNA_LockTrackConstraint;
+ return &RNA_LockedTrackConstraint;
case CONSTRAINT_TYPE_STRETCHTO:
return &RNA_StretchToConstraint;
case CONSTRAINT_TYPE_MINMAX:
- return &RNA_MinMaxConstraint;
+ return &RNA_FloorConstraint;
case CONSTRAINT_TYPE_RIGIDBODYJOINT:
return &RNA_RigidBodyJointConstraint;
case CONSTRAINT_TYPE_CLAMPTO:
@@ -69,18 +105,105 @@ StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
case CONSTRAINT_TYPE_TRANSFORM:
return &RNA_TransformConstraint;
case CONSTRAINT_TYPE_ROTLIMIT:
- return &RNA_RotationLimitConstraint;
+ return &RNA_LimitRotationConstraint;
case CONSTRAINT_TYPE_LOCLIMIT:
- return &RNA_LocationLimitConstraint;
+ return &RNA_LimitLocationConstraint;
case CONSTRAINT_TYPE_SIZELIMIT:
- return &RNA_SizeLimitConstraint;
+ return &RNA_LimitScaleConstraint;
case CONSTRAINT_TYPE_DISTLIMIT:
- return &RNA_DistLimitConstraint;
+ return &RNA_LimitDistanceConstraint;
+ case CONSTRAINT_TYPE_SHRINKWRAP:
+ return &RNA_ShrinkwrapConstraint;
default:
return &RNA_UnknownType;
}
}
+static char *rna_Constraint_path(PointerRNA *ptr)
+{
+ return BLI_sprintfN("constraints[%s]", ((bConstraint*)ptr->data)->name);
+}
+
+static void rna_Constraint_update(bContext *C, PointerRNA *ptr)
+{
+ Scene *scene= CTX_data_scene(C);
+ Object *ob= ptr->id.data;
+
+ if(ob->pose) update_pose_constraint_flags(ob->pose);
+
+ object_test_constraints(ob);
+
+ if(ob->type==OB_ARMATURE) DAG_object_flush_update(scene, ob, OB_RECALC_DATA|OB_RECALC_OB);
+ else DAG_object_flush_update(scene, ob, OB_RECALC_OB);
+}
+
+static void rna_Constraint_dependency_update(bContext *C, PointerRNA *ptr)
+{
+ Object *ob= ptr->id.data;
+
+ rna_Constraint_update(C, ptr);
+
+ if(ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
+ DAG_scene_sort(CTX_data_scene(C));
+}
+
+static void rna_Constraint_influence_update(bContext *C, PointerRNA *ptr)
+{
+ Object *ob= ptr->id.data;
+
+ if(ob->pose)
+ ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
+
+ rna_Constraint_update(C, ptr);
+}
+
+static EnumPropertyItem space_pchan_items[] = {
+ {0, "WORLD", "World Space", ""},
+ {2, "POSE", "Pose Space", ""},
+ {3, "LOCAL_WITH_PARENT", "Local With Parent", ""},
+ {1, "LOCAL", "Local Space", ""},
+ {0, NULL, NULL, NULL}};
+
+static EnumPropertyItem space_object_items[] = {
+ {0, "WORLD", "World Space", ""},
+ {1, "LOCAL", "Local (Without Parent) Space", ""},
+ {0, NULL, NULL, NULL}};
+
+static EnumPropertyItem *rna_Constraint_owner_space_itemf(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+ bConstraint *con= (bConstraint*)ptr->data;
+
+ if(BLI_findindex(&ob->constraints, con) == -1)
+ return space_pchan_items;
+ else /* object */
+ return space_object_items;
+}
+
+static EnumPropertyItem *rna_Constraint_target_space_itemf(PointerRNA *ptr)
+{
+ bConstraint *con= (bConstraint*)ptr->data;
+ bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
+ ListBase targets = {NULL, NULL};
+ bConstraintTarget *ct;
+
+ if(cti && cti->get_constraint_targets) {
+ cti->get_constraint_targets(con, &targets);
+
+ for(ct=targets.first; ct; ct= ct->next)
+ if(ct->tar && ct->tar->type == OB_ARMATURE)
+ break;
+
+ if(cti->flush_constraint_targets)
+ cti->flush_constraint_targets(con, &targets, 1);
+
+ if(ct)
+ return space_pchan_items;
+ }
+
+ return space_object_items;
+}
+
#else
static void rna_def_constrainttarget(BlenderRNA *brna)
@@ -94,12 +217,14 @@ static void rna_def_constrainttarget(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
// space, flag and type still to do
}
@@ -115,48 +240,59 @@ static void rna_def_constraint_childof(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "locationx", 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);
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);
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);
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);
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);
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);
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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "sizey", 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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "sizez", 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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_python(BlenderRNA *brna)
@@ -176,14 +312,17 @@ static void rna_def_constraint_python(BlenderRNA *brna)
prop= RNA_def_property(srna, "number_of_targets", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tarnum");
RNA_def_property_ui_text(prop, "Number of Targets", "Usually only 1-3 are needed.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Text");
RNA_def_property_ui_text(prop, "Script", "The text object that contains the Python script.");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_targets", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_USETARGETS);
RNA_def_property_ui_text(prop, "Use Targets", "Use the targets indicated in the constraint panel.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "script_error", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_SCRIPTERROR);
@@ -202,30 +341,36 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 10000);
RNA_def_property_ui_text(prop, "Iterations", "Maximum number of solving iterations.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "pole_target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "poletar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Pole Target", "Object for pole rotation.");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "pole_subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "polesubtarget");
RNA_def_property_ui_text(prop, "Pole Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "poleangle");
RNA_def_property_range(prop, 0.0, 180.f);
RNA_def_property_ui_text(prop, "Pole Angle", "Pole rotation offset.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 1.f);
@@ -235,27 +380,33 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "orientweight");
RNA_def_property_range(prop, 0.01, 1.f);
RNA_def_property_ui_text(prop, "Orientation Weight", "For Tree-IK: Weight of orientation control for this target.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "chain_length", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rootbone");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "tail", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_TIP);
RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_ROT);
RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "targetless", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO);
RNA_def_property_ui_text(prop, "Targetless", "Use targetless IK.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_STRETCH);
RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_track_to(BlenderRNA *brna)
@@ -264,18 +415,18 @@ static void rna_def_constraint_track_to(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem track_items[] = {
- {TRACK_X, "TRACK_X", "Track X", ""},
- {TRACK_Y, "TRACK_Y", "Track Y", ""},
- {TRACK_Z, "TRACK_Z", "Track Z", ""},
- {TRACK_nX, "TRACK_NEGATIVE_X", "Track Negative X", ""},
- {TRACK_nY, "TRACK_NEGATIVE_Y", "Track Negative Y", ""},
- {TRACK_nZ, "TRACK_NEGATIVE_Z", "Track Negative Z", ""},
+ {TRACK_X, "TRACK_X", "X", ""},
+ {TRACK_Y, "TRACK_Y", "Y", ""},
+ {TRACK_Z, "TRACK_Z", "Z", ""},
+ {TRACK_nX, "TRACK_NEGATIVE_X", "-X", ""},
+ {TRACK_nY, "TRACK_NEGATIVE_Y", "-Y", ""},
+ {TRACK_nZ, "TRACK_NEGATIVE_Z", "-Z", ""},
{0, NULL, NULL, NULL}};
static EnumPropertyItem up_items[] = {
- {TRACK_X, "UP_X", "Up X", ""},
- {TRACK_Y, "UP_Y", "Up Y", ""},
- {TRACK_Z, "UP_Z", "Up Z", ""},
+ {TRACK_X, "UP_X", "X", ""},
+ {TRACK_Y, "UP_Y", "Y", ""},
+ {TRACK_Z, "UP_Z", "Z", ""},
{0, NULL, NULL, NULL}};
srna= RNA_def_struct(brna, "TrackToConstraint", "Constraint");
@@ -284,26 +435,31 @@ static void rna_def_constraint_track_to(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "track", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "reserved1");
RNA_def_property_enum_items(prop, track_items);
RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "up", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "reserved2");
RNA_def_property_enum_items(prop, up_items);
RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "target_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TARGET_Z_UP);
RNA_def_property_ui_text(prop, "Target Z", "Target's Z axis, not World Z axis, will constraint the Up direction.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_rotate_like(BlenderRNA *brna)
@@ -311,46 +467,55 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "RotateLikeConstraint", "Constraint");
+ srna= RNA_def_struct(brna, "CopyRotationConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Copy Rotation Constraint", "Copies the rotation of the target.");
RNA_def_struct_sdna_from(srna, "bRotateLikeConstraint", "data");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "rotate_like_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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "rotate_like_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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "rotate_like_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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X_INVERT);
RNA_def_property_ui_text(prop, "Invert X", "Invert the X rotation.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Y_INVERT);
RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y rotation.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Z_INVERT);
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);
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");
}
static void rna_def_constraint_locate_like(BlenderRNA *brna)
@@ -358,46 +523,63 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "LocateLikeConstraint", "Constraint");
+ srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target.");
RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "locate_like_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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "locate_like_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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "locate_like_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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X_INVERT);
RNA_def_property_ui_text(prop, "Invert X", "Invert the X location.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y_INVERT);
RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y location.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z_INVERT);
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);
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");
+
+ RNA_def_struct_sdna(srna, "bConstraint");
+
+ prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_PERCENTAGE);
+ RNA_def_property_float_sdna(prop, NULL, "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");
}
static void rna_def_constraint_minmax(BlenderRNA *brna)
@@ -406,43 +588,49 @@ static void rna_def_constraint_minmax(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem minmax_items[] = {
- {LOCLIKE_X, "FLOOR_X", "Floor X", ""},
- {LOCLIKE_Y, "FLOOR_Y", "Floor Y", ""},
- {LOCLIKE_Z, "FLOOR_Z", "Floor Z", ""},
- {LOCLIKE_X_INVERT, "FLOOR_NEGATIVE_X", "Floor Negative X", ""},
- {LOCLIKE_Y_INVERT, "FLOOR_NEGATIVE_Y", "Floor Negative Y", ""},
- {LOCLIKE_Z_INVERT, "FLOOR_NEGATIVE_Z", "Floor Negative Z", ""},
+ {LOCLIKE_X, "FLOOR_X", "X", ""},
+ {LOCLIKE_Y, "FLOOR_Y", "Y", ""},
+ {LOCLIKE_Z, "FLOOR_Z", "Z", ""},
+ {LOCLIKE_X_INVERT, "FLOOR_NEGATIVE_X", "-X", ""},
+ {LOCLIKE_Y_INVERT, "FLOOR_NEGATIVE_Y", "-Y", ""},
+ {LOCLIKE_Z_INVERT, "FLOOR_NEGATIVE_Z", "-Z", ""},
{0, NULL, NULL, NULL}};
- srna= RNA_def_struct(brna, "MinMaxConstraint", "Constraint");
+ srna= RNA_def_struct(brna, "FloorConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Floor Constraint", "Uses the target object for location limitation.");
RNA_def_struct_sdna_from(srna, "bMinMaxConstraint","data");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "floor_location", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "minmaxflag");
RNA_def_property_enum_items(prop, minmax_items);
RNA_def_property_ui_text(prop, "Floor Location", "Location of target that object will not pass through.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MINMAX_STICKY);
RNA_def_property_ui_text(prop, "Sticky", "Immobilize object while constrained.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MINMAX_USEROT);
RNA_def_property_ui_text(prop, "Use Rotation", "Use the target's rotation to determine floor.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_size_like(BlenderRNA *brna)
@@ -450,34 +638,41 @@ static void rna_def_constraint_size_like(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SizeLikeConstraint", "Constraint");
+ srna= RNA_def_struct(brna, "CopyScaleConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copies the scale of the target.");
RNA_def_struct_sdna_from(srna, "bSizeLikeConstraint", "data");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "size_like_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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "size_like_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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "size_like_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_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "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");
}
static void rna_def_constraint_action(BlenderRNA *brna)
@@ -503,42 +698,50 @@ static void rna_def_constraint_action(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "transform_channel", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, transform_channel_items);
- RNA_def_property_ui_text(prop, "Transform Channel", "Transfromation channel from the target that is used to key the Action.");
+ RNA_def_property_ui_text(prop, "Transform Channel", "Transformation channel from the target that is used to key the Action.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act");
- RNA_def_property_struct_type(prop, "Action");
RNA_def_property_ui_text(prop, "Action", "");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Start Frame", "First frame of the Action to use.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "end");
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "End Frame", "Last frame of the Action to use.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for target channel range.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_locked_track(BlenderRNA *brna)
@@ -547,42 +750,46 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem locktrack_items[] = {
- {TRACK_X, "TRACK_X", "Track X", ""},
- {TRACK_Y, "TRACK_Y", "Track Y", ""},
- {TRACK_Z, "TRACK_Z", "Track Z", ""},
- {TRACK_nX, "TRACK_NEGATIVE_X", "Track Negative X", ""},
- {TRACK_nY, "TRACK_NEGATIVE_Y", "Track Negative Y", ""},
- {TRACK_nZ, "TRACK_NEGATIVE_Z", "Track Negative Z", ""},
+ {TRACK_X, "TRACK_X", "X", ""},
+ {TRACK_Y, "TRACK_Y", "Y", ""},
+ {TRACK_Z, "TRACK_Z", "Z", ""},
+ {TRACK_nX, "TRACK_NEGATIVE_X", "-X", ""},
+ {TRACK_nY, "TRACK_NEGATIVE_Y", "-Y", ""},
+ {TRACK_nZ, "TRACK_NEGATIVE_Z", "-Z", ""},
{0, NULL, NULL, NULL}};
static EnumPropertyItem lock_items[] = {
- {TRACK_X, "LOCK_X", "Lock X", ""},
- {TRACK_Y, "LOCK_Y", "Lock Y", ""},
- {TRACK_Z, "LOCK_Z", "Lock Z", ""},
+ {TRACK_X, "LOCK_X", "X", ""},
+ {TRACK_Y, "LOCK_Y", "Y", ""},
+ {TRACK_Z, "LOCK_Z", "Z", ""},
{0, NULL, NULL, NULL}};
- srna= RNA_def_struct(brna, "LockTrackConstraint", "Constraint");
+ srna= RNA_def_struct(brna, "LockedTrackConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Locked Track Constraint", "Points toward the target along the track axis, while locking the other axis.");
RNA_def_struct_sdna_from(srna, "bLockTrackConstraint", "data");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "track", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, locktrack_items);
RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "locked", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "lockflag");
RNA_def_property_enum_items(prop, lock_items);
RNA_def_property_ui_text(prop, "Locked Axis", "Axis that points upward.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_follow_path(BlenderRNA *brna)
@@ -591,18 +798,18 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem forwardpath_items[] = {
- {TRACK_X, "FORWARD_X", "Forward X", ""},
- {TRACK_Y, "FORWARD_Y", "Forward Y", ""},
- {TRACK_Z, "FORWARD_Z", "Forward Z", ""},
- {TRACK_nX, "TRACK_NEGATIVE_X", "Forward Negative X", ""},
- {TRACK_nY, "TRACK_NEGATIVE_Y", "Forward Negative Y", ""},
- {TRACK_nZ, "TRACK_NEGATIVE_Z", "Forward Negative Z", ""},
+ {TRACK_X, "FORWARD_X", "X", ""},
+ {TRACK_Y, "FORWARD_Y", "Y", ""},
+ {TRACK_Z, "FORWARD_Z", "Z", ""},
+ {TRACK_nX, "TRACK_NEGATIVE_X", "-X", ""},
+ {TRACK_nY, "TRACK_NEGATIVE_Y", "-Y", ""},
+ {TRACK_nZ, "TRACK_NEGATIVE_Z", "-Z", ""},
{0, NULL, NULL, NULL}};
static EnumPropertyItem pathup_items[] = {
- {TRACK_X, "UP_X", "Up X", ""},
- {TRACK_Y, "UP_Y", "Up Y", ""},
- {TRACK_Z, "UP_Z", "Up Z", ""},
+ {TRACK_X, "UP_X", "X", ""},
+ {TRACK_Y, "UP_Y", "Y", ""},
+ {TRACK_Z, "UP_Z", "Z", ""},
{0, NULL, NULL, NULL}};
srna= RNA_def_struct(brna, "FollowPathConstraint", "Constraint");
@@ -611,26 +818,31 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, -300000.0, 300000.f);
RNA_def_property_ui_text(prop, "Offset", "Offset from the position corresponding to the time frame.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "forward", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, forwardpath_items);
RNA_def_property_ui_text(prop, "Forward Axis", "Axis that points forward along the path.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "up", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "upflag");
RNA_def_property_enum_items(prop, pathup_items);
RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "curve_follow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "followflag", 1);
RNA_def_property_ui_text(prop, "Follow Curve", "Object will follow the heading and banking of the curve.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_stretch_to(BlenderRNA *brna)
@@ -639,15 +851,15 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem volume_items[] = {
- {VOLUME_XZ, "VOLUME_XZX", "Volume XZ", ""},
- {VOLUME_XZ, "VOLUME_X", "Volume Y", ""},
- {VOLUME_XZ, "VOLUME_Z", "Volume Z", ""},
- {NO_VOLUME, "NO_VOLUME", "No Volume", ""},
+ {VOLUME_XZ, "VOLUME_XZX", "XZ", ""},
+ {VOLUME_X, "VOLUME_X", "Y", ""},
+ {VOLUME_Z, "VOLUME_Z", "Z", ""},
+ {NO_VOLUME, "NO_VOLUME", "None", ""},
{0, NULL, NULL, NULL}};
static EnumPropertyItem plane_items[] = {
- {PLANE_X, "PLANE_X", "Keep X Axis", ""},
- {PLANE_Z, "PLANE_Z", "Keep Z Axis", ""},
+ {PLANE_X, "PLANE_X", "X", "Keep X Axis"},
+ {PLANE_Z, "PLANE_Z", "Z", "Keep Z Axis"},
{0, NULL, NULL, NULL}};
srna= RNA_def_struct(brna, "StretchToConstraint", "Constraint");
@@ -656,27 +868,32 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "volmode");
RNA_def_property_enum_items(prop, volume_items);
RNA_def_property_ui_text(prop, "Maintain Volume", "Maintain the object's volume as it stretches.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "keep_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "plane");
RNA_def_property_enum_items(prop, plane_items);
RNA_def_property_ui_text(prop, "Keep Axis", "Axis to maintain during stretch.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "original_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "orglength");
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Original Length", "Length at rest position.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Volume Variation", "Factor between volume variation and stretching.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
@@ -697,47 +914,56 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object.");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Child Object", "Child object.");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "pivot_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, pivot_items);
RNA_def_property_ui_text(prop, "Pivot Type", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pivX");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Pivot X", "Offset pivot on X.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pivY");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Pivot Y", "Offset pivot on Y.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "pivot_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pivZ");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Pivot Z", "Offset pivot on Z.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "axX");
RNA_def_property_range(prop, -360.0, 360.f);
RNA_def_property_ui_text(prop, "Axis X", "Rotate pivot on X axis in degrees.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "axY");
RNA_def_property_range(prop, -360.0, 360.f);
RNA_def_property_ui_text(prop, "Axis Y", "Rotate pivot on Y axis in degrees.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "axZ");
RNA_def_property_range(prop, -360.0, 360.f);
RNA_def_property_ui_text(prop, "Axis Z", "Rotate pivot on Z axis in degrees.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
/* XXX not sure how to wrap the two 6 element arrays for the generic joint */
//float minLimit[6];
@@ -746,10 +972,12 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
prop= RNA_def_property(srna, "disable_linked_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE_LINKED_COLLISION);
RNA_def_property_ui_text(prop, "Disable Linked Collision", "Disable collision between linked bodies.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "draw_pivot", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DRAW_PIVOT);
RNA_def_property_ui_text(prop, "Draw Pivot", "Display the pivot point and rotation in 3D view.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_clamp_to(BlenderRNA *brna)
@@ -758,10 +986,10 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem clamp_items[] = {
- {CLAMPTO_AUTO, "CLAMPTO_AUTO", "Clamp Auto", ""},
- {CLAMPTO_X, "CLAMPTO_X", "Clamp X", ""},
- {CLAMPTO_Y, "CLAMPTO_Y", "Clamp Y", ""},
- {CLAMPTO_Z, "CLAMPTO_Z", "Clamp Z", ""},
+ {CLAMPTO_AUTO, "CLAMPTO_AUTO", "Auto", ""},
+ {CLAMPTO_X, "CLAMPTO_X", "X", ""},
+ {CLAMPTO_Y, "CLAMPTO_Y", "Y", ""},
+ {CLAMPTO_Z, "CLAMPTO_Z", "Z", ""},
{0, NULL, NULL, NULL}};
srna= RNA_def_struct(brna, "ClampToConstraint", "Constraint");
@@ -770,17 +998,20 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "main_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, clamp_items);
RNA_def_property_ui_text(prop, "Main Axis", "Main axis of movement.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", CLAMPTO_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_transform(BlenderRNA *brna)
@@ -789,16 +1020,16 @@ static void rna_def_constraint_transform(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem transform_items[] = {
- {0, "LOCATION", "Location", ""},
- {1, "ROTATION", "Rotation", ""},
+ {0, "LOCATION", "Loc", ""},
+ {1, "ROTATION", "Rot", ""},
{2, "SCALE", "Scale", ""},
{0, NULL, NULL, NULL}};
- /*static EnumPropertyItem axis_map_items[] = {
+ static EnumPropertyItem axis_map_items[] = {
{0, "X", "X", ""},
{1, "Y", "Y", ""},
{2, "Z", "Z", ""},
- {0, NULL, NULL, NULL}};*/
+ {0, NULL, NULL, NULL}};
srna= RNA_def_struct(brna, "TransformConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Transformation Constraint", "Maps transformations of the target to the object.");
@@ -806,104 +1037,121 @@ static void rna_def_constraint_transform(BlenderRNA *brna)
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "map_from", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "from");
RNA_def_property_enum_items(prop, transform_items);
RNA_def_property_ui_text(prop, "Map From", "The transformation type to use from the target.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "map_to", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "to");
RNA_def_property_enum_items(prop, transform_items);
RNA_def_property_ui_text(prop, "Map To", "The transformation type to affect of the constrained object.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
-/* it would be cool to have a method for rna to directly address specific elements of arrays in dna */
-
-/* prop= RNA_def_property(srna, "map_to_x_from", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, 0, "map");
+ prop= RNA_def_property(srna, "map_to_x_from", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "map[0]");
RNA_def_property_enum_items(prop, axis_map_items);
RNA_def_property_ui_text(prop, "Map To X From", "The source axis constrained object's X axis uses.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "map_to_y_from", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, 1, "map");
+ RNA_def_property_enum_sdna(prop, NULL, "map[1]");
RNA_def_property_enum_items(prop, axis_map_items);
RNA_def_property_ui_text(prop, "Map To Y From", "The source axis constrained object's Y axis uses.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "map_to_z_from", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, 2, "map");
+ RNA_def_property_enum_sdna(prop, NULL, "map[2]");
RNA_def_property_enum_items(prop, axis_map_items);
RNA_def_property_ui_text(prop, "Map To Z From", "The source axis constrained object's Z axis uses.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "extrapolate_motion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "expo", CLAMPTO_CYCLIC);
RNA_def_property_ui_text(prop, "Extrapolate Motion", "Extrapolate ranges.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "from_min_x", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 0, "from_min");
+ RNA_def_property_float_sdna(prop, NULL, "from_min[0]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "from_min_y", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 1, "from_min");
+ RNA_def_property_float_sdna(prop, NULL, "from_min[1]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "from_min_z", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 2, "from_min");
+ RNA_def_property_float_sdna(prop, NULL, "from_min[2]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "from_max_x", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 0, "from_max");
+ RNA_def_property_float_sdna(prop, NULL, "from_max[0]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "from_max_y", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 1, "from_max");
+ RNA_def_property_float_sdna(prop, NULL, "from_max[1]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "from_max_z", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 2, "from_max");
+ RNA_def_property_float_sdna(prop, NULL, "from_max[2]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "to_min_x", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 0, "to_min");
+ RNA_def_property_float_sdna(prop, NULL, "to_min[0]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "to_min_y", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 1, "to_min");
+ RNA_def_property_float_sdna(prop, NULL, "to_min[1]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "to_min_z", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 2, "to_min");
+ RNA_def_property_float_sdna(prop, NULL, "to_min[2]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "to_max_x", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 0, "to_max");
+ RNA_def_property_float_sdna(prop, NULL, "to_max[0]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "to_max_y", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 1, "to_max");
+ RNA_def_property_float_sdna(prop, NULL, "to_max[1]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "to_max_z", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, 2, "to_max");
+ RNA_def_property_float_sdna(prop, NULL, "to_max[2]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion.");
-*/
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_location_limit(BlenderRNA *brna)
@@ -911,67 +1159,80 @@ static void rna_def_constraint_location_limit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "LocationLimitConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Location Limit Constraint", "Limits the location of the constrained object.");
+ srna= RNA_def_struct(brna, "LimitLocationConstraint", "Constraint");
+ RNA_def_struct_ui_text(srna, "Limit Location Constraint", "Limits the location of the constrained object.");
RNA_def_struct_sdna_from(srna, "bLocLimitConstraint", "data");
prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_minimum_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN);
RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_maximum_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX);
RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "limit_transform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_rotation_limit(BlenderRNA *brna)
@@ -979,67 +1240,65 @@ static void rna_def_constraint_rotation_limit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "RotationLimitConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Rotation Limit Constraint", "Limits the rotation of the constrained object.");
+ srna= RNA_def_struct(brna, "LimitRotationConstraint", "Constraint");
+ RNA_def_struct_ui_text(srna, "Limit Rotation Constraint", "Limits the rotation of the constrained object.");
RNA_def_struct_sdna_from(srna, "bRotLimitConstraint", "data");
- prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN);
- RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value.");
-
- prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN);
- RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value.");
+ prop= RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XROT);
+ RNA_def_property_ui_text(prop, "Limit X", "Use the minimum X value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_minimum_z", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN);
- RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value.");
+ prop= RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YROT);
+ RNA_def_property_ui_text(prop, "Limit Y", "Use the minimum Y value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX);
- RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value.");
-
- prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX);
- RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value.");
-
- prop= RNA_def_property(srna, "use_maximum_z", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX);
- RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value.");
+ prop= RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZROT);
+ RNA_def_property_ui_text(prop, "Limit Z", "Use the minimum Z value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "limit_transform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_size_limit(BlenderRNA *brna)
@@ -1047,67 +1306,80 @@ static void rna_def_constraint_size_limit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SizeLimitConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Size Limit Constraint", "Limits the scaling of the constrained object.");
+ srna= RNA_def_struct(brna, "LimitScaleConstraint", "Constraint");
+ RNA_def_struct_ui_text(srna, "Limit Size Constraint", "Limits the scaling of the constrained object.");
RNA_def_struct_sdna_from(srna, "bSizeLimitConstraint", "data");
prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_minimum_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN);
RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "use_maximum_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX);
RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "limit_transform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
static void rna_def_constraint_distance_limit(BlenderRNA *brna)
@@ -1121,63 +1393,94 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna)
{LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", "On Surface", ""},
{0, NULL, NULL, NULL}};
- srna= RNA_def_struct(brna, "DistLimitConstraint", "Constraint");
- RNA_def_struct_ui_text(srna, "Distance Limit Constraint", "Limits the distance from target object.");
+ srna= RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint");
+ RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limits the distance from target object.");
RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, distance_items);
RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
-/* base struct for constraints */
-void RNA_def_constraint(BlenderRNA *brna)
+static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem type_items[] ={
- {CONSTRAINT_TYPE_NULL, "NULL", "Null", ""},
- {CONSTRAINT_TYPE_CHILDOF, "CHILDOF", "Child Of", ""},
- {CONSTRAINT_TYPE_TRACKTO, "TRACKTO", "Track To", ""},
- {CONSTRAINT_TYPE_KINEMATIC, "IK", "IK", ""},
- {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOWPATH", "Follow Path", ""},
- {CONSTRAINT_TYPE_ROTLIMIT, "LIMITROT", "Limit Rotation", ""},
- {CONSTRAINT_TYPE_LOCLIMIT, "LIMITLOC", "Limit Location", ""},
- {CONSTRAINT_TYPE_SIZELIMIT, "LIMITSCALE", "Limit Scale", ""},
- {CONSTRAINT_TYPE_ROTLIKE, "COPYROT", "Copy Rotation", ""},
- {CONSTRAINT_TYPE_LOCLIKE, "COPYLOC", "Copy Location", ""},
- {CONSTRAINT_TYPE_SIZELIKE, "COPYSCALE", "Copy Scale", ""},
- {CONSTRAINT_TYPE_PYTHON, "SCRIPT", "Script", ""},
- {CONSTRAINT_TYPE_ACTION, "ACTION", "Action", ""},
- {CONSTRAINT_TYPE_LOCKTRACK, "LOCKTRACK", "Locked Track", ""},
- {CONSTRAINT_TYPE_DISTLIMIT, "LIMITDIST", "Limit Distance", ""},
- {CONSTRAINT_TYPE_STRETCHTO, "STRETCHTO", "Stretch To", ""},
- {CONSTRAINT_TYPE_MINMAX, "FLOOR", "Floor", ""},
- {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGIDBODYJOINT", "Rigid Body Joint", ""},
- {CONSTRAINT_TYPE_CLAMPTO, "CLAMPTO", "Clamp To", ""},
- {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", "Transformation", ""},
+ static EnumPropertyItem type_items[] = {
+ {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", "Nearest Surface Point", ""},
+ {MOD_SHRINKWRAP_PROJECT, "PROJECT", "Project", ""},
+ {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", "Nearest Vertex", ""},
{0, NULL, NULL, NULL}};
+ srna= RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint");
+ RNA_def_struct_ui_text(srna, "Shrinkwrap Constraint", "Creates constraint-based shrinkwrap relationship.");
+ RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data");
+
+ prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "target");
+ RNA_def_property_ui_text(prop, "Target", "Target Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "shrinkType");
+ RNA_def_property_enum_items(prop, type_items);
+ RNA_def_property_ui_text(prop, "Shrinkwrap Type", "Selects type of shrinkwrap algorithm for target position");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dist");
+ RNA_def_property_range(prop, 0.0, 100.f);
+ RNA_def_property_ui_text(prop, "Distance", "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);
+ 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);
+ 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);
+ 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");
+}
+
+/* base struct for constraints */
+void RNA_def_constraint(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
/* data */
srna= RNA_def_struct(brna, "Constraint", NULL );
RNA_def_struct_ui_text(srna, "Constraint", "Constraint modifying the transformation of objects and bones.");
RNA_def_struct_refine_func(srna, "rna_ConstraintType_refine");
+ RNA_def_struct_path_func(srna, "rna_Constraint_path");
RNA_def_struct_sdna(srna, "bConstraint");
/* strings */
@@ -1189,9 +1492,19 @@ void RNA_def_constraint(BlenderRNA *brna)
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_sdna(prop, NULL, "type");
- RNA_def_property_enum_items(prop, type_items);
+ RNA_def_property_enum_items(prop, constraint_type_items);
RNA_def_property_ui_text(prop, "Type", "");
-
+
+ prop= RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "ownspace");
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_owner_space_itemf");
+ RNA_def_property_ui_text(prop, "Owner Space", "Space that owner is evaluated in.");
+
+ prop= RNA_def_property(srna, "target_space", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "tarspace");
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_target_space_itemf");
+ RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in.");
+
/* flags */
// XXX do we want to wrap this?
prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
@@ -1214,10 +1527,11 @@ void RNA_def_constraint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Proxy Local", "Constraint was added in this proxy instance (i.e. did not belong to source Armature).");
/* values */
- prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "enforce");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Amount of influence constraint will have on the final solution.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_influence_update");
/* pointers */
rna_def_constrainttarget(brna);
@@ -1241,6 +1555,7 @@ void RNA_def_constraint(BlenderRNA *brna)
rna_def_constraint_rotation_limit(brna);
rna_def_constraint_location_limit(brna);
rna_def_constraint_transform(brna);
+ rna_def_constraint_shrinkwrap(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c
index 1c2e5ecee02..df603e7920f 100644
--- a/source/blender/makesrna/intern/rna_controller.c
+++ b/source/blender/makesrna/intern/rna_controller.c
@@ -109,6 +109,7 @@ void RNA_def_controller(BlenderRNA *brna)
prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ID");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text", "Text datablock with the python script.");
/* Other Controllers */
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 3c3aae87f39..bdc33715145 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -370,6 +370,7 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
/* pointers */
prop= RNA_def_property(srna, "text_on_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "textoncurve");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text on Curve", "Curve deforming text object.");
prop= RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE);
@@ -520,10 +521,12 @@ void rna_def_curve(BlenderRNA *brna)
/* pointers */
prop= RNA_def_property(srna, "bevel_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "bevobj");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bevel Object", "Curve object name that defines the bevel shape.");
prop= RNA_def_property(srna, "taper_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "taperobj");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Taper Object", "Curve object name that defines the taper (width).");
/* Flags */
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index a29f6c06b17..49c8c69fbcf 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -559,6 +559,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
memcpy(srna, srnafrom, sizeof(StructRNA));
srna->cont.properties.first= srna->cont.properties.last= NULL;
srna->functions.first= srna->functions.last= NULL;
+ srna->py_type= NULL;
if(DefRNA.preprocess) {
srna->base= srnafrom;
@@ -567,7 +568,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
else
srna->base= srnafrom;
}
-
+
srna->identifier= identifier;
srna->name= identifier; /* may be overwritten later RNA_def_struct_ui_text */
srna->description= "";
@@ -711,7 +712,12 @@ void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *struct
void RNA_def_struct_flag(StructRNA *srna, int flag)
{
- srna->flag= flag;
+ srna->flag |= flag;
+}
+
+void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
+{
+ srna->flag &= ~flag;
}
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
@@ -1058,6 +1064,10 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type)
case PROP_POINTER: {
PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
pprop->type = type;
+
+ if(type && (type->flag & STRUCT_ID_REFCOUNT))
+ prop->flag |= PROP_ID_REFCOUNT;
+
break;
}
case PROP_COLLECTION: {
@@ -1677,7 +1687,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char
}
}
-void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set)
+void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
{
StructRNA *srna= DefRNA.laststruct;
@@ -1692,6 +1702,7 @@ void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char
if(get) eprop->get= (PropEnumGetFunc)get;
if(set) eprop->set= (PropEnumSetFunc)set;
+ if(item) eprop->itemf= (PropEnumItemFunc)item;
break;
}
default:
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index f7292bdce48..bd1c82fc049 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -67,6 +67,7 @@ typedef int (*PropStringLengthFunc)(struct PointerRNA *ptr);
typedef void (*PropStringSetFunc)(struct PointerRNA *ptr, const char *value);
typedef int (*PropEnumGetFunc)(struct PointerRNA *ptr);
typedef void (*PropEnumSetFunc)(struct PointerRNA *ptr, int value);
+typedef EnumPropertyItem *(*PropEnumItemFunc)(struct PointerRNA *ptr);
typedef PointerRNA (*PropPointerGetFunc)(struct PointerRNA *ptr);
typedef void (*PropPointerSetFunc)(struct PointerRNA *ptr, const PointerRNA value);
typedef void (*PropCollectionBeginFunc)(struct CollectionPropertyIterator *iter, struct PointerRNA *ptr);
@@ -213,6 +214,7 @@ typedef struct EnumPropertyRNA {
PropEnumGetFunc get;
PropEnumSetFunc set;
+ PropEnumItemFunc itemf;
const EnumPropertyItem *item;
int totitem;
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index 4289376d3e2..1c4aa7b4eee 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -108,6 +108,7 @@ static void rna_def_lamp_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates.");
prop= RNA_def_property(srna, "map_to_color", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 101cd2a801f..15cca0f3dfa 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -160,6 +160,7 @@ static void rna_def_material_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates.");
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
@@ -735,7 +736,7 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "material_type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Material type defining how the object is rendered.");
- RNA_def_property_enum_funcs(prop, NULL, "rna_Material_type_set");
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Material_type_set", NULL);
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_NONE);
@@ -777,6 +778,7 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "light_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "group");
RNA_def_property_struct_type(prop, "Group");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Light Group", "Limit lighting to lamps in this Group.");
/* flags */
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 3f862199ea0..c75558dafe4 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -467,6 +467,23 @@ static int rna_Mesh_string_layers_length(PointerRNA *ptr)
return rna_CustomDataLayer_length(ptr, CD_PROP_STR);
}
+static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value)
+{
+ MTFace *tf= (MTFace*)ptr->data;
+ ID *id= value.data;
+
+ if(id) {
+ /* special exception here, individual faces don't count
+ * as reference, but we do ensure the refcount is not zero */
+ if(id->us == 0)
+ id_us_plus(id);
+ else
+ id_lib_extern(id);
+ }
+
+ tf->tpage= (struct Image*)id;
+}
+
/* path construction */
static char *rna_VertexGroupElement_path(PointerRNA *ptr)
@@ -747,9 +764,11 @@ static void rna_def_mtface(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Mesh Texture Face", "UV mapping, texturing and game engine data for a face.");
RNA_def_struct_path_func(srna, "rna_MeshTextureFace_path");
- /* prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tpage");
- RNA_def_property_ui_text(prop, "Image", ""); */
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Image", "");
prop= RNA_def_property(srna, "tex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TEX);
@@ -1093,6 +1112,7 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "texco_mesh", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture Space Mesh", "Derive texture coordinates from another mesh");
prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 7fc9f0a689e..bc3da3b5a9e 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -77,6 +77,7 @@ EnumPropertyItem modifier_type_items[] ={
#include "BKE_context.h"
#include "BKE_depsgraph.h"
+#include "BKE_library.h"
static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
@@ -152,11 +153,22 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
}
}
+static char *rna_Modifier_path(PointerRNA *ptr)
+{
+ return BLI_sprintfN("modifiers[%s]", ((ModifierData*)ptr->data)->name); // XXX not unique
+}
+
static void rna_Modifier_update(bContext *C, PointerRNA *ptr)
{
DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA);
}
+static void rna_Modifier_dependency_update(bContext *C, PointerRNA *ptr)
+{
+ rna_Modifier_update(C, ptr);
+ DAG_scene_sort(CTX_data_scene(C));
+}
+
static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value)
{
ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
@@ -273,6 +285,69 @@ static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max
*max = mmd->totlvl;
}
+static void modifier_object_set(Object **ob_p, int type, PointerRNA value)
+{
+ Object *ob= value.data;
+
+ if(!ob || ob->type == type)
+ *ob_p= ob;
+}
+
+static void rna_LatticeModifier_object_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((LatticeModifierData*)ptr->data)->object, OB_LATTICE, value);
+}
+
+static void rna_BooleanModifier_object_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((BooleanModifierData*)ptr->data)->object, OB_MESH, value);
+}
+
+static void rna_CurveModifier_object_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((CurveModifierData*)ptr->data)->object, OB_CURVE, value);
+}
+
+static void rna_ArmatureModifier_object_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((ArmatureModifierData*)ptr->data)->object, OB_ARMATURE, value);
+}
+
+static void rna_MaskModifier_armature_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((MaskModifierData*)ptr->data)->ob_arm, OB_ARMATURE, value);
+}
+
+static void rna_ShrinkwrapModifier_auxiliary_target_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((ShrinkwrapModifierData*)ptr->data)->auxTarget, OB_MESH, value);
+}
+
+static void rna_ShrinkwrapModifier_target_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((ShrinkwrapModifierData*)ptr->data)->target, OB_MESH, value);
+}
+
+static void rna_MeshDeformModifier_object_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((MeshDeformModifierData*)ptr->data)->object, OB_MESH, value);
+}
+
+static void rna_ArrayModifier_end_cap_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((ArrayModifierData*)ptr->data)->end_cap, OB_MESH, value);
+}
+
+static void rna_ArrayModifier_start_cap_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((ArrayModifierData*)ptr->data)->start_cap, OB_MESH, value);
+}
+
+static void rna_ArrayModifier_curve_set(PointerRNA *ptr, PointerRNA value)
+{
+ modifier_object_set(&((ArrayModifierData*)ptr->data)->curve_ob, OB_CURVE, value);
+}
+
#else
static void rna_def_property_subdivision_common(StructRNA *srna, const char type[])
@@ -351,11 +426,11 @@ static void rna_def_modifier_lattice(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Lattice Modifier", "Lattice deformation modifier.");
RNA_def_struct_sdna(srna, "LatticeModifierData");
- prop= RNA_def_property(srna, "lattice", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "object");
- RNA_def_property_struct_type(prop, "Object");
- RNA_def_property_ui_text(prop, "Lattice", "Lattice object to deform with.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with.");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
@@ -382,11 +457,11 @@ static void rna_def_modifier_curve(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Curve Modifier", "Curve deformation modifier.");
RNA_def_struct_sdna(srna, "CurveModifierData");
- prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "object");
- RNA_def_property_struct_type(prop, "Object");
- RNA_def_property_ui_text(prop, "Curve", "Curve object to deform with.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Object", "Curve object to deform with.");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
@@ -483,9 +558,9 @@ static void rna_def_modifier_mirror(BlenderRNA *brna)
prop= RNA_def_property(srna, "mirror_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mirror_ob");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Mirror Object", "Object to use as mirror.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
}
static void rna_def_modifier_decimate(BlenderRNA *brna)
@@ -600,9 +675,9 @@ static void rna_def_modifier_wave(BlenderRNA *brna)
prop= RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "objectcenter");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Start Position Object", "");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
@@ -611,8 +686,8 @@ static void rna_def_modifier_wave(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_ui_text(prop, "Texture", "Texture for modulating the wave.");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE);
@@ -629,9 +704,9 @@ static void rna_def_modifier_wave(BlenderRNA *brna)
prop= RNA_def_property(srna, "texture_coordinates_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "map_object");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Texture Coordinates Object", "");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, FLT_MIN, FLT_MAX);
@@ -669,10 +744,10 @@ static void rna_def_modifier_armature(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "ArmatureModifierData");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "object");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Object", "Armature object to deform with.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
@@ -732,9 +807,9 @@ static void rna_def_modifier_hook(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Object", "Parent Object for hook, also recalculates and clears offset");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
@@ -768,9 +843,10 @@ static void rna_def_modifier_boolean(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "BooleanModifierData");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Object", "Mesh object to use for boolean operation.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_operation_items);
@@ -813,9 +889,10 @@ static void rna_def_modifier_array(BlenderRNA *brna)
prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curve_ob");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Curve", "Curve object to fit array length to.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
/* Offset parameters */
prop= RNA_def_property(srna, "constant_offset", PROP_BOOLEAN, PROP_NONE);
@@ -864,20 +941,22 @@ static void rna_def_modifier_array(BlenderRNA *brna)
prop= RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "offset_ob");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Offset Object", "");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
/* Caps */
prop= RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap.");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
prop= RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "End Cap", "Mesh object to use as an end cap.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
}
static void rna_def_modifier_edgesplit(BlenderRNA *brna)
@@ -937,8 +1016,8 @@ static void rna_def_modifier_displace(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_ui_text(prop, "Texture", "");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
prop= RNA_def_property(srna, "midlevel", PROP_FLOAT, PROP_NONE);
@@ -972,9 +1051,9 @@ static void rna_def_modifier_displace(BlenderRNA *brna)
prop= RNA_def_property(srna, "texture_coordinate_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "map_object");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Texture Coordinate Object", "");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
}
static void rna_def_modifier_uvproject(BlenderRNA *brna)
@@ -998,8 +1077,8 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Projectors", "");
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Image");
RNA_def_property_ui_text(prop, "Image", "");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
prop= RNA_def_property(srna, "horizontal_aspect_ratio", PROP_FLOAT, PROP_NONE);
@@ -1136,11 +1215,11 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "MeshDeform Modifier", "Mesh deformation modifier to deform with other meshes.");
RNA_def_struct_sdna(srna, "MeshDeformModifierData");
- prop= RNA_def_property(srna, "mesh", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "object");
- RNA_def_property_struct_type(prop, "Object");
- RNA_def_property_ui_text(prop, "Mesh", "");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with.");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_INVERT_VGROUP);
@@ -1186,9 +1265,9 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Object", "Object that has the particle system.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "particle_system_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "psys");
@@ -1277,16 +1356,13 @@ static void rna_def_modifier_cloth(BlenderRNA *brna)
prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "sim_parms");
- RNA_def_property_struct_type(prop, "ClothSettings");
RNA_def_property_ui_text(prop, "Cloth Settings", "");
prop= RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coll_parms");
- RNA_def_property_struct_type(prop, "ClothCollisionSettings");
RNA_def_property_ui_text(prop, "Cloth Collision Settings", "");
prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
- RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache", "");
}
@@ -1373,15 +1449,17 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "auxTarget");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vgroup_name");
@@ -1455,7 +1533,6 @@ static void rna_def_modifier_fluidsim(BlenderRNA *brna)
prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "fss");
- RNA_def_property_struct_type(prop, "FluidSettings");
RNA_def_property_ui_text(prop, "Settings", "Settings for how this object is used in the fluid simulation.");
}
@@ -1480,9 +1557,10 @@ static void rna_def_modifier_mask(BlenderRNA *brna)
prop= RNA_def_property(srna, "armature", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob_arm");
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Armature", "Armature to use as source of bones to mask.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vgroup");
@@ -1524,9 +1602,9 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
prop= RNA_def_property(srna, "origin", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Origin", "Origin of modifier space coordinates.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "originOpts", MOD_SIMPLEDEFORM_ORIGIN_LOCAL);
@@ -1567,6 +1645,7 @@ void RNA_def_modifier(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Modifier", NULL);
RNA_def_struct_ui_text(srna , "Modifier", "Modifier affecting the geometry data of an object.");
RNA_def_struct_refine_func(srna, "rna_Modifier_refine");
+ RNA_def_struct_path_func(srna, "rna_Modifier_path");
RNA_def_struct_sdna(srna, "ModifierData");
/* strings */
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index be3e429c1a2..9594a1a4a05 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -31,13 +31,14 @@
#include "rna_internal.h"
#include "DNA_node_types.h"
+#include "DNA_scene_types.h"
#include "BKE_node.h"
#ifdef RNA_RUNTIME
StructRNA *rna_Node_refine(struct PointerRNA *ptr)
{
- bNode *node= (bNode*)ptr->data;
+ bNode *node = (bNode*)ptr->data;
switch(node->type) {
@@ -118,7 +119,7 @@ static StructRNA* def_node(BlenderRNA *brna, int node_id)
StructRNA *srna;
NodeInfo *node = nodes + node_id;
- srna= RNA_def_struct(brna, node->struct_name, node->base_name);
+ srna = RNA_def_struct(brna, node->struct_name, node->base_name);
RNA_def_struct_ui_text(srna, node->ui_name, node->ui_desc);
RNA_def_struct_sdna(srna, "bNode");
@@ -191,9 +192,9 @@ static void def_math(BlenderRNA *brna, int id)
{0, NULL, NULL, NULL}
};
- srna= def_node(brna, id);
+ srna = def_node(brna, id);
- prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, items);
RNA_def_property_ui_text(prop, "Operation", "");
@@ -215,9 +216,9 @@ static void def_vector_math(BlenderRNA *brna, int id)
{0, NULL, NULL, NULL}
};
- srna= def_node(brna, id);
+ srna = def_node(brna, id);
- prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, items);
RNA_def_property_ui_text(prop, "Operation", "");
@@ -228,9 +229,9 @@ static void def_rgb_curve(BlenderRNA *brna, int id)
StructRNA *srna;
PropertyRNA *prop;
- srna= def_node(brna, id);
+ srna = def_node(brna, id);
- prop= RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Mapping", "");
@@ -241,23 +242,44 @@ static void def_vector_curve(BlenderRNA *brna, int id)
StructRNA *srna;
PropertyRNA *prop;
- srna= def_node(brna, id);
+ srna = def_node(brna, id);
- prop= RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Mapping", "");
}
+static void def_time(BlenderRNA *brna, int id)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = def_node(brna, id);
+
+ prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "storage");
+ RNA_def_property_struct_type(prop, "CurveMapping");
+ RNA_def_property_ui_text(prop, "Curve", "");
+
+ prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "custom1");
+ RNA_def_property_ui_text(prop, "Start Frame", "");
+
+ prop = RNA_def_property(srna, "end", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "custom2");
+ RNA_def_property_ui_text(prop, "End Frame", "");
+}
+
static void def_val_to_rgb(BlenderRNA *brna, int id)
{
StructRNA *srna;
// PropertyRNA *prop;
- srna= def_node(brna, id);
+ srna = def_node(brna, id);
/* TODO: uncomment when ColorBand is wrapped */
- /*prop= RNA_def_property(srna, "color_band", PROP_POINTER, PROP_NONE);
+ /*prop = RNA_def_property(srna, "color_band", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "ColorBand");
RNA_def_property_ui_text(prop, "Color Band", "");*/
@@ -288,18 +310,36 @@ static void def_mix_rgb(BlenderRNA *brna, int id)
{0, NULL, NULL, NULL}
};
- srna= def_node(brna, id);
+ srna = def_node(brna, id);
- prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, blend_type_items);
RNA_def_property_ui_text(prop, "Blend Type", "");
- prop= RNA_def_property(srna, "alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
RNA_def_property_ui_text(prop, "Diffuse", "Include alpha of second input in this operation");
}
+static void def_texture(BlenderRNA *brna, int id)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = def_node(brna, id);
+
+ prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "id");
+ RNA_def_property_struct_type(prop, "Texture");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Texture", "");
+
+ prop = RNA_def_property(srna, "node_output", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "custom1");
+ RNA_def_property_ui_text(prop, "Node Output", "For node-based textures, which output node to use");
+}
+
/* -- Shader Node Storage Types --------------------------------------------- */
@@ -308,14 +348,14 @@ static void rna_def_storage_node_geometry(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "NodeGeometry", NULL);
+ srna = RNA_def_struct(brna, "NodeGeometry", NULL);
RNA_def_struct_ui_text(srna, "Node Geometry", "");
- prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvname");
RNA_def_property_ui_text(prop, "UV Layer", "");
- prop= RNA_def_property(srna, "color_layer", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "color_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "colname");
RNA_def_property_ui_text(prop, "Vertex Color Layer", "");
}
@@ -323,44 +363,28 @@ static void rna_def_storage_node_geometry(BlenderRNA *brna)
/* -- Shader Nodes ---------------------------------------------------------- */
-static void def_sh_texture(BlenderRNA *brna, int id)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- srna= def_node(brna, id);
-
- prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "id");
- RNA_def_property_struct_type(prop, "Texture");
- RNA_def_property_ui_text(prop, "Texture", "");
-
- prop= RNA_def_property(srna, "node_output", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "custom1");
- RNA_def_property_ui_text(prop, "Node Output", "For node-based textures, which output node to use");
-}
-
static void def_sh_material(BlenderRNA *brna, int id)
{
StructRNA *srna;
PropertyRNA *prop;
- srna= def_node(brna, id);
+ srna = def_node(brna, id);
- prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "id");
RNA_def_property_struct_type(prop, "Material");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Material", "");
- prop= RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_DIFF);
RNA_def_property_ui_text(prop, "Diffuse", "Material Node outputs Diffuse");
- prop= RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Material Node outputs Specular");
- prop= RNA_def_property(srna, "invert_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_NEG);
RNA_def_property_ui_text(prop, "Invert Normal", "Material Node uses inverted normal");
}
@@ -370,9 +394,9 @@ static void def_sh_mapping(BlenderRNA *brna, int id)
StructRNA *srna;
PropertyRNA *prop;
- srna= def_node(brna, id);
+ srna = def_node(brna, id);
- prop= RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "TexMapping");
RNA_def_property_ui_text(prop, "Mapping", "");
@@ -383,18 +407,235 @@ static void def_sh_geometry(BlenderRNA *brna, int id)
StructRNA *srna;
PropertyRNA *prop;
- srna= def_node(brna, id);
+ srna = def_node(brna, id);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "NodeGeometry");
RNA_def_property_ui_text(prop, "Settings", "");
}
+
+/* -- Compositor Node Storage Types ----------------------------------------- */
+
+static void rna_def_storage_node_blur_data(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem filter_type_items[] ={
+ {R_FILTER_BOX, "FLAT", "Flat", ""},
+ {R_FILTER_TENT, "TENT", "Tent", ""},
+ {R_FILTER_QUAD, "QUAD", "Quadratic", ""},
+ {R_FILTER_CUBIC, "CUBIC", "Cubic", ""},
+ {R_FILTER_GAUSS, "GAUSS", "Gaussian", ""},
+ {R_FILTER_FAST_GAUSS, "FAST_GAUSS", "Fast Gaussian", ""},
+ {R_FILTER_CATROM, "CATROM", "Catrom", ""},
+ {R_FILTER_MITCH, "MITCH", "Mitch", ""},
+ {0, NULL, NULL, NULL}
+ };
+
+ srna = RNA_def_struct(brna, "NodeBlurData", NULL);
+ RNA_def_struct_ui_text(srna, "Node Blur Data", "");
+
+ /**/
+
+ prop = RNA_def_property(srna, "sizex", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "sizex");
+ RNA_def_property_ui_text(prop, "Size X", "");
+
+ prop = RNA_def_property(srna, "sizey", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "sizey");
+ RNA_def_property_ui_text(prop, "Size Y", "");
+
+ /**/
+
+ prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "samples");
+ RNA_def_property_ui_text(prop, "Samples", "");
+
+ /**/
+
+ prop = RNA_def_property(srna, "max_speed", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "maxspeed");
+ RNA_def_property_ui_text(prop, "Max Speed", "");
+
+ prop = RNA_def_property(srna, "min_speed", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "minspeed");
+ RNA_def_property_ui_text(prop, "Min Speed", "");
+
+ /**/
+
+ prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "relative", 1);
+ RNA_def_property_ui_text(prop, "Relative", "");
+
+ /**/
+
+ prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fac");
+ RNA_def_property_ui_text(prop, "Factor", "");
+
+ /* These aren't percentages */
+ prop = RNA_def_property(srna, "factor_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "percentx");
+ RNA_def_property_ui_text(prop, "Relative Size X", "");
+
+ prop = RNA_def_property(srna, "factor_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "percenty");
+ RNA_def_property_ui_text(prop, "Relative Size Y", "");
+
+ /**/
+
+ prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "filtertype");
+ RNA_def_property_enum_items(prop, filter_type_items);
+ RNA_def_property_ui_text(prop, "Filter Type", "");
+
+ /**/
+
+ prop = RNA_def_property(srna, "bokeh", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "bokeh", 1);
+ RNA_def_property_ui_text(prop, "Bokeh", "");
+
+ prop = RNA_def_property(srna, "gamma", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gamma", 1);
+ RNA_def_property_ui_text(prop, "Gamma", "");
+
+ /*
+ Also:
+ curved
+ image_in_width
+ image_in_height
+
+ Don't know if these need wrapping
+ */
+
+}
+
+
/* -- Compositor Nodes ------------------------------------------------------ */
+static void def_cmp_alpha_over(BlenderRNA *brna, int id)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = def_node(brna, id);
+
+ prop = RNA_def_property(srna, "convert_premul", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
+ RNA_def_property_ui_text(prop, "convert_premul", "TODO: don't know what this is");
+
+ /* TODO: uses NodeTwoFloats storage */
+}
+
+static void def_cmp_blur(BlenderRNA *brna, int id)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = def_node(brna, id);
+
+ prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "storage");
+ RNA_def_property_struct_type(prop, "NodeBlurData");
+ RNA_def_property_ui_text(prop, "Settings", "");
+}
+
+static void def_cmp_filter(BlenderRNA *brna, int id)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem type_items[] ={
+ {0, "SOFTEN", "Soften", ""},
+ {1, "SHARPEN", "Sharpen", ""},
+ {2, "LAPLACE", "Laplace", ""},
+ {3, "SOBEL", "Sobel", ""},
+ {4, "PREWITT", "Prewitt", ""},
+ {5, "KIRSCH", "Kirsch", ""},
+ {6, "SHADOW", "Shadow", ""},
+ {0, NULL, NULL, NULL}
+ };
+
+ srna = def_node(brna, id);
+
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "custom1");
+ RNA_def_property_enum_items(prop, type_items);
+ RNA_def_property_ui_text(prop, "Type", "");
+}
+
+
+/* -- Texture Node Storage Types --------------------------------------------- */
+
+static void rna_def_storage_tex_node_output(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "TexNodeOutput", NULL);
+ RNA_def_struct_ui_text(srna, "Texture Node Output", "");
+
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_ui_text(prop, "Name", "");
+}
+
+
/* -- Texture Nodes --------------------------------------------------------- */
+static void def_tex_output(BlenderRNA *brna, int id)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = def_node(brna, id);
+
+ prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "storage");
+ RNA_def_property_struct_type(prop, "TexNodeOutput");
+ RNA_def_property_ui_text(prop, "Settings", "");
+}
+
+static void def_tex_image(BlenderRNA *brna, int id)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = def_node(brna, id);
+
+ prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "storage");
+ RNA_def_property_struct_type(prop, "ImageUser");
+ RNA_def_property_ui_text(prop, "Settings", "");
+}
+
+static void def_tex_bricks(BlenderRNA *brna, int id)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = def_node(brna, id);
+
+ prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "custom3");
+ RNA_def_property_ui_text(prop, "Offset Amount", "");
+
+ prop = RNA_def_property(srna, "offset_frequency", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "custom1");
+ RNA_def_property_ui_text(prop, "Offset Frequency", "Offset every N rows");
+
+ prop = RNA_def_property(srna, "squash", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "custom4");
+ RNA_def_property_ui_text(prop, "Squash Amount", "");
+
+ prop = RNA_def_property(srna, "squash_frequency", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "custom2");
+ RNA_def_property_ui_text(prop, "Squash Frequency", "Squash every N rows");
+}
+
/* -------------------------------------------------------------------------- */
static void rna_def_shader_node(BlenderRNA *brna)
@@ -405,11 +646,11 @@ static void rna_def_shader_node(BlenderRNA *brna)
node_type_items = alloc_node_type_items(Category_ShaderNode);
- srna= RNA_def_struct(brna, "ShaderNode", "Node");
+ srna = RNA_def_struct(brna, "ShaderNode", "Node");
RNA_def_struct_ui_text(srna, "Shader Node", "Material shader node.");
RNA_def_struct_sdna(srna, "bNode");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, node_type_items);
RNA_def_property_ui_text(prop, "Type", "");
@@ -426,14 +667,17 @@ static void rna_def_compositor_node(BlenderRNA *brna)
node_type_items = alloc_node_type_items(Category_CompositorNode);
- srna= RNA_def_struct(brna, "CompositorNode", "Node");
+ srna = RNA_def_struct(brna, "CompositorNode", "Node");
RNA_def_struct_ui_text(srna, "Compositor Node", "");
RNA_def_struct_sdna(srna, "bNode");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, node_type_items);
RNA_def_property_ui_text(prop, "Type", "");
+
+ /* Compositor storage types */
+ rna_def_storage_node_blur_data(brna);
}
static void rna_def_texture_node(BlenderRNA *brna)
@@ -444,14 +688,17 @@ static void rna_def_texture_node(BlenderRNA *brna)
node_type_items = alloc_node_type_items(Category_TextureNode);
- srna= RNA_def_struct(brna, "TextureNode", "Node");
+ srna = RNA_def_struct(brna, "TextureNode", "Node");
RNA_def_struct_ui_text(srna, "Texture Node", "");
RNA_def_struct_sdna(srna, "bNode");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, node_type_items);
RNA_def_property_ui_text(prop, "Type", "");
+
+ /* Texture storage types */
+ rna_def_storage_tex_node_output(brna);
}
/* -------------------------------------------------------------------------- */
@@ -461,18 +708,18 @@ static void rna_def_node(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Node", NULL);
+ srna = RNA_def_struct(brna, "Node", NULL);
RNA_def_struct_ui_text(srna, "Node", "Node in a node tree.");
RNA_def_struct_sdna(srna, "bNode");
RNA_def_struct_refine_func(srna, "rna_Node_refine");
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
RNA_def_property_float_sdna(prop, NULL, "locx");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, -10000.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Location", "");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Node name.");
RNA_def_struct_name_property(srna, prop);
}
@@ -482,11 +729,11 @@ static void rna_def_nodetree(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "NodeTree", "ID");
+ srna = RNA_def_struct(brna, "NodeTree", "ID");
RNA_def_struct_ui_text(srna, "Node Tree", "Node tree consisting of linked nodes used for materials, textures and compositing.");
RNA_def_struct_sdna(srna, "bNodeTree");
- prop= RNA_def_property(srna, "nodes", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "nodes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "nodes", NULL);
RNA_def_property_struct_type(prop, "Node");
RNA_def_property_ui_text(prop, "Nodes", "");
diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h
index 00b7f7e62cb..0c333dfef56 100644
--- a/source/blender/makesrna/intern/rna_nodetree_types.h
+++ b/source/blender/makesrna/intern/rna_nodetree_types.h
@@ -17,10 +17,12 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * Contributor(s): Blender Foundation (2008), Robin Allen
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
+
+#define TODO 0
/* Tree type Node ID RNA def function Enum name Struct name UI Name UI Description */
DefNode( ShaderNode, SH_NODE_OUTPUT, 0, "OUTPUT", Output, "Output", "" )
@@ -30,7 +32,7 @@ DefNode( ShaderNode, SH_NODE_VALUE, 0, "VALUE",
DefNode( ShaderNode, SH_NODE_MIX_RGB, def_mix_rgb, "MIX_RGB", MixRGB, "MixRGB", "" )
DefNode( ShaderNode, SH_NODE_VALTORGB, def_val_to_rgb, "VALTORGB", ValToRGB, "Value to RGB", "" )
DefNode( ShaderNode, SH_NODE_RGBTOBW, 0, "RGBTOBW", RGBToBW, "RGB to BW", "" )
-DefNode( ShaderNode, SH_NODE_TEXTURE, def_sh_texture, "TEXTURE", Texture, "Texture", "" )
+DefNode( ShaderNode, SH_NODE_TEXTURE, def_texture, "TEXTURE", Texture, "Texture", "" )
DefNode( ShaderNode, SH_NODE_NORMAL, 0, "NORMAL", Normal, "Normal", "" )
DefNode( ShaderNode, SH_NODE_GEOMETRY, def_sh_geometry, "GEOMETRY", Geometry, "Geometry", "" )
DefNode( ShaderNode, SH_NODE_MAPPING, def_sh_mapping, "MAPPING", Mapping, "Mapping", "" )
@@ -49,76 +51,76 @@ DefNode( ShaderNode, SH_NODE_HUE_SAT, 0, "HUE_SAT"
DefNode( CompositorNode, CMP_NODE_VIEWER, 0, "VIEWER", Viewer, "Viewer", "" )
DefNode( CompositorNode, CMP_NODE_RGB, 0, "RGB", RGB, "RGB", "" )
DefNode( CompositorNode, CMP_NODE_VALUE, 0, "VALUE", Value, "Value", "" )
-DefNode( CompositorNode, CMP_NODE_MIX_RGB, 0, "MIX_RGB", MixRGB, "Mix RGB", "" )
-DefNode( CompositorNode, CMP_NODE_VALTORGB, 0, "VALTORGB", ValToRGB, "Val to RGB", "" )
+DefNode( CompositorNode, CMP_NODE_MIX_RGB, def_mix_rgb, "MIX_RGB", MixRGB, "Mix RGB", "" )
+DefNode( CompositorNode, CMP_NODE_VALTORGB, def_val_to_rgb, "VALTORGB", ValToRGB, "Val to RGB", "" )
DefNode( CompositorNode, CMP_NODE_RGBTOBW, 0, "RGBTOBW", RGBToBW, "RGB to BW", "" )
DefNode( CompositorNode, CMP_NODE_NORMAL, 0, "NORMAL", Normal, "Normal", "" )
-DefNode( CompositorNode, CMP_NODE_CURVE_VEC, 0, "CURVE_VEC", CurveVec, "Vector Curve", "" )
-DefNode( CompositorNode, CMP_NODE_CURVE_RGB, 0, "CURVE_RGB", CurveRGB, "RGB Curve", "" )
-DefNode( CompositorNode, CMP_NODE_ALPHAOVER, 0, "ALPHAOVER", AlphaOver, "Alpha Over", "" )
-DefNode( CompositorNode, CMP_NODE_BLUR, 0, "BLUR", Blur, "Blur", "" )
-DefNode( CompositorNode, CMP_NODE_FILTER, 0, "FILTER", Filter, "Filter", "" )
-DefNode( CompositorNode, CMP_NODE_MAP_VALUE, 0, "MAP_VALUE", MapValue, "Map Value", "" )
-DefNode( CompositorNode, CMP_NODE_TIME, 0, "TIME", Time, "Time", "" )
-DefNode( CompositorNode, CMP_NODE_VECBLUR, 0, "VECBLUR", VecBlur, "Vector Blur", "" )
+DefNode( CompositorNode, CMP_NODE_CURVE_VEC, def_vector_curve, "CURVE_VEC", CurveVec, "Vector Curve", "" )
+DefNode( CompositorNode, CMP_NODE_CURVE_RGB, def_rgb_curve, "CURVE_RGB", CurveRGB, "RGB Curve", "" )
+DefNode( CompositorNode, CMP_NODE_ALPHAOVER, def_cmp_alpha_over, "ALPHAOVER", AlphaOver, "Alpha Over", "" )
+DefNode( CompositorNode, CMP_NODE_BLUR, def_cmp_blur, "BLUR", Blur, "Blur", "" )
+DefNode( CompositorNode, CMP_NODE_FILTER, def_cmp_filter, "FILTER", Filter, "Filter", "" )
+DefNode( CompositorNode, CMP_NODE_MAP_VALUE, TODO, "MAP_VALUE", MapValue, "Map Value", "" )
+DefNode( CompositorNode, CMP_NODE_TIME, def_time, "TIME", Time, "Time", "" )
+DefNode( CompositorNode, CMP_NODE_VECBLUR, TODO, "VECBLUR", VecBlur, "Vector Blur", "" )
DefNode( CompositorNode, CMP_NODE_SEPRGBA, 0, "SEPRGBA", SepRGBA, "Separate RGBA", "" )
DefNode( CompositorNode, CMP_NODE_SEPHSVA, 0, "SEPHSVA", SepHSVA, "Separate HSVA", "" )
DefNode( CompositorNode, CMP_NODE_SETALPHA, 0, "SETALPHA", SetAlpha, "Set Alpha", "" )
DefNode( CompositorNode, CMP_NODE_HUE_SAT, 0, "HUE_SAT", HueSat, "Hue/Saturation", "" )
-DefNode( CompositorNode, CMP_NODE_IMAGE, 0, "IMAGE", Image, "Image", "" )
-DefNode( CompositorNode, CMP_NODE_R_LAYERS, 0, "R_LAYERS", RLayers, "Render Layers", "" )
+DefNode( CompositorNode, CMP_NODE_IMAGE, TODO, "IMAGE", Image, "Image", "" )
+DefNode( CompositorNode, CMP_NODE_R_LAYERS, TODO, "R_LAYERS", RLayers, "Render Layers", "" )
DefNode( CompositorNode, CMP_NODE_COMPOSITE, 0, "COMPOSITE", Composite, "Composite", "" )
-DefNode( CompositorNode, CMP_NODE_OUTPUT_FILE, 0, "OUTPUT_FILE", OutputFile, "Output File", "" )
-DefNode( CompositorNode, CMP_NODE_TEXTURE, 0, "TEXTURE", Texture, "Texture", "" )
+DefNode( CompositorNode, CMP_NODE_OUTPUT_FILE, TODO, "OUTPUT_FILE", OutputFile, "Output File", "" )
+DefNode( CompositorNode, CMP_NODE_TEXTURE, TODO, "TEXTURE", Texture, "Texture", "" )
DefNode( CompositorNode, CMP_NODE_TRANSLATE, 0, "TRANSLATE", Translate, "Translate", "" )
DefNode( CompositorNode, CMP_NODE_ZCOMBINE, 0, "ZCOMBINE", Zcombine, "Z Combine", "" )
DefNode( CompositorNode, CMP_NODE_COMBRGBA, 0, "COMBRGBA", CombRGBA, "Combine RGBA", "" )
-DefNode( CompositorNode, CMP_NODE_DILATEERODE, 0, "DILATEERODE", DilateErode, "Dilate/Erode", "" )
+DefNode( CompositorNode, CMP_NODE_DILATEERODE, TODO, "DILATEERODE", DilateErode, "Dilate/Erode", "" )
DefNode( CompositorNode, CMP_NODE_ROTATE, 0, "ROTATE", Rotate, "Rotate", "" )
-DefNode( CompositorNode, CMP_NODE_SCALE, 0, "SCALE", Scale, "Scale", "" )
+DefNode( CompositorNode, CMP_NODE_SCALE, TODO, "SCALE", Scale, "Scale", "" )
DefNode( CompositorNode, CMP_NODE_SEPYCCA, 0, "SEPYCCA", SepYCCA, "Separate YCCA", "" )
DefNode( CompositorNode, CMP_NODE_COMBYCCA, 0, "COMBYCCA", CombYCCA, "Combine YCCA", "" )
DefNode( CompositorNode, CMP_NODE_SEPYUVA, 0, "SEPYUVA", SepYUVA, "Separate YUVA", "" )
DefNode( CompositorNode, CMP_NODE_COMBYUVA, 0, "COMBYUVA", CombYUVA, "Combine YUVA", "" )
-DefNode( CompositorNode, CMP_NODE_DIFF_MATTE, 0, "DIFF_MATTE", DiffMatte, "Diff Matte", "" )
-DefNode( CompositorNode, CMP_NODE_COLOR_SPILL, 0, "COLOR_SPILL", ColorSpill, "Color Spill", "" )
-DefNode( CompositorNode, CMP_NODE_CHROMA, 0, "CHROMA", Chroma, "Chroma", "" )
-DefNode( CompositorNode, CMP_NODE_CHANNEL_MATTE, 0, "CHANNEL_MATTE", ChannelMatte, "Channel Matte", "" )
-DefNode( CompositorNode, CMP_NODE_FLIP, 0, "FLIP", Flip, "Flip", "" )
-DefNode( CompositorNode, CMP_NODE_SPLITVIEWER, 0, "SPLITVIEWER", SplitViewer, "Split Viewer", "" )
-DefNode( CompositorNode, CMP_NODE_INDEX_MASK, 0, "INDEX_MASK", IndexMask, "Index Mask", "" )
-DefNode( CompositorNode, CMP_NODE_MAP_UV, 0, "MAP_UV", MapUV, "Map UV", "" )
-DefNode( CompositorNode, CMP_NODE_ID_MASK, 0, "ID_MASK", IDMask, "ID Mask", "" )
-DefNode( CompositorNode, CMP_NODE_DEFOCUS, 0, "DEFOCUS", Defocus, "Defocus", "" )
+DefNode( CompositorNode, CMP_NODE_DIFF_MATTE, TODO, "DIFF_MATTE", DiffMatte, "Diff Matte", "" )
+DefNode( CompositorNode, CMP_NODE_COLOR_SPILL, TODO, "COLOR_SPILL", ColorSpill, "Color Spill", "" )
+DefNode( CompositorNode, CMP_NODE_CHROMA, TODO, "CHROMA", Chroma, "Chroma", "" )
+DefNode( CompositorNode, CMP_NODE_CHANNEL_MATTE, TODO, "CHANNEL_MATTE", ChannelMatte, "Channel Matte", "" )
+DefNode( CompositorNode, CMP_NODE_FLIP, TODO, "FLIP", Flip, "Flip", "" )
+DefNode( CompositorNode, CMP_NODE_SPLITVIEWER, TODO, "SPLITVIEWER", SplitViewer, "Split Viewer", "" )
+DefNode( CompositorNode, CMP_NODE_INDEX_MASK, TODO, "INDEX_MASK", IndexMask, "Index Mask", "" )
+DefNode( CompositorNode, CMP_NODE_MAP_UV, TODO, "MAP_UV", MapUV, "Map UV", "" )
+DefNode( CompositorNode, CMP_NODE_ID_MASK, TODO, "ID_MASK", IDMask, "ID Mask", "" )
+DefNode( CompositorNode, CMP_NODE_DEFOCUS, TODO, "DEFOCUS", Defocus, "Defocus", "" )
DefNode( CompositorNode, CMP_NODE_DISPLACE, 0, "DISPLACE", Displace, "Displace", "" )
DefNode( CompositorNode, CMP_NODE_COMBHSVA, 0, "COMBHSVA", CombHSVA, "Combine HSVA", "" )
DefNode( CompositorNode, CMP_NODE_MATH, def_math, "MATH", Math, "Math", "" )
-DefNode( CompositorNode, CMP_NODE_LUMA_MATTE, 0, "LUMA_MATTE", LumaMatte, "Luma Matte", "" )
+DefNode( CompositorNode, CMP_NODE_LUMA_MATTE, TODO, "LUMA_MATTE", LumaMatte, "Luma Matte", "" )
DefNode( CompositorNode, CMP_NODE_BRIGHTCONTRAST, 0, "BRIGHTCONTRAST", BrightContrast, "Bright Contrast", "" )
DefNode( CompositorNode, CMP_NODE_GAMMA, 0, "GAMMA", Gamma, "Gamma", "" )
-DefNode( CompositorNode, CMP_NODE_INVERT, 0, "INVERT", Invert, "Invert", "" )
+DefNode( CompositorNode, CMP_NODE_INVERT, TODO, "INVERT", Invert, "Invert", "" )
DefNode( CompositorNode, CMP_NODE_NORMALIZE, 0, "NORMALIZE", Normalize, "Normalize", "" )
-DefNode( CompositorNode, CMP_NODE_CROP, 0, "CROP", Crop, "Crop", "" )
-DefNode( CompositorNode, CMP_NODE_DBLUR, 0, "DBLUR", DBlur, "DBlur", "" )
-DefNode( CompositorNode, CMP_NODE_BILATERALBLUR, 0, "BILATERALBLUR", Bilateralblur, "Bilateral Blur", "" )
-DefNode( CompositorNode, CMP_NODE_PREMULKEY, 0, "PREMULKEY", PremulKey, "Premul Key", "" )
-DefNode( CompositorNode, CMP_NODE_GLARE, 0, "GLARE", Glare, "Glare", "" )
-DefNode( CompositorNode, CMP_NODE_TONEMAP, 0, "TONEMAP", Tonemap, "Tonemap", "" )
-DefNode( CompositorNode, CMP_NODE_LENSDIST, 0, "LENSDIST", Lensdist, "Lensdist", "" )
+DefNode( CompositorNode, CMP_NODE_CROP, TODO, "CROP", Crop, "Crop", "" )
+DefNode( CompositorNode, CMP_NODE_DBLUR, TODO, "DBLUR", DBlur, "DBlur", "" )
+DefNode( CompositorNode, CMP_NODE_BILATERALBLUR, TODO, "BILATERALBLUR", Bilateralblur, "Bilateral Blur", "" )
+DefNode( CompositorNode, CMP_NODE_PREMULKEY, TODO, "PREMULKEY", PremulKey, "Premul Key", "" )
+DefNode( CompositorNode, CMP_NODE_GLARE, TODO, "GLARE", Glare, "Glare", "" )
+DefNode( CompositorNode, CMP_NODE_TONEMAP, TODO, "TONEMAP", Tonemap, "Tonemap", "" )
+DefNode( CompositorNode, CMP_NODE_LENSDIST, TODO, "LENSDIST", Lensdist, "Lensdist", "" )
-DefNode( TextureNode, TEX_NODE_OUTPUT, 0, "OUTPUT", Output, "Output", "" )
+DefNode( TextureNode, TEX_NODE_OUTPUT, def_tex_output, "OUTPUT", Output, "Output", "" )
DefNode( TextureNode, TEX_NODE_CHECKER, 0, "CHECKER", Checker, "Checker", "" )
-DefNode( TextureNode, TEX_NODE_TEXTURE, 0, "TEXTURE", Texture, "Texture", "" )
-DefNode( TextureNode, TEX_NODE_BRICKS, 0, "BRICKS", Bricks, "Bricks", "" )
+DefNode( TextureNode, TEX_NODE_TEXTURE, def_texture, "TEXTURE", Texture, "Texture", "" )
+DefNode( TextureNode, TEX_NODE_BRICKS, def_tex_bricks, "BRICKS", Bricks, "Bricks", "" )
DefNode( TextureNode, TEX_NODE_MATH, def_math, "MATH", Math, "Math", "" )
DefNode( TextureNode, TEX_NODE_MIX_RGB, def_mix_rgb, "MIX_RGB", MixRGB, "Mix RGB", "" )
DefNode( TextureNode, TEX_NODE_RGBTOBW, 0, "RGBTOBW", RGBToBW, "RGB To BW", "" )
DefNode( TextureNode, TEX_NODE_VALTORGB, def_val_to_rgb, "VALTORGB", ValToRGB, "Val To RGB", "" )
-DefNode( TextureNode, TEX_NODE_IMAGE, 0, "IMAGE", Image, "Image", "" )
+DefNode( TextureNode, TEX_NODE_IMAGE, def_tex_image, "IMAGE", Image, "Image", "" )
DefNode( TextureNode, TEX_NODE_CURVE_RGB, def_rgb_curve, "CURVE_RGB", CurveRGB, "RGB Curve", "" )
DefNode( TextureNode, TEX_NODE_INVERT, 0, "INVERT", Invert, "Invert", "" )
DefNode( TextureNode, TEX_NODE_HUE_SAT, 0, "HUE_SAT", HueSaturation, "Hue/Saturation", "" )
-DefNode( TextureNode, TEX_NODE_CURVE_TIME, 0, "CURVE_TIME", CurveTime, "Curve Time", "" )
+DefNode( TextureNode, TEX_NODE_CURVE_TIME, def_time, "CURVE_TIME", CurveTime, "Curve Time", "" )
DefNode( TextureNode, TEX_NODE_ROTATE, 0, "ROTATE", Rotate, "Rotate", "" )
DefNode( TextureNode, TEX_NODE_VIEWER, 0, "VIEWER", Viewer, "Viewer", "" )
DefNode( TextureNode, TEX_NODE_TRANSLATE, 0, "TRANSLATE", Translate, "Translate", "" )
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index cbc80e68b4a..32af373862b 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -42,6 +42,7 @@
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_material.h"
+#include "BKE_particle.h"
static void rna_Object_update(bContext *C, PointerRNA *ptr)
{
@@ -202,6 +203,13 @@ static void rna_Object_active_material_link_set(PointerRNA *ptr, int value)
ob->colbits &= ~(1<<(ob->actcol));
}
+static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+ ParticleSystem *psys= psys_get_current(ob);
+ return rna_pointer_inherit_refine(ptr, &RNA_ParticleSystem, psys);
+}
+
static PointerRNA rna_Object_game_settings_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_GameObjectSettings, ptr->id.data);
@@ -513,6 +521,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Object", "ID");
RNA_def_struct_ui_text(srna, "Object", "Object datablock defining an object in a scene..");
+ RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ID");
@@ -556,6 +565,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Parent Bone", "Name of parent bone in case of a bone parenting relation.");
prop= RNA_def_property(srna, "track", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track).");
prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
@@ -584,7 +594,6 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Materials", "");
prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", NULL);
RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed.");
@@ -596,7 +605,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_material_link", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, material_link_items);
- RNA_def_property_enum_funcs(prop, "rna_Object_active_material_link_get", "rna_Object_active_material_link_set");
+ RNA_def_property_enum_funcs(prop, "rna_Object_active_material_link_get", "rna_Object_active_material_link_set", NULL);
RNA_def_property_ui_text(prop, "Active Material Link", "Use material from object or data for the active material.");
/* transform */
@@ -719,6 +728,11 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object.");
+ prop= RNA_def_property(srna, "active_particle_system", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ParticleSystem");
+ RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL);
+ RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed");
+
/* restrict */
prop= RNA_def_property(srna, "restrict_view", PROP_BOOLEAN, PROP_NONE);
@@ -765,6 +779,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "dupli_frames_no_speed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED);
RNA_def_property_ui_text(prop, "Dupli Frames No Speed", "Set dupliframes to still, regardless of frame.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
prop= RNA_def_property(srna, "dupli_verts_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT);
@@ -774,6 +789,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "dupli_faces_inherit_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT);
RNA_def_property_ui_text(prop, "Dupli Faces Inherit Scale", "Scale dupli based on face size.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
prop= RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dupfacesca");
@@ -783,27 +799,33 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dupli Group", "Instance an existing group.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
prop= RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dupsta");
RNA_def_property_range(prop, 1, 32767);
RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
prop= RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dupend");
RNA_def_property_range(prop, 1, 32767);
RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
prop= RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dupon");
RNA_def_property_range(prop, 1, 1500);
RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
prop= RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dupoff");
RNA_def_property_range(prop, 0, 1500);
RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
/* time offset */
@@ -836,7 +858,6 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "script_link", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "scriptlink");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Script Link", "Scripts linked to this object.");
/* drawing */
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 2b65f890bd2..36a1992670a 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -173,6 +173,7 @@ static void rna_def_particle(BlenderRNA *brna)
prop= RNA_def_property(srna, "stick_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "stick_ob");
RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Stick Object", "Object that particle sticks to when dead");
// ParticleKey state; /* normally current global coordinates or */
@@ -837,10 +838,10 @@ static void rna_def_particle_settings(BlenderRNA *brna)
//float rt; TODO:find where rt is used - can't find it in UI
- prop= RNA_def_property(srna, "total_particles", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "amount", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "totpart");
RNA_def_property_range(prop, 0, 100000);
- RNA_def_property_ui_text(prop, "Particle Amount", "The total number of particles.");
+ RNA_def_property_ui_text(prop, "Amount", "Total number of particles.");
prop= RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);//TODO: can we get a better name for userjit?
RNA_def_property_int_sdna(prop, NULL, "userjit");
@@ -1134,21 +1135,25 @@ static void rna_def_particle_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
RNA_def_property_struct_type(prop, "Group");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dupli Group", "Show Objects in this Group in place of particles");
prop= RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
RNA_def_property_struct_type(prop, "Group");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this Group.");
prop= RNA_def_property(srna, "dupli_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "dup_ob");
RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dupli Object", "Show this Object in place of particles.");
prop= RNA_def_property(srna, "billboard_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "bb_ob");
RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)");
#if 0
@@ -1205,6 +1210,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
/* reactor */
prop= RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "target_ob");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Reactor Target Object", "For reactor systems, the object that has the target particle system (empty if same object).");
prop= RNA_def_property(srna, "reactor_target_particle_system", PROP_INT, PROP_UNSIGNED);
@@ -1215,11 +1221,13 @@ static void rna_def_particle_system(BlenderRNA *brna)
/* boids */
prop= RNA_def_property(srna, "boids_surface_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "keyed_ob");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Boids Surface Object", "For boids physics systems, constrain boids to this object's surface.");
/* keyed */
prop= RNA_def_property(srna, "keyed_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "keyed_ob");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Keyed Object", "For keyed physics systems, the object that has the target particle system.");
prop= RNA_def_property(srna, "keyed_particle_system", PROP_INT, PROP_UNSIGNED);
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 55a0f67390e..05aa10ec2eb 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -667,13 +667,13 @@ static void rna_def_property(BlenderRNA *brna)
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, type_items);
- RNA_def_property_enum_funcs(prop, "rna_Property_type_get", NULL);
+ RNA_def_property_enum_funcs(prop, "rna_Property_type_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Type", "Data type of the property.");
prop= RNA_def_property(srna, "subtype", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, subtype_items);
- RNA_def_property_enum_funcs(prop, "rna_Property_subtype_get", NULL);
+ RNA_def_property_enum_funcs(prop, "rna_Property_subtype_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Subtype", "Semantic interpretation of the property.");
prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 6bee1367a86..caa6e73903a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -566,7 +566,7 @@ void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_DIRPATH);
+ prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -607,6 +607,7 @@ void RNA_def_scene(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Scene", "ID");
RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings.");
+ RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index 90a0972fa03..265b59c97ae 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -197,6 +197,7 @@ void rna_def_touch_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ma");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Material", "Only look for floors with this material.");
}
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 2b5c3a621b4..56967a84903 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -29,7 +29,9 @@
#include "rna_internal.h"
+#include "DNA_object_types.h"
#include "DNA_space_types.h"
+#include "DNA_view3d_types.h"
#include "WM_types.h"
@@ -65,13 +67,14 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
SpaceLink *space= (SpaceLink*)ptr->data;
switch(space->spacetype) {
- /*case SPACE_VIEW3D:
- return &RNA_SpaceView3D;
- case SPACE_IPO:
+ case SPACE_VIEW3D:
+ return &RNA_Space3DView;
+ /*case SPACE_IPO:
return &RNA_SpaceGraphEditor;
+ */
case SPACE_OUTLINER:
return &RNA_SpaceOutliner;
- case SPACE_BUTS:
+ /* case SPACE_BUTS:
return &RNA_SpaceButtonsWindow;
case SPACE_FILE:
return &RNA_SpaceFileBrowser;*/
@@ -250,6 +253,224 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices.");
}
+static void rna_def_space_outliner(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem display_mode_items[] = {
+ {0, "ALL_SCENES", "All Scenes", ""},
+ {1, "CURRENT_SCENE", "Current Scene", ""},
+ {2, "VISIBLE_LAYERS", "Visible Layers", ""},
+ {3, "SELECTED", "Selected", ""},
+ {4, "ACTIVE", "Active", ""},
+ {5, "SAME_TYPES", "Same Types", ""},
+ {6, "GROUPS", "Groups", ""},
+ {7, "LIBRARIES", "Libraries", ""},
+ {10, "SEQUENCE", "Sequence", ""},
+ {11, "DATABLOCKS", "Datablocks", ""},
+ {12, "USER_PREFERENCES", "User Preferences", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "SpaceOutliner", "Space");
+ RNA_def_struct_sdna(srna, "SpaceOops");
+ RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data.");
+
+ prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "outlinevis");
+ RNA_def_property_enum_items(prop, display_mode_items);
+ RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
+
+ prop= RNA_def_property(srna, "show_restriction_columns", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
+ RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show colum");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
+
+}
+
+static void rna_def_background_image(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "BackgroundImage", NULL);
+ RNA_def_struct_sdna(srna, "BGpic");
+ RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background.");
+
+ prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "ima");
+ RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space.");
+
+ prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "iuser");
+ RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
+
+ prop= RNA_def_property(srna, "x_offset", 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");
+
+ prop= RNA_def_property(srna, "y_offset", 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");
+
+ prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "size");
+ RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image.");
+ RNA_def_property_range(prop, 0.0, FLT_MAX);
+
+ prop= RNA_def_property(srna, "transparency", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "blend");
+ RNA_def_property_ui_text(prop, "Transparency", "Amount to blend the image against the background color.");
+ RNA_def_property_range(prop, 0.0, 1.0);
+
+}
+
+static void rna_def_space_3dview(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem viewport_shading_items[] = {
+ {OB_BOUNDBOX, "BOUNDBOX", "Bounding Box", "Display the object's local bounding boxes only"},
+ {OB_WIRE, "WIREFRAME", "Wireframe", "Display the object as wire edges"},
+ {OB_SOLID, "SOLID", "Solid", "Display the object solid, lit with default OpenGL lights"},
+ {OB_SHADED, "SHADED", "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
+ {OB_TEXTURE, "TEXTURED", "Textured", "Display the object solid, with face-assigned textures"},
+ {0, NULL, NULL, NULL}};
+
+ static EnumPropertyItem pivot_items[] = {
+ {V3D_CENTER, "BOUNDING_BOX_CENTER", "Bounding Box Center", ""},
+ {V3D_CURSOR, "CURSOR", "3D Cursor", ""},
+ {V3D_LOCAL, "INDIVIDUAL_CENTERS", "Individual Centers", ""},
+ {V3D_CENTROID, "MEDIAN_POINT", "Median Point", ""},
+ {V3D_ACTIVE, "ACTIVE_ELEMENT", "Active Element", ""},
+ {0, NULL, NULL, NULL}};
+
+ static EnumPropertyItem transform_orientation_items[] = {
+ {V3D_MANIP_GLOBAL, "ORIENT_GLOBAL", "Global", "Align the transformation axes to world space"},
+ {V3D_MANIP_LOCAL, "ORIENT_LOCAL", "Local", "Align the transformation axes to the selected objects' local space"},
+ {V3D_MANIP_NORMAL, "ORIENT_NORMAL", "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
+ {V3D_MANIP_VIEW, "ORIENT_VIEW", "View", "Align the transformation axes to the window"},
+ {V3D_MANIP_CUSTOM, "ORIENT_CUSTOM", "Custom", "Use a custom transform orientation"},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Space3DView", "Space");
+ RNA_def_struct_sdna(srna, "View3D");
+ RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
+
+ prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "camera");
+ RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera).");
+
+ prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
+ 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");
+
+ 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");
+
+ prop= RNA_def_property(srna, "viewport_shading", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "drawtype");
+ RNA_def_property_enum_items(prop, viewport_shading_items);
+ RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View.");
+
+ prop= RNA_def_property(srna, "localview", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "localview", 0);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility.");
+
+ prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "lens");
+ RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view.");
+ RNA_def_property_range(prop, 1.0f, 250.0f);
+
+ prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "near");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance.");
+
+ prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "far");
+ RNA_def_property_range(prop, 1.0f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance.");
+
+ prop= RNA_def_property(srna, "grid_spacing", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "grid");
+ RNA_def_property_ui_text(prop, "Grid Spacing", "The distance between 3D View grid lines.");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+
+ prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "gridlines");
+ RNA_def_property_ui_text(prop, "Grid Lines", "The number of grid lines to display in perspective view.");
+ RNA_def_property_range(prop, 0, 1024);
+
+ prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "gridsubdiv");
+ RNA_def_property_ui_text(prop, "Grid Subdivisions", "The number of subdivisions between grid lines.");
+ RNA_def_property_range(prop, 1, 1024);
+
+ prop= RNA_def_property(srna, "display_floor", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
+ RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view.");
+
+ prop= RNA_def_property(srna, "display_x_axis", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
+ RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view.");
+
+ prop= RNA_def_property(srna, "display_y_axis", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y);
+ RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view.");
+
+ prop= RNA_def_property(srna, "display_z_axis", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z);
+ RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view.");
+
+ prop= RNA_def_property(srna, "outline_selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
+ RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline highlight around selected objects in non-wireframe views.");
+
+ prop= RNA_def_property(srna, "all_object_centers", 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.");
+
+ prop= RNA_def_property(srna, "relationship_lines", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES);
+ RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships.");
+
+ prop= RNA_def_property(srna, "textured_solid", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX);
+ RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
+
+ prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "around");
+ RNA_def_property_enum_items(prop, pivot_items);
+ RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling.");
+
+ 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.");
+
+ 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.");
+
+ 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.");
+
+ 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.");
+
+ prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "twmode");
+ RNA_def_property_enum_items(prop, transform_orientation_items);
+ RNA_def_property_ui_text(prop, "Transform Orientation", "The alignment of manipulator handles.");
+
+}
+
static void rna_def_space_image(BlenderRNA *brna)
{
StructRNA *srna;
@@ -400,6 +621,9 @@ void RNA_def_space(BlenderRNA *brna)
rna_def_space(brna);
rna_def_space_image(brna);
rna_def_space_text(brna);
+ rna_def_space_outliner(brna);
+ rna_def_background_image(brna);
+ rna_def_space_3dview(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index 3dacd4c0898..d3e4a34b9a7 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -172,6 +172,7 @@ static void rna_def_text(BlenderRNA *brna)
srna = RNA_def_struct(brna, "Text", "ID");
RNA_def_struct_ui_text(srna, "Text", "Text datablock referencing an external or packed text file.");
+ RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_Text_filename_get", "rna_Text_filename_length", "rna_Text_filename_set");
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 4cc98ce5f8a..b0fa4458f22 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -187,6 +187,7 @@ static void rna_def_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tex");
RNA_def_property_struct_type(prop, "Texture");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "Texture datablock used by this texture slot.");
/* mapping */
@@ -671,7 +672,7 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Calculate Alpha", "Calculates an alpha channel based on RGB values in the image");
prop= RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NEGALPHA);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_NEGALPHA);
RNA_def_property_ui_text(prop, "Invert Alpha", "Inverts all the alpha values in the image");
rna_def_filter_size_common(srna);
@@ -760,6 +761,7 @@ static void rna_def_texture_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
}
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index a3e48f629cb..e1bc0de245a 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -30,6 +30,8 @@
#include "rna_internal.h"
#include "RNA_enum_types.h"
+#include "UI_interface.h"
+
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
@@ -44,8 +46,6 @@
#include "BKE_report.h"
#include "BKE_screen.h"
-#include "UI_interface.h"
-
#include "WM_api.h"
#include "WM_types.h"
@@ -408,16 +408,102 @@ static StructRNA* rna_Menu_refine(struct PointerRNA *mtr)
return (hdr->type)? hdr->type->py_srna: &RNA_Menu;
}
+static int rna_UILayout_active_get(struct PointerRNA *ptr)
+{
+ return uiLayoutGetActive(ptr->data);
+}
+
+static void rna_UILayout_active_set(struct PointerRNA *ptr, int value)
+{
+ return uiLayoutSetActive(ptr->data, value);
+}
+
+static int rna_UILayout_enabled_get(struct PointerRNA *ptr)
+{
+ return uiLayoutGetEnabled(ptr->data);
+}
+
+static void rna_UILayout_enabled_set(struct PointerRNA *ptr, int value)
+{
+ return uiLayoutSetEnabled(ptr->data, value);
+}
+
+static int rna_UILayout_red_alert_get(struct PointerRNA *ptr)
+{
+ return uiLayoutGetRedAlert(ptr->data);
+}
+
+static void rna_UILayout_red_alert_set(struct PointerRNA *ptr, int value)
+{
+ return uiLayoutSetRedAlert(ptr->data, value);
+}
+
+static int rna_UILayout_keep_aspect_get(struct PointerRNA *ptr)
+{
+ return uiLayoutGetKeepAspect(ptr->data);
+}
+
+static void rna_UILayout_keep_aspect_set(struct PointerRNA *ptr, int value)
+{
+ return uiLayoutSetKeepAspect(ptr->data, value);
+}
+
+static int rna_UILayout_alignment_get(struct PointerRNA *ptr)
+{
+ return uiLayoutGetAlignment(ptr->data);
+}
+
+static void rna_UILayout_alignment_set(struct PointerRNA *ptr, int value)
+{
+ return uiLayoutSetAlignment(ptr->data, value);
+}
+
+static float rna_UILayout_scale_get(struct PointerRNA *ptr)
+{
+ return uiLayoutGetScale(ptr->data);
+}
+
+static void rna_UILayout_scale_set(struct PointerRNA *ptr, float value)
+{
+ return uiLayoutSetScale(ptr->data, value);
+}
+
#else
static void rna_def_ui_layout(BlenderRNA *brna)
{
StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem alignment_items[] = {
+ {UI_LAYOUT_ALIGN_LEFT, "LEFT", "Left", ""},
+ {UI_LAYOUT_ALIGN_CENTER, "CENTER", "Center", ""},
+ {UI_LAYOUT_ALIGN_RIGHT, "RIGHT", "RIght", ""},
+ {0, NULL, NULL, NULL}};
srna= RNA_def_struct(brna, "UILayout", NULL);
RNA_def_struct_sdna(srna, "uiLayout");
RNA_def_struct_ui_text(srna, "UI Layout", "User interface layout in a panel or header.");
+ prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_UILayout_active_get", "rna_UILayout_active_set");
+
+ prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set");
+
+ prop= RNA_def_property(srna, "red_alert", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_UILayout_red_alert_get", "rna_UILayout_red_alert_set");
+
+ prop= RNA_def_property(srna, "alignment", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, alignment_items);
+ RNA_def_property_enum_funcs(prop, "rna_UILayout_alignment_get", "rna_UILayout_alignment_set", NULL);
+
+ prop= RNA_def_property(srna, "keep_aspect", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_UILayout_keep_aspect_get", "rna_UILayout_keep_aspect_set");
+
+ prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_UNSIGNED);
+ RNA_def_property_float_funcs(prop, "rna_UILayout_scale_get", "rna_UILayout_scale_set", NULL);
+
RNA_api_ui_layout(srna);
}
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 43e67fdfa57..6376a3029ad 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -291,6 +291,12 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
RNA_def_property_update(prop, NC_WINDOW, NULL);
+ prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
+ RNA_def_property_struct_type(prop, "ThemeWidgetColors");
+ RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
+
prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
@@ -1649,7 +1655,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, auto_key_modes);
- RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set");
+ RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL);
RNA_def_property_ui_text(prop, "Auto Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones.");
prop= RNA_def_property(srna, "auto_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index eb764e4bc2d..7fb7fe656f5 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -114,6 +114,7 @@ static void rna_def_world_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates.");
}