Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_info/info_stats.c
| Show All 31 Lines | |||||
| #include "DNA_armature_types.h" | #include "DNA_armature_types.h" | ||||
| #include "DNA_curve_types.h" | #include "DNA_curve_types.h" | ||||
| #include "DNA_group_types.h" | #include "DNA_group_types.h" | ||||
| #include "DNA_lattice_types.h" | #include "DNA_lattice_types.h" | ||||
| #include "DNA_meta_types.h" | #include "DNA_meta_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "BLI_listbase.h" | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "BKE_anim.h" | #include "BKE_anim.h" | ||||
| #include "BKE_blender_version.h" | #include "BKE_blender_version.h" | ||||
| ▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void stats_object_sculpt_dynamic_topology(Object *ob, SceneStats *stats) | static void stats_object_sculpt_dynamic_topology(Object *ob, SceneStats *stats) | ||||
| { | { | ||||
| stats->totvert = ob->sculpt->bm->totvert; | stats->totvert = ob->sculpt->bm->totvert; | ||||
| stats->tottri = ob->sculpt->bm->totface; | stats->tottri = ob->sculpt->bm->totface; | ||||
| } | } | ||||
| static void stats_dupli_object_group_count(SceneCollection *scene_collection, int *count) | static void stats_dupli_object_group_count(Collection *collection, int *count) | ||||
| { | { | ||||
| for (LinkData *link = scene_collection->objects.first; link; link = link->next) { | *count += BLI_listbase_count(&collection->gobject); | ||||
| (*count)++; | |||||
| } | |||||
| SceneCollection *scene_collection_nested; | for (CollectionChild *child = collection->children.first; child; child = child->next) { | ||||
| for (scene_collection_nested = scene_collection->scene_collections.first; | stats_dupli_object_group_count(child->collection, count); | ||||
| scene_collection_nested; | |||||
| scene_collection_nested = scene_collection_nested->next) | |||||
| { | |||||
| stats_dupli_object_group_count(scene_collection_nested, count); | |||||
| } | } | ||||
| } | } | ||||
| static void stats_dupli_object_group_doit(SceneCollection *scene_collection, SceneStats *stats, ParticleSystem *psys, | static void stats_dupli_object_group_doit(Collection *collection, SceneStats *stats, ParticleSystem *psys, | ||||
| const int totgroup, int *cur) | const int totgroup, int *cur) | ||||
| { | { | ||||
| for (LinkData *link = scene_collection->objects.first; link; link = link->next) { | for (CollectionObject *cob = collection->gobject.first; cob; cob = cob->next) { | ||||
| int tot = count_particles_mod(psys, totgroup, *cur); | int tot = count_particles_mod(psys, totgroup, *cur); | ||||
| stats_object(link->data, 0, tot, stats); | stats_object(cob->ob, 0, tot, stats); | ||||
| (*cur)++; | (*cur)++; | ||||
| } | } | ||||
| SceneCollection *scene_collection_nested; | for (CollectionChild *child = collection->children.first; child; child = child->next) { | ||||
| for (scene_collection_nested = scene_collection->scene_collections.first; | stats_dupli_object_group_doit(child->collection, stats, psys, totgroup, cur); | ||||
| scene_collection_nested; | |||||
| scene_collection_nested = scene_collection_nested->next) | |||||
| { | |||||
| stats_dupli_object_group_doit(scene_collection_nested, stats, psys, totgroup, cur); | |||||
| } | } | ||||
| } | } | ||||
| static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats) | static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats) | ||||
| { | { | ||||
| if (base->flag & BASE_SELECTED) stats->totobjsel++; | if (base->flag & BASE_SELECTED) stats->totobjsel++; | ||||
| if (ob->transflag & OB_DUPLIPARTS) { | if (ob->transflag & OB_DUPLIPARTS) { | ||||
| /* Dupli Particles */ | /* Dupli Particles */ | ||||
| ParticleSystem *psys; | ParticleSystem *psys; | ||||
| ParticleSettings *part; | ParticleSettings *part; | ||||
| for (psys = ob->particlesystem.first; psys; psys = psys->next) { | for (psys = ob->particlesystem.first; psys; psys = psys->next) { | ||||
| part = psys->part; | part = psys->part; | ||||
| if (part->draw_as == PART_DRAW_OB && part->dup_ob) { | if (part->draw_as == PART_DRAW_OB && part->dup_ob) { | ||||
| int tot = count_particles(psys); | int tot = count_particles(psys); | ||||
| stats_object(part->dup_ob, 0, tot, stats); | stats_object(part->dup_ob, 0, tot, stats); | ||||
| } | } | ||||
| else if (part->draw_as == PART_DRAW_GR && part->dup_group) { | else if (part->draw_as == PART_DRAW_GR && part->dup_group) { | ||||
| int totgroup = 0, cur = 0; | int totgroup = 0, cur = 0; | ||||
| SceneCollection *scene_collection = part->dup_group->collection; | Collection *collection = part->dup_group; | ||||
| stats_dupli_object_group_count(scene_collection, &totgroup); | stats_dupli_object_group_count(collection, &totgroup); | ||||
| stats_dupli_object_group_doit(scene_collection, stats, psys, totgroup, &cur); | stats_dupli_object_group_doit(collection, stats, psys, totgroup, &cur); | ||||
| } | } | ||||
| } | } | ||||
| stats_object(ob, base->flag & BASE_SELECTED, 1, stats); | stats_object(ob, base->flag & BASE_SELECTED, 1, stats); | ||||
| stats->totobj++; | stats->totobj++; | ||||
| } | } | ||||
| else if (ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS | OB_DUPLIFACES))) { | else if (ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS | OB_DUPLIFACES))) { | ||||
| /* Dupli Verts/Faces */ | /* Dupli Verts/Faces */ | ||||
| ▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines | |||||