1 # BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # END GPL LICENSE BLOCK #####
21 "name": "Texture Atlas",
22 "author": "Andreas Esau, Paul Geraskin, Campbell Barton",
24 "blender": (2, 67, 0),
25 "location": "Properties > Render",
26 "description": "A simple Texture Atlas for unwrapping many objects. It creates additional UV",
27 "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/UV/TextureAtlas",
28 "tracker_url": "https://developer.blender.org/T32494",
32 from bpy
.types
import (Operator
,
37 from bpy
.props
import (BoolProperty
,
47 def check_all_objects_visible(self
, context
):
49 group
= scene
.ms_lightmap_groups
[scene
.ms_lightmap_groups_index
]
50 isAllObjectsVisible
= True
51 bpy
.ops
.object.select_all(action
='DESELECT')
52 for thisObject
in bpy
.data
.groups
[group
.name
].objects
:
53 isThisObjectVisible
= False
54 # scene.objects.active = thisObject
55 for thisLayerNumb
in range(20):
56 if thisObject
.layers
[thisLayerNumb
] is True and scene
.layers
[thisLayerNumb
] is True:
57 isThisObjectVisible
= True
59 # If Object is on an invisible Layer
60 if isThisObjectVisible
is False:
61 isAllObjectsVisible
= False
62 return isAllObjectsVisible
65 def check_group_exist(self
, context
, use_report
=True):
67 group
= scene
.ms_lightmap_groups
[scene
.ms_lightmap_groups_index
]
69 if group
.name
in bpy
.data
.groups
:
73 self
.report({'INFO'}, "No Such Group %r!" % group
.name
)
77 class TexAtl_Main(Panel
):
78 bl_label
= "Texture Atlas"
79 bl_space_type
= 'PROPERTIES'
80 bl_region_type
= 'WINDOW'
82 COMPAT_ENGINES
= {'BLENDER_RENDER'}
84 def draw(self
, context
):
88 col
= self
.layout
.column()
89 row
= self
.layout
.row()
90 split
= self
.layout
.split()
92 row
.template_list("UI_UL_list", "template_list_controls", scene
,
93 "ms_lightmap_groups", scene
, "ms_lightmap_groups_index", rows
=2, maxrows
=5)
94 col
= row
.column(align
=True)
95 col
.operator("scene.ms_add_lightmap_group", icon
='ZOOMIN', text
="")
96 col
.operator("scene.ms_del_lightmap_group", icon
='ZOOMOUT', text
="")
98 row
= self
.layout
.row(align
=True)
100 # Resolution and Unwrap types (only if Lightmap group is added)
101 if context
.scene
.ms_lightmap_groups
:
102 group
= scene
.ms_lightmap_groups
[scene
.ms_lightmap_groups_index
]
103 row
.prop(group
, 'resolution', text
='Resolution', expand
=True)
104 row
= self
.layout
.row()
105 row
.prop(group
, 'unwrap_type', text
='Lightmap', expand
=True)
106 row
= self
.layout
.row()
108 row
= self
.layout
.row()
109 row
.operator("scene.ms_remove_other_uv",
110 text
="RemoveOtherUVs", icon
="GROUP")
111 row
.operator("scene.ms_remove_selected",
112 text
="RemoveSelected", icon
="GROUP")
113 row
= self
.layout
.row()
114 row
= self
.layout
.row()
115 row
= self
.layout
.row()
116 row
.operator("scene.ms_add_selected_to_group",
117 text
="AddSelected", icon
="GROUP")
118 row
.operator("scene.ms_select_group",
119 text
="SelectGroup", icon
="GROUP")
121 row
= self
.layout
.row()
123 "object.ms_auto", text
="Auto Unwrap", icon
="LAMP_SPOT")
124 row
= self
.layout
.row()
126 "object.ms_run", text
="StartManualUnwrap", icon
="LAMP_SPOT")
128 "object.ms_run_remove", text
="FinshManualUnwrap", icon
="LAMP_SPOT")
131 class TexAtl_RunAuto(Operator
):
132 bl_idname
= "object.ms_auto"
133 bl_label
= "Auto Unwrapping"
134 bl_description
= "Auto Unwrapping"
136 def execute(self
, context
):
137 scene
= context
.scene
138 old_context
= context
.area
.type
140 # Check if group exists
141 if check_group_exist(self
, context
) is False:
144 group
= scene
.ms_lightmap_groups
[scene
.ms_lightmap_groups_index
]
145 context
.area
.type = 'VIEW_3D'
147 if bpy
.ops
.object.mode_set
.poll():
148 bpy
.ops
.object.mode_set(mode
='OBJECT', toggle
=False)
150 if group
.bake
is True and bpy
.data
.groups
[group
.name
].objects
:
152 # Check if objects are all on the visible Layers.
153 isAllObjVisible
= check_all_objects_visible(self
, context
)
155 if isAllObjVisible
is True:
156 res
= int(group
.resolution
)
157 bpy
.ops
.object.ms_create_lightmap(
158 group_name
=group
.name
, resolution
=res
)
159 bpy
.ops
.object.ms_merge_objects(
160 group_name
=group
.name
, unwrap
=True)
161 bpy
.ops
.object.ms_separate_objects(group_name
=group
.name
)
163 self
.report({'INFO'}, "Not All Objects Are Visible!!!")
165 context
.area
.type = old_context
170 class TexAtl_RunStart(Operator
):
171 bl_idname
= "object.ms_run"
172 bl_label
= "Make Manual Unwrapping Object"
173 bl_description
= "Makes Manual Unwrapping Object"
175 def execute(self
, context
):
176 scene
= context
.scene
177 old_context
= context
.area
.type
179 # Check if group exists
180 if check_group_exist(self
, context
) is False:
183 context
.area
.type = 'VIEW_3D'
184 group
= scene
.ms_lightmap_groups
[scene
.ms_lightmap_groups_index
]
186 if bpy
.ops
.object.mode_set
.poll():
187 bpy
.ops
.object.mode_set(mode
='OBJECT', toggle
=False)
189 if group
.bake
is True and bpy
.data
.groups
[group
.name
].objects
and bpy
.data
.objects
.get(group
.name
+ "_mergedObject") is None:
191 # Check if objects are all on the visible Layers.
192 isAllObjVisible
= check_all_objects_visible(self
, context
)
194 if isAllObjVisible
is True:
195 res
= int(group
.resolution
)
196 bpy
.ops
.object.ms_create_lightmap(
197 group_name
=group
.name
, resolution
=res
)
198 bpy
.ops
.object.ms_merge_objects(
199 group_name
=group
.name
, unwrap
=False)
201 self
.report({'INFO'}, "Not All Objects Are Visible!!!")
203 context
.area
.type = old_context
208 class TexAtl_RunFinish(Operator
):
209 bl_idname
= "object.ms_run_remove"
210 bl_label
= "Remove Manual Unwrapping Object"
211 bl_description
= "Removes Manual Unwrapping Object"
213 def execute(self
, context
):
214 scene
= context
.scene
215 old_context
= context
.area
.type
217 # Check if group exists
218 if check_group_exist(self
, context
) is False:
221 group
= scene
.ms_lightmap_groups
[scene
.ms_lightmap_groups_index
]
222 context
.area
.type = 'VIEW_3D'
224 if bpy
.ops
.object.mode_set
.poll():
225 bpy
.ops
.object.mode_set(mode
='OBJECT', toggle
=False)
227 if group
.bake
is True and bpy
.data
.groups
[group
.name
].objects
:
229 # Check if objects are all on the visible Layers.
230 isAllObjVisible
= check_all_objects_visible(self
, context
)
232 if isAllObjVisible
is True:
233 bpy
.ops
.object.ms_separate_objects(group_name
=group
.name
)
235 self
.report({'INFO'}, "Not All Objects Are Visible!!!")
237 context
.area
.type = old_context
241 class TexAtl_UVLayers(PropertyGroup
):
242 name
= StringProperty(default
="")
245 class TexAtl_VertexGroups(PropertyGroup
):
246 name
= StringProperty(default
="")
249 class TexAtl_Groups(PropertyGroup
):
250 name
= StringProperty(default
="")
253 class TexAtl_MSLightmapGroups(PropertyGroup
):
255 name
= StringProperty(default
="")
256 bake
= BoolProperty(default
=True)
258 unwrap_type
= EnumProperty(
260 items
=(('0', 'Smart_Unwrap', 'Smart_Unwrap'),
261 ('1', 'Lightmap', 'Lightmap'),
262 ('2', 'No_Unwrap', 'No_Unwrap'),
265 resolution
= EnumProperty(
267 items
=(('256', '256', ''),
269 ('1024', '1024', ''),
270 ('2048', '2048', ''),
271 ('4096', '4096', ''),
272 ('8192', '8192', ''),
273 ('16384', '16384', ''),
276 template_list_controls
= StringProperty(
282 class TexAtl_MergedObjects(PropertyGroup
):
283 name
= StringProperty()
284 vertex_groups
= CollectionProperty(
285 type=TexAtl_VertexGroups
,
287 groups
= CollectionProperty(type=TexAtl_Groups
)
288 uv_layers
= CollectionProperty(type=TexAtl_UVLayers
)
291 class TexAtl_AddSelectedToGroup(Operator
):
292 bl_idname
= "scene.ms_add_selected_to_group"
293 bl_label
= "Add to Group"
294 bl_description
= "Adds selected Objects to current Group"
296 def execute(self
, context
):
297 scene
= context
.scene
298 group_name
= scene
.ms_lightmap_groups
[
299 scene
.ms_lightmap_groups_index
].name
301 # Create a New Group if it was deleted.
302 obj_group
= bpy
.data
.groups
.get(group_name
)
303 if obj_group
is None:
304 obj_group
= bpy
.data
.groups
.new(group_name
)
306 # Add objects to a group
307 if bpy
.ops
.object.mode_set
.poll():
308 bpy
.ops
.object.mode_set(mode
='OBJECT', toggle
=False)
310 for object in context
.selected_objects
:
311 if object.type == 'MESH' and object.name
not in obj_group
.objects
:
312 obj_group
.objects
.link(object)
317 class TexAtl_SelectGroup(Operator
):
318 bl_idname
= "scene.ms_select_group"
319 bl_label
= "sel Group"
320 bl_description
= "Selected Objects of current Group"
322 def execute(self
, context
):
323 scene
= context
.scene
324 group_name
= scene
.ms_lightmap_groups
[
325 scene
.ms_lightmap_groups_index
].name
327 # Check if group exists
328 if check_group_exist(self
, context
) is False:
331 if bpy
.ops
.object.mode_set
.poll():
332 bpy
.ops
.object.mode_set(mode
='OBJECT', toggle
=False)
334 bpy
.ops
.object.select_all(action
='DESELECT')
335 obj_group
= bpy
.data
.groups
[group_name
]
336 for object in obj_group
.objects
:
341 class TexAtl_RemoveFromGroup(Operator
):
342 bl_idname
= "scene.ms_remove_selected"
343 bl_label
= "del Selected"
344 bl_description
= "Remove Selected Group and UVs"
346 # remove all modifiers
347 # for m in mesh.modifiers:
348 # bpy.ops.object.modifier_remove(modifier=m.name)
350 def execute(self
, context
):
351 scene
= context
.scene
353 # Check if group exists
354 if check_group_exist(self
, context
) is False:
357 if bpy
.ops
.object.mode_set
.poll():
358 bpy
.ops
.object.mode_set(mode
='OBJECT', toggle
=False)
360 for group
in scene
.ms_lightmap_groups
:
361 group_name
= group
.name
363 obj_group
= bpy
.data
.groups
[group_name
]
364 for object in context
.selected_objects
:
365 scene
.objects
.active
= object
367 if object.type == 'MESH' and object.name
in obj_group
.objects
:
370 tex
= object.data
.uv_textures
.get(group_name
)
372 object.data
.uv_textures
.remove(tex
)
375 obj_group
.objects
.unlink(object)
376 object.hide_render
= False
381 class TexAtl_RemoveOtherUVs(Operator
):
382 bl_idname
= "scene.ms_remove_other_uv"
383 bl_label
= "remOther"
384 bl_description
= "Remove Other UVs from Selected"
386 def execute(self
, context
):
387 scene
= context
.scene
388 group_name
= scene
.ms_lightmap_groups
[
389 scene
.ms_lightmap_groups_index
].name
391 # Check if group exists
392 if check_group_exist(self
, context
) is False:
395 if bpy
.ops
.object.mode_set
.poll():
396 bpy
.ops
.object.mode_set(mode
='OBJECT', toggle
=False)
397 # bpy.ops.object.select_all(action='DESELECT')
399 obj_group
= bpy
.data
.groups
[group_name
]
401 # Remove other UVs of selected objects
402 for object in context
.selected_objects
:
403 scene
.objects
.active
= object
404 if object.type == 'MESH' and object.name
in obj_group
.objects
:
408 for uv
in object.data
.uv_textures
:
409 if uv
.name
!= group_name
:
410 UVLIST
.append(uv
.name
)
412 for uvName
in UVLIST
:
413 tex
= object.data
.uv_textures
[uvName
]
414 object.data
.uv_textures
.remove(tex
)
416 UVLIST
.clear() # clear array
421 class TexAtl_AddLightmapGroup(Operator
):
422 bl_idname
= "scene.ms_add_lightmap_group"
423 bl_label
= "add Lightmap"
424 bl_description
= "Adds a new Lightmap Group"
426 name
= StringProperty(name
="Group Name", default
='TextureAtlas')
428 def execute(self
, context
):
429 scene
= context
.scene
430 obj_group
= bpy
.data
.groups
.new(self
.name
)
432 item
= scene
.ms_lightmap_groups
.add()
433 item
.name
= obj_group
.name
434 item
.resolution
= '1024'
435 scene
.ms_lightmap_groups_index
= len(scene
.ms_lightmap_groups
) - 1
437 # Add selested objects to group
438 for object in context
.selected_objects
:
439 if object.type == 'MESH':
440 obj_group
.objects
.link(object)
444 def invoke(self
, context
, event
):
445 wm
= context
.window_manager
446 return wm
.invoke_props_dialog(self
)
449 class TexAtl_DelLightmapGroup(Operator
):
450 bl_idname
= "scene.ms_del_lightmap_group"
451 bl_label
= "delete Lightmap"
452 bl_description
= "Deletes active Lightmap Group"
454 def execute(self
, context
):
455 scene
= context
.scene
456 if len(scene
.ms_lightmap_groups
) > 0:
457 idx
= scene
.ms_lightmap_groups_index
458 group_name
= scene
.ms_lightmap_groups
[idx
].name
461 group
= bpy
.data
.groups
.get(group_name
)
462 if group
is not None:
464 # Unhide Objects if they are hidden
465 for obj
in group
.objects
:
466 obj
.hide_render
= False
469 bpy
.data
.groups
.remove(group
)
471 # Remove Lightmap Group
472 scene
.ms_lightmap_groups
.remove(scene
.ms_lightmap_groups_index
)
473 scene
.ms_lightmap_groups_index
-= 1
474 if scene
.ms_lightmap_groups_index
< 0:
475 scene
.ms_lightmap_groups_index
= 0
480 class TexAtl_CreateLightmap(Operator
):
481 bl_idname
= "object.ms_create_lightmap"
482 bl_label
= "TextureAtlas - Generate Lightmap"
483 bl_description
= "Generates a Lightmap"
485 group_name
= StringProperty(default
='')
486 resolution
= IntProperty(default
=1024)
488 def execute(self
, context
):
489 scene
= context
.scene
491 # Create/Update Image
492 image
= bpy
.data
.images
.get(self
.group_name
)
494 image
= bpy
.data
.images
.new(
495 name
=self
.group_name
, width
=self
.resolution
, height
=self
.resolution
)
497 image
.generated_type
= 'COLOR_GRID'
498 image
.generated_width
= self
.resolution
499 image
.generated_height
= self
.resolution
500 obj_group
= bpy
.data
.groups
[self
.group_name
]
502 # non MESH objects for removal list
505 for object in obj_group
.objects
:
506 # Remove non MESH objects
508 if object.type != 'MESH':
509 NON_MESH_LIST
.append(object)
510 elif object.type == 'MESH' and len(object.data
.vertices
) == 0:
511 NON_MESH_LIST
.append(object)
514 if object.data
.uv_textures
.active
is None:
515 tex
= object.data
.uv_textures
.new()
516 tex
.name
= self
.group_name
518 if self
.group_name
not in object.data
.uv_textures
:
519 tex
= object.data
.uv_textures
.new()
520 tex
.name
= self
.group_name
522 tex
.active_render
= True
524 tex
= object.data
.uv_textures
[self
.group_name
]
526 tex
.active_render
= True
528 for face_tex
in tex
.data
:
529 face_tex
.image
= image
531 # remove non NESH objects
532 for object in NON_MESH_LIST
:
533 obj_group
.objects
.unlink(object)
535 NON_MESH_LIST
.clear() # clear array
540 class TexAtl_MergeObjects(Operator
):
541 bl_idname
= "object.ms_merge_objects"
542 bl_label
= "TextureAtlas - TexAtl_MergeObjects"
543 bl_description
= "Merges Objects and stores Origins"
545 group_name
= StringProperty(default
='')
546 unwrap
= BoolProperty(default
=False)
548 def execute(self
, context
):
549 scene
= context
.scene
552 bpy
.ops
.object.select_all(action
='DESELECT')
553 for obj
in scene
.objects
:
554 if obj
.name
== self
.group_name
+ "_mergedObject":
556 scene
.objects
.active
= obj
557 bpy
.ops
.object.delete(use_global
=False)
559 me
= bpy
.data
.meshes
.new(self
.group_name
+ '_mergedObject')
560 ob_merge
= bpy
.data
.objects
.new(self
.group_name
+ '_mergedObject', me
)
561 ob_merge
.location
= scene
.cursor_location
# position object at 3d-cursor
562 scene
.objects
.link(ob_merge
) # Link object to scene
564 ob_merge
.select
= False
566 bpy
.ops
.object.select_all(action
='DESELECT')
568 for object in bpy
.data
.groups
[self
.group_name
].objects
:
570 # make object temporary unhidden
571 isObjHideSelect
= object.hide_select
573 object.hide_select
= False
575 bpy
.ops
.object.select_all(action
='DESELECT')
578 # activate lightmap uv if existant
579 for uv
in object.data
.uv_textures
:
580 if uv
.name
== self
.group_name
:
582 scene
.objects
.active
= object
584 # Duplicate Temp Object
585 bpy
.ops
.object.select_all(action
='DESELECT')
587 scene
.objects
.active
= object
588 bpy
.ops
.object.duplicate(linked
=False, mode
='TRANSLATION')
589 activeNowObject
= scene
.objects
.active
590 activeNowObject
.select
= True
592 # hide render of original mesh
593 object.hide_render
= True
595 object.select
= False
596 object.hide_select
= isObjHideSelect
601 for uv
in activeNowObject
.data
.uv_textures
:
602 if uv
.name
!= self
.group_name
:
603 UVLIST
.append(uv
.name
)
605 for uvName
in UVLIST
:
606 tex
= activeNowObject
.data
.uv_textures
[uvName
]
607 activeNowObject
.data
.uv_textures
.remove(tex
)
609 UVLIST
.clear() # clear array
611 # create vertex groups for each selected object
612 scene
.objects
.active
= activeNowObject
613 vgroup
= activeNowObject
.vertex_groups
.new(name
=object.name
)
615 list(range(len(activeNowObject
.data
.vertices
))), weight
=1.0, type='ADD')
617 # save object name and object location in merged object
618 item
= ob_merge
.ms_merged_objects
.add()
619 item
.name
= object.name
621 # Add material to a tempObject if there are no materialSlots on the object
622 if not activeNowObject
.data
.materials
:
623 matName
= "zz_TextureAtlas_NO_Material"
624 mat
= bpy
.data
.materials
.get(matName
)
627 mat
= bpy
.data
.materials
.new(matName
)
629 activeNowObject
.data
.materials
.append(mat
)
631 # merge objects together
632 bpy
.ops
.object.select_all(action
='DESELECT')
633 activeNowObject
.select
= True
634 ob_merge
.select
= True
635 scene
.objects
.active
= ob_merge
636 bpy
.ops
.object.join()
639 bpy
.ops
.object.select_all(action
='DESELECT')
640 ob_merge
.select
= True
641 scene
.objects
.active
= ob_merge
644 bpy
.ops
.object.mode_set(mode
='EDIT')
645 bpy
.ops
.mesh
.reveal()
646 bpy
.ops
.mesh
.select_all(action
='SELECT')
647 bpy
.ops
.object.mode_set(mode
='OBJECT', toggle
=False)
649 if self
.unwrap
is True:
650 unwrapType
= scene
.ms_lightmap_groups
[self
.group_name
].unwrap_type
652 if unwrapType
== '0' or unwrapType
== '1':
653 bpy
.ops
.object.mode_set(mode
='EDIT')
655 if unwrapType
== '0':
656 bpy
.ops
.uv
.smart_project(
657 angle_limit
=72.0, island_margin
=0.2, user_area_weight
=0.0)
658 elif unwrapType
== '1':
659 bpy
.ops
.uv
.lightmap_pack(
660 PREF_CONTEXT
='ALL_FACES', PREF_PACK_IN_ONE
=True, PREF_NEW_UVLAYER
=False,
661 PREF_APPLY_IMAGE
=False, PREF_IMG_PX_SIZE
=1024, PREF_BOX_DIV
=48, PREF_MARGIN_DIV
=0.2)
662 bpy
.ops
.object.mode_set(mode
='OBJECT', toggle
=False)
667 class TexAtl_SeparateObjects(Operator
):
668 bl_idname
= "object.ms_separate_objects"
669 bl_label
= "TextureAtlas - Separate Objects"
670 bl_description
= "Separates Objects and restores Origin"
672 group_name
= StringProperty(default
='')
674 def execute(self
, context
):
675 scene
= context
.scene
677 for obj
in scene
.objects
:
678 if obj
.name
== self
.group_name
+ "_mergedObject":
680 # if scene.objects.active is not None:
681 # bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
682 bpy
.ops
.object.select_all(action
='DESELECT')
685 ob_merged
.select
= True
686 groupSeparate
= bpy
.data
.groups
.new(ob_merged
.name
)
687 groupSeparate
.objects
.link(ob_merged
)
688 ob_merged
.select
= False
690 doUnhidePolygons
= False
691 for ms_obj
in ob_merged
.ms_merged_objects
:
692 # select vertex groups and separate group from merged
694 bpy
.ops
.object.select_all(action
='DESELECT')
695 ob_merged
.select
= True
696 scene
.objects
.active
= ob_merged
698 bpy
.ops
.object.mode_set(mode
='EDIT')
699 if doUnhidePolygons
is False:
700 # Unhide Polygons only once
701 bpy
.ops
.mesh
.reveal()
702 doUnhidePolygons
= True
704 bpy
.ops
.mesh
.select_all(action
='DESELECT')
705 ob_merged
.vertex_groups
.active_index
= ob_merged
.vertex_groups
[
707 bpy
.ops
.object.vertex_group_select()
708 bpy
.ops
.mesh
.separate(type='SELECTED')
709 bpy
.ops
.object.mode_set(mode
='OBJECT', toggle
=False)
710 # scene.objects.active.select = False
712 # find separeted object
714 for obj
in groupSeparate
.objects
:
719 # Copy UV Coordinates to the original mesh
720 if ms_obj
.name
in scene
.objects
:
721 ob_merged
.select
= False
722 ob_original
= scene
.objects
[ms_obj
.name
]
723 isOriginalToSelect
= ob_original
.hide_select
724 ob_original
.hide_select
= False
725 ob_original
.hide
= False
726 ob_original
.select
= True
727 scene
.objects
.active
= ob_separeted
728 bpy
.ops
.object.join_uvs()
729 ob_original
.hide_render
= False
730 ob_original
.select
= False
731 ob_original
.hide_select
= isOriginalToSelect
733 # delete separeted object
734 bpy
.ops
.object.select_all(action
='DESELECT')
735 ob_separeted
.select
= True
736 bpy
.ops
.object.delete(use_global
=False)
738 # delete duplicated object
739 bpy
.ops
.object.select_all(action
='DESELECT')
740 ob_merged
.select
= True
741 bpy
.ops
.object.delete(use_global
=False)
747 bpy
.utils
.register_module(__name__
)
749 bpy
.types
.Object
.ms_merged_objects
= CollectionProperty(
750 type=TexAtl_MergedObjects
)
752 bpy
.types
.Scene
.ms_lightmap_groups
= CollectionProperty(
753 type=TexAtl_MSLightmapGroups
)
755 bpy
.types
.Scene
.ms_lightmap_groups_index
= IntProperty()
758 bpy
.utils
.unregister_module(__name__
)
761 if __name__
== "__main__":