Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_layer.c
| Context not available. | |||||
| return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, base->object); | return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, base->object); | ||||
| } | } | ||||
| static PointerRNA rna_ViewLayer_objectbases_get(CollectionPropertyIterator *iter) | |||||
| { | |||||
| ListBaseIterator *internal = &iter->internal.listbase; | |||||
| Base *base = (Base *)internal->link; | |||||
| return rna_pointer_inherit_refine(&iter->parent, &RNA_ObjectBase, base); | |||||
| } | |||||
| static int rna_ViewLayer_objects_selected_skip(CollectionPropertyIterator *iter, | static int rna_ViewLayer_objects_selected_skip(CollectionPropertyIterator *iter, | ||||
| void *UNUSED(data)) | void *UNUSED(data)) | ||||
| { | { | ||||
| Context not available. | |||||
| WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | ||||
| } | } | ||||
| static void rna_ObjectBase_name_get(struct PointerRNA *ptr, char *value) | |||||
| { | |||||
| ID *id = &((Base *)ptr->data)->object->id; | |||||
| BLI_strncpy(value, id->name + 2, sizeof(id->name) - 2); | |||||
| } | |||||
| static int rna_ObjectBase_name_length(PointerRNA *ptr) | |||||
| { | |||||
| ID *id = &((Base *)ptr->data)->object->id; | |||||
| return strlen(id->name + 2); | |||||
| } | |||||
| static void rna_LayerCollection_name_get(struct PointerRNA *ptr, char *value) | static void rna_LayerCollection_name_get(struct PointerRNA *ptr, char *value) | ||||
| { | { | ||||
| ID *id = (ID *)((LayerCollection *)ptr->data)->collection; | ID *id = (ID *)((LayerCollection *)ptr->data)->collection; | ||||
| Context not available. | |||||
| RNA_def_property_pointer_sdna(prop, NULL, "object"); | RNA_def_property_pointer_sdna(prop, NULL, "object"); | ||||
| RNA_def_property_ui_text(prop, "Object", "Object this base links to"); | RNA_def_property_ui_text(prop, "Object", "Object this base links to"); | ||||
| prop = RNA_def_property(srna, "object_name", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "object->id.name"); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE | PROP_ANIMATABLE); | |||||
| RNA_def_property_ui_text(prop, "Name", "Name of the object this base links to"); | |||||
| RNA_def_property_string_funcs( | |||||
| prop, "rna_ObjectBase_name_get", "rna_ObjectBase_name_length", NULL); | |||||
| RNA_def_struct_name_property(srna, prop); | |||||
| prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BASE_SELECTED); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BASE_SELECTED); | ||||
| RNA_def_property_ui_text(prop, "Select", "Object base selection state"); | RNA_def_property_ui_text(prop, "Select", "Object base selection state"); | ||||
| Context not available. | |||||
| RNA_def_property_ui_text(prop, "Objects", "All the objects in this layer"); | RNA_def_property_ui_text(prop, "Objects", "All the objects in this layer"); | ||||
| rna_def_layer_objects(brna, prop); | rna_def_layer_objects(brna, prop); | ||||
| prop = RNA_def_property(srna, "bases", PROP_COLLECTION, PROP_NONE); | |||||
| RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL); | |||||
| RNA_def_property_struct_type(prop, "ObjectBase"); | |||||
| RNA_def_property_collection_funcs( | |||||
| prop, NULL, NULL, NULL, "rna_ViewLayer_objectbases_get", NULL, NULL, NULL, NULL); | |||||
| RNA_def_property_ui_text(prop, "Bases", "All the bases in this layer"); | |||||
| /* layer options */ | /* layer options */ | ||||
| prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", VIEW_LAYER_RENDER); | RNA_def_property_boolean_sdna(prop, NULL, "flag", VIEW_LAYER_RENDER); | ||||
| Context not available. | |||||