- Home /
Select only objects with lightmap.
Hello. I've a very complex scene that is backed. Not all objects are baked only the most important, this could be several hundred betwen many thousan non baked total 12K objects.
I need to rebake the lightmaps on baked objects and would need to select those objects that have lightmap only to recall the baking.
I cant figure out how to perform this operation. any ideas?
Comment
Answer by UNZoOM · Mar 30, 2015 at 05:18 PM
You can set a common tag for all the objects with lightmap.
Assuming an array
for(var i:int =0;i<LightMappedArr.length;i++)
{
LightMappedArr[i].tag = "lightMapTag";
}
// Find Those and Perform whatever operation
var LightObjs = GameObject.FindGameObjectsWithTag("lightMapTag");
foreach(var x in LightObjs )
{
// x.GetComponent()....
}
Your answer
