Skip to content

Commit

Permalink
fixing pistol stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
DotPrism committed Sep 2, 2024
1 parent 6bf03a1 commit 95211ce
Show file tree
Hide file tree
Showing 4 changed files with 1,495 additions and 1,440 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public void preInit()
registerEntityRenderer(EntityAMTTactile.class, EntityRenderNone::new);


IIContent.itemAssaultRifle.setTileEntityItemStackRenderer(new PistolRenderer().subscribeToList("assault_rifle"));
IIContent.itemAssaultRifle.setTileEntityItemStackRenderer(new AssaultRifleRenderer().subscribeToList("assault_rifle"));
IIContent.itemRifle.setTileEntityItemStackRenderer(new RifleRenderer().subscribeToList("rifle"));
IIContent.itemSubmachinegun.setTileEntityItemStackRenderer(new SubmachinegunRenderer().subscribeToList("submachinegun"));
IIContent.itemShotgun.setTileEntityItemStackRenderer(new ShotgunRenderer().subscribeToList("shotgun"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import re


def fix_uv_coordinates(obj_file_path, output_file_path):
with open(obj_file_path, 'r') as file:
lines = file.readlines()

fixed_lines = []

# Regular expression pattern to match lines with UV coordinates (vt)
uv_pattern = re.compile(r'vt\s+([-+]?[0-9]*\.?[0-9]+)\s+([-+]?[0-9]*\.?[0-9]+)')

for line in lines:
match = uv_pattern.match(line)
if match:
# Extracting U and V coordinates
u = float(match.group(1))
v = float(match.group(2))

# Apply positive modulo operation to bring them in range [0, 1]
u = max(0, min(1, u))
v = max(0, min(1, v))

# Replace the original line with the fixed UV coordinates
fixed_line = f"vt {u:.6f} {v:.6f}\n"
fixed_lines.append(fixed_line)
else:
# If the line does not contain UV coordinates, keep it as is
fixed_lines.append(line)

# Write the modified content to a new .obj file
with open(output_file_path, 'w') as file:
file.writelines(fixed_lines)


if __name__ == "__main__":
input_file = "input.obj" # Replace with your input .obj file path
output_file = "output.obj" # Replace with your desired output .obj file path

fix_uv_coordinates(input_file, output_file)
print(f"UV coordinates have been fixed and saved to {output_file}.")
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,18 @@ map_Kd immersiveintelligence:items/weapons/pistol
newmtl 1bcal
map_Kd immersiveintelligence:items/weapons/1bcal
newmtl attachments
map_Kd immersiveintelligence:items/weapons/attachments
map_Kd immersiveintelligence:items/weapons/attachments
newmtl attachments
map_Kd immersiveintelligence:block/attachments
newmtl radio_backpack
map_Kd immersiveintelligence:block/radio_backpack
newmtl technician_gear
map_Kd immersiveintelligence:block/technician_gear
newmtl infiltrator_gear
map_Kd immersiveintelligence:block/infiltrator_gear
newmtl mount_infrared
map_Kd immersiveintelligence:block/mount_infrared
newmtl common_copper_cable
map_Kd immersiveintelligence:block/common_copper_cable
newmtl assault_rifle
map_Kd immersiveintelligence:block/assault_rifle
Loading

0 comments on commit 95211ce

Please sign in to comment.