Cleanup: remove LodLevel

This was part of the game engine and is not used anymore.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8666
This commit is contained in:
Jacques Lucke 2020-08-21 15:24:36 +02:00
parent 79d678e677
commit 71634d94ca
5 changed files with 0 additions and 62 deletions

View File

@ -156,7 +156,6 @@ static ThreadMutex vparent_lock = BLI_MUTEX_INITIALIZER;
#endif
static void copy_object_pose(Object *obn, const Object *ob, const int flag);
static void copy_object_lod(Object *obn, const Object *ob, const int flag);
static void object_init_data(ID *id)
{
@ -264,8 +263,6 @@ static void object_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const in
ob_dst->avs = ob_src->avs;
ob_dst->mpath = animviz_copy_motionpath(ob_src->mpath);
copy_object_lod(ob_dst, ob_src, flag_subdata);
/* Do not copy object's preview
* (mostly due to the fact renderers create temp copy of objects). */
if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0 && false) { /* XXX TODO temp hack */
@ -314,8 +311,6 @@ static void object_free_data(ID *id)
BLI_freelistN(&ob->pc_ids);
BLI_freelistN(&ob->lodlevels);
/* Free runtime curves data. */
if (ob->runtime.curve_cache) {
BKE_curve_bevelList_free(&ob->runtime.curve_cache->bev);
@ -499,12 +494,6 @@ static void object_foreach_id(ID *id, LibraryForeachIDData *data)
BKE_LIB_FOREACHID_PROCESS(data, object->rigidbody_constraint->ob2, IDWALK_CB_NEVER_SELF);
}
if (object->lodlevels.first) {
LISTBASE_FOREACH (LodLevel *, level, &object->lodlevels) {
BKE_LIB_FOREACHID_PROCESS(data, level->source, IDWALK_CB_NEVER_SELF);
}
}
BKE_modifiers_foreach_ID_link(object, library_foreach_modifiersForeachIDLink, data);
BKE_gpencil_modifiers_foreach_ID_link(
object, library_foreach_gpencil_modifiersForeachIDLink, data);
@ -1585,13 +1574,6 @@ static void copy_object_pose(Object *obn, const Object *ob, const int flag)
}
}
static void copy_object_lod(Object *obn, const Object *ob, const int UNUSED(flag))
{
BLI_duplicatelist(&obn->lodlevels, &ob->lodlevels);
obn->currentlod = (LodLevel *)obn->lodlevels.first;
}
bool BKE_object_pose_context_check(const Object *ob)
{
if ((ob) && (ob->type == OB_ARMATURE) && (ob->pose) && (ob->mode & OB_MODE_POSE)) {

View File

@ -4669,16 +4669,6 @@ static void lib_link_object(BlendLibReader *reader, Object *ob)
BLO_read_id_address(reader, ob->id.lib, &ob->rigidbody_constraint->ob2);
}
{
LISTBASE_FOREACH (LodLevel *, level, &ob->lodlevels) {
BLO_read_id_address(reader, ob->id.lib, &level->source);
if (!level->source && level == ob->lodlevels.first) {
level->source = ob;
}
}
}
if (warn) {
BKE_report(reader->fd->reports, RPT_WARNING, "Warning in console");
}
@ -5343,9 +5333,6 @@ static void direct_link_object(BlendDataReader *reader, Object *ob)
}
}
BLO_read_list(reader, &ob->lodlevels);
ob->currentlod = ob->lodlevels.first;
ob->preview = direct_link_preview_image(reader, ob->preview);
}
@ -10240,12 +10227,6 @@ static void expand_object(BlendExpander *expander, Object *ob)
BLO_expand(expander, ob->rigidbody_constraint->ob1);
BLO_expand(expander, ob->rigidbody_constraint->ob2);
}
if (ob->currentlod) {
LISTBASE_FOREACH (LodLevel *, level, &ob->lodlevels) {
BLO_expand(expander, level->source);
}
}
}
#ifdef USE_COLLECTION_COMPAT_28

View File

@ -891,17 +891,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
/* hysteresis set to 10% but not activated */
if (!DNA_struct_elem_find(fd->filesdna, "LodLevel", "int", "obhysteresis")) {
Object *ob;
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
LodLevel *level;
for (level = ob->lodlevels.first; level; level = level->next) {
level->obhysteresis = 10;
}
}
}
}
if (!MAIN_VERSION_ATLEAST(bmain, 274, 4)) {

View File

@ -1693,7 +1693,6 @@ static void write_object(BlendWriter *writer, Object *ob, const void *id_address
write_shaderfxs(writer, &ob->shader_fx);
BLO_write_struct_list(writer, LinkData, &ob->pc_ids);
BLO_write_struct_list(writer, LodLevel, &ob->lodlevels);
write_previews(writer, ob->preview);
}

View File

@ -108,15 +108,6 @@ enum {
BOUNDBOX_DIRTY = (1 << 1),
};
typedef struct LodLevel {
struct LodLevel *next, *prev;
struct Object *source;
int flags;
float distance;
char _pad0[4];
int obhysteresis;
} LodLevel;
struct CustomData_MeshMasks;
/* Not saved in file! */
@ -393,10 +384,6 @@ typedef struct Object {
char empty_image_flag;
char _pad8[5];
/** Contains data for levels of detail. */
ListBase lodlevels;
LodLevel *currentlod;
struct PreviewImage *preview;
/** Runtime evaluation data (keep last). */