RenderEngine: add .is_animation and .is_preview properties to detect if it's

an animation or preview render that is being done.
This commit is contained in:
2011-11-02 13:36:28 +00:00
parent 3d35e004d3
commit 79a389ee37
5 changed files with 25 additions and 1 deletions

View File

@@ -251,9 +251,16 @@ static void rna_def_render_engine(BlenderRNA *brna)
prop= RNA_def_string(func, "message", "", 0, "Report Message", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
/* registration */
RNA_define_verify_sdna(0);
prop= RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_ANIMATION);
prop= RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_PREVIEW);
/* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);