diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 55f559c0222..541971ea748 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -224,6 +224,18 @@ static void rna_Object_free_duplilist(Object *ob) } } +static PointerRNA rna_Object_find_dupli_cache(Object *ob, Object *dupob) +{ + DupliObjectData *data = NULL; + PointerRNA ptr; + + if (ob->dup_cache) + data = BKE_dupli_cache_find_data(ob->dup_cache, dupob); + + RNA_pointer_create((ID *)ob, &RNA_DupliObjectData, data, &ptr); + return ptr; +} + static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList *reports, const char *name, int from_mix) { @@ -466,6 +478,12 @@ static int rna_Object_update_from_editmode(Object *ob) } return false; } + +static void rna_Object_cache_release(Object *object, int free_smoke_sim) +{ + BKE_object_free_caches(object, free_smoke_sim != 0); +} + #else /* RNA_RUNTIME */ void RNA_api_object(StructRNA *srna) @@ -572,6 +590,14 @@ void RNA_api_object(StructRNA *srna) func = RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist"); RNA_def_function_ui_description(func, "Free the list of dupli objects"); + func = RNA_def_function(srna, "find_dupli_cache", "rna_Object_find_dupli_cache"); + RNA_def_function_ui_description(func, "Find cached data for a dupli object"); + parm = RNA_def_pointer(func, "object", "Object", "", "Object data to look up"); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); + parm = RNA_def_pointer(func, "data", "DupliObjectData", "", "Cached object data"); + RNA_def_property_flag(parm, PROP_RNAPTR); + RNA_def_function_return(func, parm); + /* Armature */ func = RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature"); RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier"); @@ -688,7 +714,8 @@ void RNA_api_object(StructRNA *srna) parm = RNA_def_boolean(func, "result", 0, "", "Success"); RNA_def_function_return(func, parm); - func = RNA_def_function(srna, "cache_release", "BKE_object_free_caches"); + func = RNA_def_function(srna, "cache_release", "rna_Object_cache_release"); + RNA_def_boolean(func, "free_smoke_sim", 0, "", "Free baked smoke simulation data"); RNA_def_function_ui_description(func, "Release memory used by caches associated with this object. Intended to be used by render engines only"); } |