Skip to content

Commit

Permalink
Zip
Browse files Browse the repository at this point in the history
  • Loading branch information
crapola committed Jan 19, 2023
1 parent bfc60a8 commit f362c55
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"blender": (2,80,0),
"location": "File > Import-Export ; Object",
"description": "Import and export UnrealED .T3D files.",
"doc_url":"", # TODO: Link to repo.
"tracker_url":"", # TODO: Link to repo.
"doc_url":"https://github.com/crapola/blender_t3d",
"tracker_url":"https://github.com/crapola/blender_t3d/issues",
"support":"COMMUNITY",
"category":"Import-Export", # Category in Add-ons browser.
}
Expand Down
18 changes: 0 additions & 18 deletions importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

import bmesh
import bpy
import mathutils
from mathutils import Euler, Vector

try:
from . import t3d_parser
except:
import t3d_parser
pass
#t3d_parser=bpy.data.texts["t3d_parser.py"].as_module()

TEXTURE_SIZE:float=256.0

Expand Down Expand Up @@ -47,14 +44,6 @@ def import_t3d_file(
continue
data=b.get_pydata()

# Invert Y's
# for v in data[0]:
# v[1]=-v[1]
# if b.location:
# b.location=(b.location[0],-b.location[1],b.location[2])
# if b.prepivot:
# b.prepivot=(b.prepivot[0],-b.prepivot[1],b.prepivot[2])

# Snap to grid.
if snap_vertices:
b.snap(snap_distance)
Expand All @@ -66,7 +55,6 @@ def import_t3d_file(

# Flip.
if b.csg=="CSG_Subtract" and flip:
print("FLIP!")
m.flip_normals()

# Create object.
Expand All @@ -78,7 +66,6 @@ def import_t3d_file(
o.color=(1,0.5,0,1) if b.csg=="CSG_Subtract" else (0,0,1,1)

# Apply transforms.

mainscale=Vector(b.mainscale or (1,1,1))
pivot=Vector(b.prepivot or (0,0,0))
postscale=Vector(b.postscale or (1,1,1))
Expand All @@ -89,8 +76,6 @@ def import_t3d_file(
pivot.rotate(rotation)
pivot*=postscale*mainscale

print(f"{b.actor_name} PrePivot=",pivot)

o.scale=mainscale
o.rotation_euler=rotation
o.location-=pivot
Expand All @@ -114,9 +99,6 @@ def import_t3d_file(
# Assign the face.
face.material_index=material_index_by_name(o,texture_names[i])
face[layer_flags]=flags[i]
print(face.calc_tangent_edge())

#bm.faces.layers.tex.verify()
# UV coordinates.
poly=b.polygons[i]
for j,loop in enumerate(face.loops):
Expand Down
7 changes: 7 additions & 0 deletions zip_release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mkdir .\blender_t3d -Force
$files="__init__.py","exporter.py","importer.py","t3d_parser.py","t3d.py"
foreach ($f in $files) {
copy-item $f .\blender_t3d
}
compress-archive .\blender_t3d .\blender_t3d.zip -Force
del .\blender_t3d

0 comments on commit f362c55

Please sign in to comment.