Feature: Overrides support collection objects

This commit is contained in:
Eugenio Pignataro 2020-04-17 14:24:21 -03:00
parent ab7daecbb2
commit cc3dadcdfe
1 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,13 @@ def ApplyOverrides(dummy):
if ob.type == "MESH":
if not ob.hide_viewport and not ob.hide_render:
obDict.append([ob,[mat for mat in ob.data.materials]])
if ob.type == "EMPTY":
if not ob.instance_collection == None:
for iob in ob.instance_collection.all_objects:
if iob.type == "MESH":
if not iob.hide_viewport and not iob.hide_render:
obDict.append([iob,[mat for mat in iob.data.materials]])
for override in bpy.context.scene.ovlist:
@ -42,6 +49,13 @@ def ApplyOverrides(dummy):
if not ob.hide_viewport and not ob.hide_render:
for i,mat in enumerate(ob.data.materials):
ob.data.materials[i] = bpy.data.materials[matClean]
if ob.type == "EMPTY":
if not ob.instance_collection == None:
for iob in ob.instance_collection.all_objects:
if iob.type == "MESH":
if not iob.hide_viewport and not iob.hide_render:
for i,mat in enumerate(iob.data.materials):
iob.data.materials[i] = bpy.data.materials[matClean]
@persistent