Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_layer.c
| Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | |||||
| static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | ||||
| { | { | ||||
| ViewLayer *view_layer = (ViewLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| rna_iterator_listbase_begin( | rna_iterator_listbase_begin( | ||||
| iter, &view_layer->object_bases, rna_ViewLayer_objects_selected_skip); | iter, &view_layer->object_bases, rna_ViewLayer_objects_selected_skip); | ||||
| } | } | ||||
| static void rna_ViewLayer_update_tagged(ID *id_ptr, ViewLayer *view_layer, Main *bmain) | static void rna_ViewLayer_update_tagged(ID *id_ptr, | ||||
| ViewLayer *view_layer, | |||||
| Main *bmain, | |||||
| ReportList *reports) | |||||
| { | { | ||||
| Scene *scene = (Scene *)id_ptr; | |||||
| Depsgraph *depsgraph = BKE_scene_get_depsgraph(bmain, scene, view_layer, true); | |||||
| if (DEG_is_evaluating(depsgraph)) { | |||||
| BKE_report(reports, RPT_ERROR, "Dependency graph update requested during evaluation"); | |||||
| return; | |||||
| } | |||||
| # ifdef WITH_PYTHON | # ifdef WITH_PYTHON | ||||
| /* Allow drivers to be evaluated */ | /* Allow drivers to be evaluated */ | ||||
| BPy_BEGIN_ALLOW_THREADS; | BPy_BEGIN_ALLOW_THREADS; | ||||
| # endif | # endif | ||||
| Scene *scene = (Scene *)id_ptr; | |||||
| Depsgraph *depsgraph = BKE_scene_get_depsgraph(bmain, scene, view_layer, true); | |||||
| /* NOTE: This is similar to CTX_data_depsgraph_pointer(). Ideally such access would be | /* NOTE: This is similar to CTX_data_depsgraph_pointer(). Ideally such access would be | ||||
| * de-duplicated across all possible cases, but for now this is safest and easiest way to go. | * de-duplicated across all possible cases, but for now this is safest and easiest way to go. | ||||
| * | * | ||||
| * The reason for this is that it's possible to have Python operator which asks view layer to | * The reason for this is that it's possible to have Python operator which asks view layer to | ||||
| * be updated. After re-do of such operator view layer's dependency graph will not be marked | * be updated. After re-do of such operator view layer's dependency graph will not be marked | ||||
| * as active. */ | * as active. */ | ||||
| DEG_make_active(depsgraph); | DEG_make_active(depsgraph); | ||||
| BKE_scene_graph_update_tagged(depsgraph, bmain); | BKE_scene_graph_update_tagged(depsgraph, bmain); | ||||
| ▲ Show 20 Lines • Show All 356 Lines • ▼ Show 20 Lines | void RNA_def_view_layer(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_flag(prop, PROP_NEVER_NULL); | RNA_def_property_flag(prop, PROP_NEVER_NULL); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "freestyle_config"); | RNA_def_property_pointer_sdna(prop, NULL, "freestyle_config"); | ||||
| RNA_def_property_struct_type(prop, "FreestyleSettings"); | RNA_def_property_struct_type(prop, "FreestyleSettings"); | ||||
| RNA_def_property_ui_text(prop, "Freestyle Settings", ""); | RNA_def_property_ui_text(prop, "Freestyle Settings", ""); | ||||
| /* debug update routine */ | /* debug update routine */ | ||||
| func = RNA_def_function(srna, "update", "rna_ViewLayer_update_tagged"); | func = RNA_def_function(srna, "update", "rna_ViewLayer_update_tagged"); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS); | ||||
| RNA_def_function_ui_description( | RNA_def_function_ui_description( | ||||
| func, "Update data tagged to be updated from previous access to data or operators"); | func, "Update data tagged to be updated from previous access to data or operators"); | ||||
| /* Dependency Graph */ | /* Dependency Graph */ | ||||
| prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "Depsgraph"); | RNA_def_property_struct_type(prop, "Depsgraph"); | ||||
| RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the scene data"); | RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the scene data"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_ViewLayer_depsgraph_get", NULL, NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_ViewLayer_depsgraph_get", NULL, NULL, NULL); | ||||
| Show All 11 Lines | |||||