Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_tree.c
| Context not available. | |||||
| #include "BLF_translation.h" | #include "BLF_translation.h" | ||||
| #include "BKE_context.h" | |||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| Context not available. | |||||
| #undef LOG2I | #undef LOG2I | ||||
| static bool outliner_animdata_test(AnimData *adt) | static bool outliner_animdata_test(SpaceOops *soops, AnimData *adt) | ||||
| { | { | ||||
| if (!(soops->hideflag & SO_HIDE_ANIMDATA)) { | |||||
| if (adt) | if (adt) | ||||
| return (adt->action || adt->drivers.first || adt->nla_tracks.first); | return (adt->action || adt->drivers.first || adt->nla_tracks.first); | ||||
| } | |||||
| return false; | return false; | ||||
| } | } | ||||
| Context not available. | |||||
| outliner_add_passes(soops, tenlay, &sce->id, srl); | outliner_add_passes(soops, tenlay, &sce->id, srl); | ||||
| } | } | ||||
| // TODO: move this to the front? | // TODO: move this to the front? | ||||
| if (outliner_animdata_test(sce->adt)) | if (outliner_animdata_test(soops, sce->adt)) | ||||
| outliner_add_element(soops, lb, sce, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, lb, sce, te, TSE_ANIM_DATA, 0); | ||||
| if (!(soops->hideflag & SO_HIDE_GPDATA)) { | |||||
| outliner_add_element(soops, lb, sce->gpd, te, 0, 0); | outliner_add_element(soops, lb, sce->gpd, te, 0, 0); | ||||
| } | |||||
| outliner_add_element(soops, lb, sce->world, te, 0, 0); | outliner_add_element(soops, lb, sce->world, te, 0, 0); | ||||
| Context not available. | |||||
| { | { | ||||
| int a = 0; | int a = 0; | ||||
| if (outliner_animdata_test(ob->adt)) | if (outliner_animdata_test(soops, ob->adt)) | ||||
| outliner_add_element(soops, &te->subtree, ob, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, ob, te, TSE_ANIM_DATA, 0); | ||||
| if (!(soops->hideflag & SO_HIDE_ANIMDATA)) { | |||||
| outliner_add_element(soops, &te->subtree, ob->poselib, te, 0, 0); // XXX FIXME.. add a special type for this | outliner_add_element(soops, &te->subtree, ob->poselib, te, 0, 0); // XXX FIXME.. add a special type for this | ||||
| } | |||||
| if (ob->proxy && ob->id.lib == NULL) | if (ob->proxy && ob->id.lib == NULL) | ||||
| outliner_add_element(soops, &te->subtree, ob->proxy, te, TSE_PROXY, 0); | outliner_add_element(soops, &te->subtree, ob->proxy, te, TSE_PROXY, 0); | ||||
| if (!(soops->hideflag & SO_HIDE_GPDATA)) { | |||||
| outliner_add_element(soops, &te->subtree, ob->gpd, te, 0, 0); | outliner_add_element(soops, &te->subtree, ob->gpd, te, 0, 0); | ||||
| } | |||||
| if (!(soops->hideflag & SO_HIDE_OBDATA)) { | |||||
| outliner_add_element(soops, &te->subtree, ob->data, te, 0, 0); | outliner_add_element(soops, &te->subtree, ob->data, te, 0, 0); | ||||
| } | |||||
| if (!(soops->hideflag & SO_HIDE_BONES)) { | |||||
| if (ob->pose) { | if (ob->pose) { | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| bPoseChannel *pchan; | bPoseChannel *pchan; | ||||
| Context not available. | |||||
| ten->directdata = pchan; | ten->directdata = pchan; | ||||
| pchan->temp = (void *)ten; | pchan->temp = (void *)ten; | ||||
| if (!(soops->hideflag & SO_HIDE_OBDATA_EXTRAS)) { | |||||
| if (pchan->constraints.first) { | if (pchan->constraints.first) { | ||||
| //Object *target; | //Object *target; | ||||
| bConstraint *con; | bConstraint *con; | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| /* make hierarchy */ | /* make hierarchy */ | ||||
| ten = tenla->subtree.first; | ten = tenla->subtree.first; | ||||
| while (ten) { | while (ten) { | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| if (!(soops->hideflag & SO_HIDE_MATERIALS)) { | |||||
| for (a = 0; a < ob->totcol; a++) | for (a = 0; a < ob->totcol; a++) | ||||
| outliner_add_element(soops, &te->subtree, ob->mat[a], te, 0, a); | outliner_add_element(soops, &te->subtree, ob->mat[a], te, 0, a); | ||||
| } | |||||
| if (!(soops->hideflag & SO_HIDE_OB_EXTRAS)) { | |||||
| if (ob->constraints.first) { | if (ob->constraints.first) { | ||||
| //Object *target; | //Object *target; | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| if (!(soops->hideflag & SO_HIDE_OBDATA_EXTRAS)) { | |||||
| /* vertex groups */ | /* vertex groups */ | ||||
| if (ob->defbase.first) { | if (ob->defbase.first) { | ||||
| bDeformGroup *defgroup; | bDeformGroup *defgroup; | ||||
| Context not available. | |||||
| ten->directdata = defgroup; | ten->directdata = defgroup; | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| if (!(soops->hideflag & SO_HIDE_OB_GROUPS)) { | |||||
| /* duplicated group */ | /* duplicated group */ | ||||
| if (ob->dup_group) | if (ob->dup_group) | ||||
| outliner_add_element(soops, &te->subtree, ob->dup_group, te, 0, 0); | outliner_add_element(soops, &te->subtree, ob->dup_group, te, 0, 0); | ||||
| } | |||||
| } | } | ||||
| Context not available. | |||||
| case ID_ME: | case ID_ME: | ||||
| { | { | ||||
| Mesh *me = (Mesh *)id; | Mesh *me = (Mesh *)id; | ||||
| int a; | |||||
| if (outliner_animdata_test(me->adt)) | if (outliner_animdata_test(soops, me->adt)) { | ||||
| outliner_add_element(soops, &te->subtree, me, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, me, te, TSE_ANIM_DATA, 0); | ||||
| } | |||||
| if (!(soops->hideflag & SO_HIDE_SHAPEKEYS)) { | |||||
| outliner_add_element(soops, &te->subtree, me->key, te, 0, 0); | outliner_add_element(soops, &te->subtree, me->key, te, 0, 0); | ||||
| } | |||||
| if (!(soops->hideflag & SO_HIDE_MATERIALS)) { | |||||
| int a; | |||||
| for (a = 0; a < me->totcol; a++) | for (a = 0; a < me->totcol; a++) | ||||
| outliner_add_element(soops, &te->subtree, me->mat[a], te, 0, a); | outliner_add_element(soops, &te->subtree, me->mat[a], te, 0, a); | ||||
| } | |||||
| /* could do tfaces with image links, but the images are not grouped nicely. | /* could do tfaces with image links, but the images are not grouped nicely. | ||||
| * would require going over all tfaces, sort images in use. etc... */ | * would require going over all tfaces, sort images in use. etc... */ | ||||
| break; | break; | ||||
| Context not available. | |||||
| case ID_CU: | case ID_CU: | ||||
| { | { | ||||
| Curve *cu = (Curve *)id; | Curve *cu = (Curve *)id; | ||||
| int a; | |||||
| if (outliner_animdata_test(cu->adt)) | if (outliner_animdata_test(soops, cu->adt)) { | ||||
| outliner_add_element(soops, &te->subtree, cu, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, cu, te, TSE_ANIM_DATA, 0); | ||||
| } | |||||
| if (!(soops->hideflag & SO_HIDE_MATERIALS)) { | |||||
| int a; | |||||
| for (a = 0; a < cu->totcol; a++) | for (a = 0; a < cu->totcol; a++) | ||||
| outliner_add_element(soops, &te->subtree, cu->mat[a], te, 0, a); | outliner_add_element(soops, &te->subtree, cu->mat[a], te, 0, a); | ||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| case ID_MB: | case ID_MB: | ||||
| { | { | ||||
| MetaBall *mb = (MetaBall *)id; | MetaBall *mb = (MetaBall *)id; | ||||
| int a; | |||||
| if (outliner_animdata_test(mb->adt)) | if (outliner_animdata_test(soops, mb->adt)) | ||||
| outliner_add_element(soops, &te->subtree, mb, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, mb, te, TSE_ANIM_DATA, 0); | ||||
| if (!(soops->hideflag & SO_HIDE_MATERIALS)) { | |||||
| int a; | |||||
| for (a = 0; a < mb->totcol; a++) | for (a = 0; a < mb->totcol; a++) | ||||
| outliner_add_element(soops, &te->subtree, mb->mat[a], te, 0, a); | outliner_add_element(soops, &te->subtree, mb->mat[a], te, 0, a); | ||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| case ID_MA: | case ID_MA: | ||||
| { | { | ||||
| Material *ma = (Material *)id; | Material *ma = (Material *)id; | ||||
| int a; | |||||
| if (outliner_animdata_test(ma->adt)) | if (outliner_animdata_test(soops, ma->adt)) | ||||
| outliner_add_element(soops, &te->subtree, ma, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, ma, te, TSE_ANIM_DATA, 0); | ||||
| if (!(soops->hideflag & SO_HIDE_TEXTURES)) { | |||||
| int a; | |||||
| for (a = 0; a < MAX_MTEX; a++) { | for (a = 0; a < MAX_MTEX; a++) { | ||||
| if (ma->mtex[a]) outliner_add_element(soops, &te->subtree, ma->mtex[a]->tex, te, 0, a); | if (ma->mtex[a]) outliner_add_element(soops, &te->subtree, ma->mtex[a]->tex, te, 0, a); | ||||
| } | } | ||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| case ID_TE: | case ID_TE: | ||||
| { | { | ||||
| Tex *tex = (Tex *)id; | Tex *tex = (Tex *)id; | ||||
| if (outliner_animdata_test(tex->adt)) | if (outliner_animdata_test(soops, tex->adt)) | ||||
| outliner_add_element(soops, &te->subtree, tex, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, tex, te, TSE_ANIM_DATA, 0); | ||||
| outliner_add_element(soops, &te->subtree, tex->ima, te, 0, 0); | outliner_add_element(soops, &te->subtree, tex->ima, te, 0, 0); | ||||
| Context not available. | |||||
| { | { | ||||
| Camera *ca = (Camera *)id; | Camera *ca = (Camera *)id; | ||||
| if (outliner_animdata_test(ca->adt)) | if (outliner_animdata_test(soops, ca->adt)) | ||||
| outliner_add_element(soops, &te->subtree, ca, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, ca, te, TSE_ANIM_DATA, 0); | ||||
| break; | break; | ||||
| } | } | ||||
| case ID_LA: | case ID_LA: | ||||
| { | { | ||||
| Lamp *la = (Lamp *)id; | Lamp *la = (Lamp *)id; | ||||
| int a; | |||||
| if (outliner_animdata_test(la->adt)) | if (outliner_animdata_test(soops, la->adt)) | ||||
| outliner_add_element(soops, &te->subtree, la, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, la, te, TSE_ANIM_DATA, 0); | ||||
| if (!(soops->hideflag & SO_HIDE_TEXTURES)) { | |||||
| int a; | |||||
| for (a = 0; a < MAX_MTEX; a++) { | for (a = 0; a < MAX_MTEX; a++) { | ||||
| if (la->mtex[a]) outliner_add_element(soops, &te->subtree, la->mtex[a]->tex, te, 0, a); | if (la->mtex[a]) outliner_add_element(soops, &te->subtree, la->mtex[a]->tex, te, 0, a); | ||||
| } | } | ||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| case ID_SPK: | case ID_SPK: | ||||
| { | { | ||||
| Speaker *spk = (Speaker *)id; | Speaker *spk = (Speaker *)id; | ||||
| if (outliner_animdata_test(spk->adt)) | if (outliner_animdata_test(soops, spk->adt)) | ||||
| outliner_add_element(soops, &te->subtree, spk, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, spk, te, TSE_ANIM_DATA, 0); | ||||
| break; | break; | ||||
| } | } | ||||
| case ID_WO: | case ID_WO: | ||||
| { | { | ||||
| World *wrld = (World *)id; | World *wrld = (World *)id; | ||||
| int a; | |||||
| if (outliner_animdata_test(wrld->adt)) | if (outliner_animdata_test(soops, wrld->adt)) | ||||
| outliner_add_element(soops, &te->subtree, wrld, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, wrld, te, TSE_ANIM_DATA, 0); | ||||
| if (!(soops->hideflag & SO_HIDE_TEXTURES)) { | |||||
| int a; | |||||
| for (a = 0; a < MAX_MTEX; a++) { | for (a = 0; a < MAX_MTEX; a++) { | ||||
| if (wrld->mtex[a]) outliner_add_element(soops, &te->subtree, wrld->mtex[a]->tex, te, 0, a); | if (wrld->mtex[a]) outliner_add_element(soops, &te->subtree, wrld->mtex[a]->tex, te, 0, a); | ||||
| } | } | ||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| case ID_KE: | case ID_KE: | ||||
| { | { | ||||
| Key *key = (Key *)id; | Key *key = (Key *)id; | ||||
| if (outliner_animdata_test(key->adt)) | if (outliner_animdata_test(soops, key->adt)) | ||||
| outliner_add_element(soops, &te->subtree, key, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, key, te, TSE_ANIM_DATA, 0); | ||||
| break; | break; | ||||
| } | } | ||||
| Context not available. | |||||
| bArmature *arm = (bArmature *)id; | bArmature *arm = (bArmature *)id; | ||||
| int a = 0; | int a = 0; | ||||
| if (outliner_animdata_test(arm->adt)) | if (outliner_animdata_test(soops, arm->adt)) | ||||
| outliner_add_element(soops, &te->subtree, arm, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, arm, te, TSE_ANIM_DATA, 0); | ||||
| if (!(soops->hideflag & SO_HIDE_BONES)) { | |||||
| if (arm->edbo) { | if (arm->edbo) { | ||||
| EditBone *ebone; | EditBone *ebone; | ||||
| TreeElement *ten; | TreeElement *ten; | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| case ID_LS: | case ID_LS: | ||||
| { | { | ||||
| FreestyleLineStyle *linestyle = (FreestyleLineStyle *)id; | FreestyleLineStyle *linestyle = (FreestyleLineStyle *)id; | ||||
| int a; | |||||
| if (outliner_animdata_test(linestyle->adt)) | if (outliner_animdata_test(soops, linestyle->adt)) | ||||
| outliner_add_element(soops, &te->subtree, linestyle, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, linestyle, te, TSE_ANIM_DATA, 0); | ||||
| if (!(soops->hideflag & SO_HIDE_TEXTURES)) { | |||||
| int a; | |||||
| for (a = 0; a < MAX_MTEX; a++) { | for (a = 0; a < MAX_MTEX; a++) { | ||||
| if (linestyle->mtex[a]) | if (linestyle->mtex[a]) | ||||
| outliner_add_element(soops, &te->subtree, linestyle->mtex[a]->tex, te, 0, a); | outliner_add_element(soops, &te->subtree, linestyle->mtex[a]->tex, te, 0, a); | ||||
| } | } | ||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| case ID_GD: | case ID_GD: | ||||
| { | { | ||||
| bGPdata *gpd = (bGPdata *)id; | bGPdata *gpd = (bGPdata *)id; | ||||
| bGPDlayer *gpl; | |||||
| int a = 0; | |||||
| if (outliner_animdata_test(gpd->adt)) | if (outliner_animdata_test(soops, gpd->adt)) | ||||
| outliner_add_element(soops, &te->subtree, gpd, te, TSE_ANIM_DATA, 0); | outliner_add_element(soops, &te->subtree, gpd, te, TSE_ANIM_DATA, 0); | ||||
| if (!(soops->hideflag & SO_HIDE_GPDATA)) { | |||||
| bGPDlayer *gpl; | |||||
| int a = 0; | |||||
| // TODO: base element for layers? | // TODO: base element for layers? | ||||
| for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { | for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { | ||||
| outliner_add_element(soops, &te->subtree, gpl, te, TSE_GP_LAYER, a); | outliner_add_element(soops, &te->subtree, gpl, te, TSE_GP_LAYER, a); | ||||
| a++; | a++; | ||||
| } | } | ||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| /* Show/Hide by type --------------------------------------- */ | |||||
| static bool outliner_hide_check(SpaceOops *soops, short obtype) | |||||
| { | |||||
| switch (obtype) { | |||||
| case OB_MESH: | |||||
| return (!(soops->hideflag & SO_HIDE_MESH)); | |||||
| break; | |||||
| case OB_EMPTY: | |||||
| return (!(soops->hideflag & SO_HIDE_EMPTY)); | |||||
| break; | |||||
| case OB_CURVE: | |||||
| return (!(soops->hideflag & SO_HIDE_CURVE)); | |||||
| break; | |||||
| case OB_SURF: | |||||
| return (!(soops->hideflag & SO_HIDE_SURF)); | |||||
| break; | |||||
| case OB_FONT: | |||||
| return (!(soops->hideflag & SO_HIDE_EMPTY)); | |||||
| break; | |||||
| case OB_MBALL: | |||||
| return (!(soops->hideflag & SO_HIDE_MBALL)); | |||||
| break; | |||||
| case OB_LAMP: | |||||
| return (!(soops->hideflag & SO_HIDE_LAMP)); | |||||
| break; | |||||
| case OB_CAMERA: | |||||
| return (!(soops->hideflag & SO_HIDE_CAMERA)); | |||||
| break; | |||||
| case OB_SPEAKER: | |||||
| return (!(soops->hideflag & SO_HIDE_SPEAKER)); | |||||
| break; | |||||
| case OB_LATTICE: | |||||
| return (!(soops->hideflag & SO_HIDE_LATTICE)); | |||||
| break; | |||||
| case OB_ARMATURE: | |||||
| return (!(soops->hideflag & SO_HIDE_ARMATURE)); | |||||
| break; | |||||
| } | |||||
| return true; | |||||
| } | |||||
| static int tree_show_types_all(bContext *C, wmOperator *UNUSED(op)) | |||||
| { | |||||
| bScreen *screen = CTX_wm_screen(C); | |||||
| SpaceOops *soops = CTX_wm_space_outliner(C); | |||||
| PointerRNA soops_ptr; | |||||
| PropertyRNA *prop; | |||||
| /* init the RNA-pointer */ | |||||
| RNA_pointer_create(&screen->id, &RNA_SpaceOutliner, soops, &soops_ptr); | |||||
| /* Objects */ | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_meshes"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_curves"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_surfaces"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_metaballs"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_armatures"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_lattices"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_empties"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_speakers"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_cameras"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_lamps"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| /* Object Data */ | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_obdata"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_obdata_extras"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_ob_groups"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_ob_extras"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_bones"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| /* Shading */ | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_textures"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_images"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_materials"); | |||||
| /* Animation */ | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_animdata"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_shapekeys"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| prop = RNA_struct_find_property(&soops_ptr, "show_types_gpdata"); | |||||
| RNA_property_boolean_set(&soops_ptr, prop, 1); | |||||
| /* send notifiers */ | |||||
| WM_event_add_notifier(C, NC_SPACE | ND_SPACE_OUTLINER, NULL); | |||||
| return OPERATOR_FINISHED; | |||||
| } | |||||
| void OUTLINER_OT_tree_show_types_all(wmOperatorType *ot) | |||||
| { | |||||
| ot->name = "Show all Types"; | |||||
| ot->idname = "OUTLINER_OT_tree_show_types_all"; | |||||
| ot->description = "Show/Enable all possible Types visibility in Outliner Hierarchy"; | |||||
| ot->exec = tree_show_types_all; | |||||
| ot->poll = ED_operator_outliner_active; | |||||
| } | |||||
| /* Filtering ----------------------------------------------- */ | /* Filtering ----------------------------------------------- */ | ||||
| static bool outliner_filter_has_name(TreeElement *te, const char *name, int flags) | static bool outliner_filter_has_name(TreeElement *te, const char *name, int flags) | ||||
| Context not available. | |||||
| tselem->flag &= ~TSE_CLOSED; | tselem->flag &= ~TSE_CLOSED; | ||||
| for (base = sce->base.first; base; base = base->next) { | for (base = sce->base.first; base; base = base->next) { | ||||
| if (outliner_hide_check(soops, base->object->type)) { | |||||
| ten = outliner_add_element(soops, &te->subtree, base->object, te, 0, 0); | ten = outliner_add_element(soops, &te->subtree, base->object, te, 0, 0); | ||||
| ten->directdata = base; | ten->directdata = base; | ||||
| } | } | ||||
| } | |||||
| outliner_make_hierarchy(&te->subtree); | outliner_make_hierarchy(&te->subtree); | ||||
| /* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */ | /* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */ | ||||
| for (base = sce->base.first; base; base = base->next) base->object->id.newid = NULL; | for (base = sce->base.first; base; base = base->next) base->object->id.newid = NULL; | ||||
| Context not available. | |||||
| outliner_add_scene_contents(soops, &soops->tree, scene, NULL); | outliner_add_scene_contents(soops, &soops->tree, scene, NULL); | ||||
| for (base = scene->base.first; base; base = base->next) { | for (base = scene->base.first; base; base = base->next) { | ||||
| if (outliner_hide_check(soops, base->object->type)) { | |||||
| ten = outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); | ten = outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); | ||||
| ten->directdata = base; | ten->directdata = base; | ||||
| } | } | ||||
| } | |||||
| outliner_make_hierarchy(&soops->tree); | outliner_make_hierarchy(&soops->tree); | ||||
| } | } | ||||
| else if (soops->outlinevis == SO_VISIBLE) { | else if (soops->outlinevis == SO_VISIBLE) { | ||||
| for (base = scene->base.first; base; base = base->next) { | for (base = scene->base.first; base; base = base->next) { | ||||
| if (base->lay & scene->lay) | if ((base->lay & scene->lay) && outliner_hide_check(soops, base->object->type)) | ||||
| outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); | outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); | ||||
| } | } | ||||
| outliner_make_hierarchy(&soops->tree); | outliner_make_hierarchy(&soops->tree); | ||||
| Context not available. | |||||
| te = outliner_add_element(soops, &soops->tree, group, NULL, 0, 0); | te = outliner_add_element(soops, &soops->tree, group, NULL, 0, 0); | ||||
| for (go = group->gobject.first; go; go = go->next) { | for (go = group->gobject.first; go; go = go->next) { | ||||
| if (outliner_hide_check(soops, go->ob->type)) { | |||||
| ten = outliner_add_element(soops, &te->subtree, go->ob, te, 0, 0); | ten = outliner_add_element(soops, &te->subtree, go->ob, te, 0, 0); | ||||
| ten->directdata = NULL; /* eh, why? */ | ten->directdata = NULL; /* eh, why? */ | ||||
| } | } | ||||
| } | |||||
| outliner_make_hierarchy(&te->subtree); | outliner_make_hierarchy(&te->subtree); | ||||
| /* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */ | /* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */ | ||||
| for (go = group->gobject.first; go; go = go->next) go->ob->id.newid = NULL; | for (go = group->gobject.first; go; go = go->next) go->ob->id.newid = NULL; | ||||
| Context not available. | |||||
| Object *ob = OBACT; | Object *ob = OBACT; | ||||
| if (ob) { | if (ob) { | ||||
| for (base = scene->base.first; base; base = base->next) { | for (base = scene->base.first; base; base = base->next) { | ||||
| if (base->object->type == ob->type) { | if ((base->object->type == ob->type) && (outliner_hide_check(soops, base->object->type))){ | ||||
| ten = outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); | ten = outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); | ||||
| ten->directdata = base; | ten->directdata = base; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| else if (soops->outlinevis == SO_SELECTED) { | else if (soops->outlinevis == SO_SELECTED) { | ||||
| for (base = scene->base.first; base; base = base->next) { | for (base = scene->base.first; base; base = base->next) { | ||||
| if (base->lay & scene->lay) { | if ((base->lay & scene->lay) && (outliner_hide_check(soops, base->object->type))){ | ||||
| if (base == BASACT || (base->flag & SELECT)) { | if (base == BASACT || (base->flag & SELECT)) { | ||||
| ten = outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); | ten = outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); | ||||
| ten->directdata = base; | ten->directdata = base; | ||||
| Context not available. | |||||