BGe: Fix T45597 wrong object layer for linked object in blenderplayer.

This commit is contained in:
Porteries Tristan 2015-08-06 16:58:52 +02:00
parent f5a333fe65
commit 44384c698d
Notes: blender-bot 2023-02-14 08:49:52 +01:00
Referenced by issue #45716, Can't open images after Purge Orphan Datablocks. Opened images are not zeroed user.
Referenced by issue #45717, Only "None" OpenSubDiv option in preferences to choose from
Referenced by issue #45722, Shutdown when enabling world background display
Referenced by issue #45597, AddObject doesn't work with linked objects in Blenderplayer
1 changed files with 15 additions and 0 deletions

View File

@ -1720,6 +1720,18 @@ static void UNUSED_FUNCTION(print_active_constraints2)(Object *ob) //not used, u
}
}
// Copy base layer to object layer like in BKE_scene_set_background
static void blenderSceneSetBackground(Scene *blenderscene)
{
Scene *it;
Base *base;
for (SETLOOPER(blenderscene, it, base)) {
base->object->lay = base->lay;
base->object->flag = base->flag;
}
}
static KX_GameObject* getGameOb(STR_String busc,CListValue* sumolist)
{
@ -1972,6 +1984,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
}
SetDefaultLightMode(blenderscene);
blenderSceneSetBackground(blenderscene);
// Let's support scene set.
// Beware of name conflict in linked data, it will not crash but will create confusion
// in Python scripting and in certain actuators (replace mesh). Linked scene *should* have