18
18
"author" : "mattedickson" ,
19
19
"wiki_url" : "https://github.com/mattedicksoncom/blender-xatlas/" ,
20
20
"tracker_url" : "https://github.com/mattedicksoncom/blender-xatlas/issues" ,
21
- "version" : (0 , 0 , 6 ),
21
+ "version" : (0 , 0 , 7 ),
22
22
"blender" : (2 , 83 , 0 ),
23
23
"location" : "3D View > Toolbox" ,
24
24
"category" : "Object" ,
@@ -278,7 +278,7 @@ class PG_SharedProperties (PropertyGroup):
278
278
description = "Don't unwrap the meshes, only, pack them" ,
279
279
default = False
280
280
)
281
-
281
+
282
282
283
283
# end PropertyGroups---------------------------
284
284
@@ -328,7 +328,7 @@ def execute(self, context):
328
328
context .view_layer .objects .active = startingActiveObject
329
329
bpy .ops .object .mode_set (mode = startingMode )
330
330
# bpy.context.selected_objects = startingSelection
331
-
331
+
332
332
333
333
return {'FINISHED' }
334
334
@@ -362,7 +362,7 @@ def execute(self, context):
362
362
363
363
#store the names of objects
364
364
rename_dict = dict ()
365
-
365
+
366
366
#make sure all the objects have ligthmap uvs
367
367
for obj in selected_objects :
368
368
if obj .type == 'MESH' :
@@ -427,13 +427,13 @@ def execute(self, context):
427
427
use_mesh_modifiers = True ,
428
428
use_edges = True ,
429
429
use_smooth_groups = False ,
430
- use_smooth_groups_bitflags = False ,
430
+ use_smooth_groups_bitflags = False ,
431
431
use_normals = True ,
432
432
use_uvs = True ,
433
433
use_materials = False ,
434
434
use_triangles = False ,
435
- use_nurbs = False ,
436
- use_vertex_groups = False ,
435
+ use_nurbs = False ,
436
+ use_vertex_groups = False ,
437
437
use_blen_objects = True ,
438
438
group_by_object = False ,
439
439
group_by_material = False ,
@@ -490,7 +490,7 @@ def execute(self, context):
490
490
491
491
#RUN xatlas process
492
492
xatlas_process = subprocess .Popen (
493
- xatlas_path + ' ' + arguments_string ,
493
+ r'"{}"' . format ( xatlas_path ) + ' ' + arguments_string ,
494
494
stdin = subprocess .PIPE ,
495
495
stdout = subprocess .PIPE ,
496
496
shell = True
@@ -520,17 +520,17 @@ class uvObject:
520
520
obName : string = ""
521
521
uvArray : List [float ] = field (default_factory = list )
522
522
faceArray : List [int ] = field (default_factory = list )
523
-
523
+
524
524
convertedObjects = []
525
525
uvArrayComplete = []
526
526
527
-
527
+
528
528
#search through the out put for STARTOBJ
529
529
#then start reading the objects
530
530
obTest = None
531
531
startRead = False
532
532
for line in outObj .splitlines ():
533
-
533
+
534
534
line_split = line .split ()
535
535
536
536
if not line_split :
@@ -542,14 +542,14 @@ class uvObject:
542
542
print ("Start reading the objects----------------------------------------" )
543
543
startRead = True
544
544
# obTest = uvObject()
545
-
545
+
546
546
if startRead :
547
547
#if it's a new obj
548
548
if line_start == 'o' :
549
549
#if there is already an object append it
550
550
if obTest is not None :
551
551
convertedObjects .append (obTest )
552
-
552
+
553
553
obTest = uvObject () #create new uv object
554
554
obTest .obName = line_split [1 ]
555
555
@@ -575,8 +575,8 @@ class uvObject:
575
575
#append the final object
576
576
convertedObjects .append (obTest )
577
577
# print(convertedObjects)
578
-
579
-
578
+
579
+
580
580
#apply the output-------------------------------------------------------------
581
581
#copy the uvs to the original objects
582
582
# objIndex = 0
@@ -601,7 +601,7 @@ class uvObject:
601
601
602
602
nFaces = len (bm .faces )
603
603
#need to ensure lookup table for some reason?
604
- if hasattr (bm .faces , "ensure_lookup_table" ):
604
+ if hasattr (bm .faces , "ensure_lookup_table" ):
605
605
bm .faces .ensure_lookup_table ()
606
606
607
607
#loop through the faces
@@ -639,7 +639,7 @@ class uvObject:
639
639
currentObject = bpy .context .scene .objects [edgeList ['object' ]]
640
640
bm = bmesh .new ()
641
641
bm .from_mesh (currentObject .data )
642
- if hasattr (bm .edges , "ensure_lookup_table" ):
642
+ if hasattr (bm .edges , "ensure_lookup_table" ):
643
643
bm .edges .ensure_lookup_table ()
644
644
645
645
#assume that all the triangulated edges come after the original edges
@@ -663,7 +663,7 @@ class uvObject:
663
663
current_object = bpy .context .scene .objects [objectName ]
664
664
current_object .select_set (True )
665
665
context .view_layer .objects .active = current_object
666
-
666
+
667
667
bpy .ops .object .mode_set (mode = startingMode )
668
668
669
669
print ("Finished Xatlas----------------------------------------" )
@@ -676,7 +676,7 @@ class uvObject:
676
676
class OBJECT_PT_xatlas_panel (Panel ):
677
677
bl_idname = "OBJECT_PT_xatlas_panel"
678
678
bl_label = "Xatlas Tools"
679
- bl_space_type = "VIEW_3D"
679
+ bl_space_type = "VIEW_3D"
680
680
bl_region_type = "UI"
681
681
bl_category = "Xatlas"
682
682
bl_context = ""
@@ -696,7 +696,7 @@ def draw(self, context):
696
696
class OBJECT_PT_pack_panel (Panel ):
697
697
bl_idname = "OBJECT_PT_pack_panel"
698
698
bl_label = "Pack Options"
699
- bl_space_type = "VIEW_3D"
699
+ bl_space_type = "VIEW_3D"
700
700
bl_region_type = "UI"
701
701
bl_category = "Xatlas"
702
702
bl_parent_id = 'OBJECT_PT_xatlas_panel'
@@ -721,7 +721,7 @@ def draw(self, context):
721
721
class OBJECT_PT_chart_panel (Panel ):
722
722
bl_idname = "OBJECT_PT_chart_panel"
723
723
bl_label = "Chart Options"
724
- bl_space_type = "VIEW_3D"
724
+ bl_space_type = "VIEW_3D"
725
725
bl_region_type = "UI"
726
726
bl_category = "Xatlas"
727
727
bl_parent_id = 'OBJECT_PT_xatlas_panel'
@@ -745,7 +745,7 @@ def draw(self, context):
745
745
class OBJECT_PT_run_panel (Panel ):
746
746
bl_idname = "OBJECT_PT_run_panel"
747
747
bl_label = "Run Xatlas"
748
- bl_space_type = "VIEW_3D"
748
+ bl_space_type = "VIEW_3D"
749
749
bl_region_type = "UI"
750
750
bl_category = "Xatlas"
751
751
bl_parent_id = 'OBJECT_PT_xatlas_panel'
@@ -794,8 +794,8 @@ def draw(self, context):
794
794
row = box .row ()
795
795
row .label (text = "Atlas Layout" )
796
796
row .prop ( scene .shared_properties , 'atlasLayout' )
797
-
798
-
797
+
798
+
799
799
box .operator ("object.setup_unwrap" , text = "Run Xatlas" )
800
800
801
801
row = box .row ()
@@ -830,7 +830,7 @@ def register():
830
830
bpy .types .Scene .chart_tool = PointerProperty (type = PG_ChartProperties )
831
831
bpy .types .Scene .shared_properties = PointerProperty (type = PG_SharedProperties )
832
832
833
-
833
+
834
834
835
835
#
836
836
@@ -843,8 +843,8 @@ def unregister():
843
843
del bpy .types .Scene .shared_properties
844
844
del bpy .types .Scene .chart_tool
845
845
del bpy .types .Scene .pack_tool
846
-
847
-
846
+
847
+
848
848
849
849
850
850
0 commit comments