mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Group materials through collections
This commit is contained in:
parent
c8af9c3b0e
commit
e8b5fd6e9f
1 changed files with 9 additions and 8 deletions
|
@ -120,7 +120,7 @@ def import_map( filename ):
|
|||
"""
|
||||
radius = get_vector( ent, "light_radius" )
|
||||
print( radius.magnitude )
|
||||
lightData.distance = radius.length
|
||||
lightData.energy = radius.magnitude * 750.0
|
||||
lightData.use_nodes = True
|
||||
|
||||
# create new object with our lamp datablock
|
||||
|
@ -302,11 +302,11 @@ def import_map( filename ):
|
|||
for ( tex, groupName ) in groupDict:
|
||||
if mat == tex:
|
||||
group = None
|
||||
if groupName in bpy.data.groups:
|
||||
group = bpy.data.groups[ groupName ]
|
||||
group.objects.link( ob )
|
||||
if groupName in bpy.data.collections:
|
||||
collection = bpy.data.collections[ groupName ]
|
||||
collection.objects.link( meshObj )
|
||||
else:
|
||||
bpy.ops.group.create( name = groupName )
|
||||
bpy.ops.collection.create( name = groupName )
|
||||
|
||||
|
||||
|
||||
|
@ -383,8 +383,9 @@ def unregister():
|
|||
bpy.types.INFO_MT_file_import.remove( menu_func_import )
|
||||
|
||||
if __name__ == "__main__":
|
||||
#register()
|
||||
register()
|
||||
|
||||
# test for fast iteration
|
||||
filename = 'C:/Projects/RBDOOM-3-BFG/base/maps/testmaps/test_box.json'
|
||||
import_map( filename )
|
||||
#filename = 'C:/Projects/RBDOOM-3-BFG/base/maps/testmaps/test_box.json'
|
||||
#filename = 'C:/Projects/RBDOOM-3-BFG/base/maps/game/pdas.json'
|
||||
#import_map( filename )
|
Loading…
Reference in a new issue