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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_curve.c269
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c65
-rw-r--r--source/blender/makesrna/intern/rna_nla.c5
-rw-r--r--source/blender/makesrna/intern/rna_object.c2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c10
6 files changed, 301 insertions, 51 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index 178cdacf3c3..77eff6ad4c5 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -334,6 +334,7 @@ typedef struct ExtensionRNA {
#define MainMaterials Main
#define MainMeshes Main
#define MainLamps Main
+#define MainImages Main
#define MainObjects Main
#define MainTexts Main
#define MainActions Main
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 24701ed866d..579ebfc9332 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -50,6 +50,14 @@ EnumPropertyItem beztriple_interpolation_mode_items[] = {
{BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""},
{0, NULL, 0, NULL, NULL}};
+EnumPropertyItem curve_type_items[] = {
+ {CU_POLY, "POLY", 0, "Poly", ""},
+ {CU_BEZIER, "BEZIER", 0, "Bezier", ""},
+ {CU_BSPLINE, "BSPLINE", 0, "BSpline", ""},
+ {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
+ {CU_NURBS, "NURBS", 0, "Ease", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "DNA_object_types.h"
@@ -72,22 +80,6 @@ static StructRNA *rna_Curve_refine(PointerRNA *ptr)
else return &RNA_Curve;
}
-
-static PointerRNA rna_Curve_active_nurb_get(PointerRNA *ptr)
-{
- Curve *cu= (Curve*)ptr->data;
- Nurb *nu= NULL;
-
- if(cu->editnurb)
- nu = BLI_findlink(cu->editnurb, cu->actnu);
-
- if(nu)
- return rna_pointer_inherit_refine(ptr, &RNA_Spline, nu);
-
- return rna_pointer_inherit_refine(ptr, NULL, NULL);
-}
-
-
static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values)
{
BezTriple *bt= (BezTriple*)ptr->data;
@@ -208,14 +200,17 @@ static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA
rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL);
}
-static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Curve_update_data_id(Main *bmain, Scene *scene, ID *id)
{
- ID *id= ptr->id.data;
-
DAG_id_flush_update(id, OB_RECALC_DATA);
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
}
+static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ rna_Curve_update_data_id(bmain, scene, ptr->id.data);
+}
+
static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
{
DAG_scene_sort(scene);
@@ -316,6 +311,119 @@ static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr)
rna_Curve_update_data(bmain, scene, ptr);
}
+static void rna_Curve_spline_points_add(ID *id, Nurb *nu, bContext *C, ReportList *reports, int number)
+{
+ if(nu->type == CU_BEZIER) {
+ BKE_report(reports, RPT_ERROR, "Bezier spline can't have points added");
+ }
+ else if(number==0) {
+ // do nothing
+ } else {
+
+ addNurbPoints(nu, number);
+
+ /* update */
+ makeknots(nu, 1);
+
+ rna_Curve_update_data_id(CTX_data_main(C), CTX_data_scene(C), id);
+ }
+}
+
+static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, bContext *C, ReportList *reports, int number)
+{
+ if(nu->type != CU_BEZIER) {
+ BKE_report(reports, RPT_ERROR, "Only bezier splines can be added");
+ }
+ else if(number==0) {
+ // do nothing
+ } else {
+ addNurbPointsBezier(nu, number);
+
+ /* update */
+ makeknots(nu, 1);
+
+ rna_Curve_update_data_id(CTX_data_main(C), CTX_data_scene(C), id);
+ }
+}
+
+static Nurb *rna_Curve_spline_new(Curve *cu, int type)
+{
+ Nurb *nu= ( Nurb * ) MEM_callocN( sizeof( Nurb ), "spline.new" );
+
+ if(type==CU_BEZIER) {
+ BezTriple *bezt= (BezTriple *)MEM_callocN(sizeof(BezTriple), "spline.new.bezt");
+ bezt->radius= 1.0;
+ nu->bezt= bezt;
+ }
+ else {
+ BPoint *bp= (BPoint *)MEM_callocN(sizeof(BPoint), "spline.new.bp");
+ bp->radius= 1.0f;
+ nu->bp= bp;
+ }
+
+ nu->type= type;
+ nu->pntsu= 1;
+ nu->pntsv= 1;
+
+ nu->orderu= nu->orderv= 4;
+ nu->resolu= nu->resolv= 12;
+ nu->flag= CU_SMOOTH;
+
+ BLI_addtail(&cu->nurb, nu);
+
+ return nu;
+}
+
+static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, Nurb *nu)
+{
+ /* todo, check we're in the list */
+ int found= 0;
+ if(cu->editnurb) {
+ found= BLI_remlink_safe(cu->editnurb, nu);
+ }
+ else {
+ found= BLI_remlink_safe(&cu->nurb, nu);
+ }
+
+ if(!found) {
+ BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" does not contain spline given", cu->id.name+2);
+ return;
+ }
+
+ freeNurb(nu);
+ /* invalidate pointer!, no can do */
+}
+
+static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
+{
+ Curve *cu= (Curve*)ptr->data;
+ Nurb *nu;
+
+ if(cu->editnurb)
+ nu= BLI_findlink(cu->editnurb, cu->actnu);
+ else
+ nu= BLI_findlink(&cu->nurb, cu->actnu); // currently set to -1, should be changed to be allowed outside of editmode.
+
+ if(nu)
+ return rna_pointer_inherit_refine(ptr, &RNA_Spline, nu);
+
+ return rna_pointer_inherit_refine(ptr, NULL, NULL);
+}
+
+static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value)
+{
+ Curve *cu= (Curve*)ptr->data;
+ Nurb *nu= value.data;
+
+ /* -1 is ok for an unset index */
+ if(nu==NULL)
+ cu->actnu= -1;
+ else if(cu->editnurb)
+ cu->actnu= BLI_findindex(cu->editnurb, nu);
+ else
+ cu->actnu= BLI_findindex(&cu->nurb, nu);
+}
+
#else
static void rna_def_bpoint(BlenderRNA *brna)
@@ -725,6 +833,100 @@ static void rna_def_text(BlenderRNA *brna)
rna_def_nurbs(brna, srna);
}
+
+/* curve.splines[0].points */
+static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ //PropertyRNA *prop;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "SplinePoints");
+ srna= RNA_def_struct(brna, "SplinePoints", NULL);
+ RNA_def_struct_sdna(srna, "Nurb");
+ RNA_def_struct_ui_text(srna, "Spline Points", "Collection of spline points");
+
+ func= RNA_def_function(srna, "add", "rna_Curve_spline_points_add");
+ RNA_def_function_ui_description(func, "Add a number of points to this spline.");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
+ parm= RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
+
+ /*
+ func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ */
+}
+
+static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ //PropertyRNA *prop;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "SplineBezierPoints");
+ srna= RNA_def_struct(brna, "SplineBezierPoints", NULL);
+ RNA_def_struct_sdna(srna, "Nurb");
+ RNA_def_struct_ui_text(srna, "Spline Bezier Points", "Collection of spline bezirt points");
+
+ func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
+ RNA_def_function_ui_description(func, "Add a number of points to this spline.");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
+ parm= RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
+
+ /*
+ func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ */
+}
+
+/* curve.splines */
+static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "CurveSplines");
+ srna= RNA_def_struct(brna, "CurveSplines", NULL);
+ RNA_def_struct_sdna(srna, "Curve");
+ RNA_def_struct_ui_text(srna, "Curve Splines", "Collection of curve splines");
+
+ func= RNA_def_function(srna, "new", "rna_Curve_spline_new");
+ RNA_def_function_ui_description(func, "Add a new spline to the curve.");
+ parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_pointer_funcs(prop, "rna_Curve_active_spline_get", "rna_Curve_active_spline_set", NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Active Spline", "Active curve spline");
+ /* Could call: ED_base_object_activate(C, scene->basact);
+ * but would be a bad level call and it seems the notifier is enough */
+ RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
+}
+
+
static void rna_def_curve(BlenderRNA *brna)
{
StructRNA *srna;
@@ -757,12 +959,7 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "nurb", NULL);
RNA_def_property_struct_type(prop, "Spline");
RNA_def_property_ui_text(prop, "Splines", "Collection of splines in this curve data object");
-
- prop= RNA_def_property(srna, "active_spline", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Spline");
- RNA_def_property_pointer_funcs(prop, "rna_Curve_active_nurb_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Active Spline", "The active editmode spline");
-
+ rna_def_curve_splines(brna, prop);
prop= RNA_def_property(srna, "draw_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_HANDLES);
@@ -888,14 +1085,6 @@ static void rna_def_curve(BlenderRNA *brna)
static void rna_def_curve_nurb(BlenderRNA *brna)
{
- static EnumPropertyItem curve_type_items[] = {
- {CU_POLY, "POLY", 0, "Poly", ""},
- {CU_BEZIER, "BEZIER", 0, "Bezier", ""},
- {CU_BSPLINE, "BSPLINE", 0, "BSpline", ""},
- {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
- {CU_NURBS, "NURBS", 0, "Ease", ""},
- {0, NULL, 0, NULL, NULL}};
-
static EnumPropertyItem spline_interpolation_items[] = {
{BEZT_IPO_CONST, "LINEAR", 0, "Linear", ""},
{BEZT_IPO_LIN, "CARDINAL", 0, "Cardinal", ""},
@@ -915,11 +1104,13 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "SplinePoint");
RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", 0, 0);
RNA_def_property_ui_text(prop, "Points", "Collection of points that make up this poly or nurbs spline");
+ rna_def_curve_spline_points(brna, prop);
prop= RNA_def_property(srna, "bezier_points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "BezierSplinePoint");
RNA_def_property_collection_sdna(prop, NULL, "bezt", "pntsu");
RNA_def_property_ui_text(prop, "Bezier Points", "Collection of points for bezier curves only");
+ rna_def_curve_spline_bezpoints(brna, prop);
prop= RNA_def_property(srna, "tilt_interpolation", PROP_ENUM, PROP_NONE);
@@ -982,34 +1173,34 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "cyclic_u", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_CYCLIC);
+ RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic U", "Make this curve or surface a closed loop in the U direction");
RNA_def_property_update(prop, 0, "rna_Nurb_update_handle_data"); /* only needed for cyclic_u because cyclic_v cant do bezier */
prop= RNA_def_property(srna, "cyclic_v", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_CYCLIC);
+ RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic V", "Make this surface a closed loop in the V direction");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Note, endpoint and bezier flags should never be on at the same time! */
prop= RNA_def_property(srna, "endpoint_u", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flagu", 2);
+ RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_ENDPOINT);
RNA_def_property_ui_text(prop, "Endpoint U", "Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
prop= RNA_def_property(srna, "endpoint_v", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flagv", 2);
+ RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_ENDPOINT);
RNA_def_property_ui_text(prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
prop= RNA_def_property(srna, "bezier_u", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flagu", 4);
+ RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_BEZIER);
RNA_def_property_ui_text(prop, "Bezier U", "Make this nurbs curve or surface act like a bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
prop= RNA_def_property(srna, "bezier_v", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flagv", 4);
+ RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_BEZIER);
RNA_def_property_ui_text(prop, "Bezier V", "Make this nurbs surface act like a bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 5f007c63b9e..9433294fdd3 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -69,11 +69,6 @@ Tex *rna_Main_add_texture(Main *bmain, char *name)
return add_texture(name);
}
-Image *rna_Main_add_image(Main *bmain, char *filename)
-{
- return BKE_add_image_file(filename, 0);
-}
-
Camera *rna_Main_cameras_new(Main *bmain, char* name)
{
return add_camera(name);
@@ -227,6 +222,27 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
/* XXX python now has invalid pointer? */
}
+Image *rna_Main_images_new(Main *bmain, char* name, int width, int height, int float_buffer)
+{
+ float color[4]= {0.0, 0.0, 0.0, 1.0};
+ Image *image= BKE_add_image_size(width, height, name, float_buffer, 0, color);
+ image->id.us--;
+ return image;
+}
+Image *rna_Main_images_load(Main *bmain, char *filename)
+{
+ return BKE_add_image_file(filename, 0);
+}
+void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
+{
+ if(ID_REAL_USERS(image) <= 0)
+ free_libblock(&bmain->image, image);
+ else
+ BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d.", image->id.name+2, ID_REAL_USERS(image));
+
+ /* XXX python now has invalid pointer? */
+}
+
Tex *rna_Main_textures_new(Main *bmain, char* name)
{
Tex *tex= add_texture(name);
@@ -309,15 +325,20 @@ void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act)
void RNA_api_main(StructRNA *srna)
{
+ /*
FunctionRNA *func;
PropertyRNA *parm;
-
+ */
+ /* maybe we want to add functions in 'bpy.data' still?
+ * for now they are all in collections bpy.data.images.new(...) */
+ /*
func= RNA_def_function(srna, "add_image", "rna_Main_add_image");
RNA_def_function_ui_description(func, "Add a new image.");
parm= RNA_def_string(func, "filename", "", 0, "", "Filename to load image from.");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "image", "Image", "", "New image.");
RNA_def_function_return(func, parm);
+ */
}
@@ -491,8 +512,40 @@ void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
}
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+ RNA_def_property_srna(cprop, "MainImages");
+ srna= RNA_def_struct(brna, "MainImages", NULL);
+ RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
+
+ func= RNA_def_function(srna, "new", "rna_Main_images_new");
+ RNA_def_function_ui_description(func, "Add a new image to the main database");
+ parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image.", 0, INT_MAX);
+ parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image.", 0, INT_MAX);
+ parm= RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color");
+ /* return type */
+ parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "load", "rna_Main_images_load");
+ RNA_def_function_ui_description(func, "Load a new image into the main database");
+ parm= RNA_def_string(func, "filename", "File Name", 0, "", "path of the file to load.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_Main_images_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove an image from the current blendfile.");
+ parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
}
+
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
{
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index 9cbe46dac58..b3f4aab7599 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -411,6 +411,11 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME);
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set");
RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined");
+
+ prop= RNA_def_property(srna, "animated_time_cyclic", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC);
+ RNA_def_property_ui_text(prop, "Cyclic Strip Time", "Cycle the animated time within the action start & end");
+ RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); // is there a better update flag?
/* settings */
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 117a1d5bc60..21a1b7994a5 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -125,7 +125,7 @@ void rna_Object_update(Main *bmain, Scene *scene, PointerRNA *ptr)
void rna_Object_matrix_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- ED_object_apply_obmat(ptr->id.data);
+ object_apply_mat4(ptr->id.data, ((Object *)ptr->id.data)->obmat);
rna_Object_update(bmain, scene, ptr);
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 1686f3e69db..1fb24c2da28 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -178,12 +178,12 @@ static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
}
-static Base *rna_Scene_link_object(Scene *scene, ReportList *reports, Object *ob)
+static Base *rna_Scene_object_link(Scene *scene, ReportList *reports, Object *ob)
{
Base *base;
if (ob->type != OB_EMPTY && ob->data==NULL) {
- BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is not an Empty type and has no Object Data set.");
+ BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is not an Empty type and has no Object Data set.", ob->id.name+2);
return NULL;
}
@@ -204,7 +204,7 @@ static Base *rna_Scene_link_object(Scene *scene, ReportList *reports, Object *ob
return base;
}
-static void rna_Scene_unlink_object(Scene *scene, bContext *C, ReportList *reports, Object *ob)
+static void rna_Scene_object_unlink(Scene *scene, bContext *C, ReportList *reports, Object *ob)
{
Base *base= object_in_scene(ob, scene);
if (!base) {
@@ -2604,7 +2604,7 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_sdna(srna, "Scene");
RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
- func= RNA_def_function(srna, "link", "rna_Scene_link_object");
+ func= RNA_def_function(srna, "link", "rna_Scene_object_link");
RNA_def_function_ui_description(func, "Link object to scene.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
@@ -2612,7 +2612,7 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "unlink", "rna_Scene_unlink_object");
+ func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
RNA_def_function_ui_description(func, "Unlink object from scene.");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");