More tests
2
.gitignore
vendored
@@ -0,0 +1,2 @@
|
||||
dev_stuff/gen_amp_textures/.venv
|
||||
dev_stuff/gen_amp_textures/output
|
||||
@@ -1,14 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<clothingItem>
|
||||
<m_MaleModel>Amputation\Amputation_Left_LowerArm_Male</m_MaleModel>
|
||||
<m_MaleModel>Amputation\Amputation_FA_LR</m_MaleModel>
|
||||
<m_FemaleModel>Amputation\Amputation_Left_LowerArm_Female</m_FemaleModel>
|
||||
<m_GUID>d3816fe0-48e1-4cf5-a8e4-48c72595edb4</m_GUID>
|
||||
<m_Static>false</m_Static>
|
||||
<m_AllowRandomHue>false</m_AllowRandomHue>
|
||||
<m_AllowRandomTint>false</m_AllowRandomTint>
|
||||
|
||||
<m_Masks>3</m_Masks>
|
||||
<m_UnderlayMasksFolder>media/textures/Amputations/Masks/TestDouble</m_UnderlayMasksFolder>
|
||||
|
||||
<m_Masks>4</m_Masks>
|
||||
<m_Masks>6</m_Masks>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<clothingItem>
|
||||
<m_MaleModel>Amputation\Amputation_FA_LR</m_MaleModel>
|
||||
<m_FemaleModel>Amputation\Amputation_FA_LR</m_FemaleModel>
|
||||
<m_GUID>8e5bc1b4-d79b-4a17-b86b-71dab6ace816</m_GUID>
|
||||
<m_Static>false</m_Static>
|
||||
<m_AllowRandomHue>false</m_AllowRandomHue>
|
||||
<m_AllowRandomTint>false</m_AllowRandomTint>
|
||||
|
||||
<m_Masks>4</m_Masks>
|
||||
<m_Masks>6</m_Masks>
|
||||
|
||||
|
||||
|
||||
<!-- HUMAN -->
|
||||
<textureChoices>Amputations\Human\Forearm\skin01_b</textureChoices>
|
||||
<textureChoices>Amputations\Human\Forearm\skin02_b</textureChoices>
|
||||
<textureChoices>Amputations\Human\Forearm\skin03_b</textureChoices>
|
||||
<textureChoices>Amputations\Human\Forearm\skin04_b</textureChoices>
|
||||
<textureChoices>Amputations\Human\Forearm\skin05_b</textureChoices>
|
||||
|
||||
<textureChoices>Amputations\Human\Forearm\skin01_hairy_b</textureChoices>
|
||||
<textureChoices>Amputations\Human\Forearm\skin02_hairy_b</textureChoices>
|
||||
<textureChoices>Amputations\Human\Forearm\skin03_hairy_b</textureChoices>
|
||||
<textureChoices>Amputations\Human\Forearm\skin04_hairy_b</textureChoices>
|
||||
<textureChoices>Amputations\Human\Forearm\skin05_hairy_b</textureChoices>
|
||||
|
||||
|
||||
<!-- HUMAN AFTER CICATRIZATION -->
|
||||
|
||||
<textureChoices>Body\MaleBody01</textureChoices>
|
||||
<textureChoices>Body\MaleBody02</textureChoices>
|
||||
<textureChoices>Body\MaleBody03</textureChoices>
|
||||
<textureChoices>Body\MaleBody04</textureChoices>
|
||||
<textureChoices>Body\MaleBody05</textureChoices>
|
||||
|
||||
<textureChoices>Body\MaleBody01a</textureChoices>
|
||||
<textureChoices>Body\MaleBody02a</textureChoices>
|
||||
<textureChoices>Body\MaleBody03a</textureChoices>
|
||||
<textureChoices>Body\MaleBody04</textureChoices>
|
||||
<textureChoices>Body\MaleBody05a</textureChoices>
|
||||
|
||||
|
||||
<!-- ZOMBIE -->
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin01_l1</textureChoices>
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin01_l2</textureChoices>
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin01_l3</textureChoices>
|
||||
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin02_l1</textureChoices>
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin02_l2</textureChoices>
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin02_l3</textureChoices>
|
||||
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin03_l1</textureChoices>
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin03_l2</textureChoices>
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin03_l3</textureChoices>
|
||||
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin04_l1</textureChoices>
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin04_l2</textureChoices>
|
||||
<textureChoices>Amputations\Zombie\Forearm\z_skin04_l3</textureChoices>
|
||||
|
||||
</clothingItem>
|
||||
@@ -57,5 +57,11 @@
|
||||
<guid>9a5fe063-63c7-4e6f-81ca-ee77c6678e0d</guid>
|
||||
</files>
|
||||
|
||||
<!-- TEST -->
|
||||
<files>
|
||||
<path>media/clothing/clothingItems/Amputation_ForeArm_LR.xml</path>
|
||||
<guid>8e5bc1b4-d79b-4a17-b86b-71dab6ace816</guid>
|
||||
</files>
|
||||
|
||||
|
||||
</fileGuidTable>
|
||||
@@ -17,7 +17,7 @@ ItemsController.Player = {}
|
||||
---@return number
|
||||
---@private
|
||||
function ItemsController.Player.GetAmputationTexturesIndex(playerObj, isCicatrized)
|
||||
-- FIX Broken
|
||||
-- todo
|
||||
local textureString = playerObj:getHumanVisual():getSkinTexture()
|
||||
local isHairy = textureString:sub(-1) == "a"
|
||||
|
||||
@@ -79,13 +79,16 @@ end
|
||||
---Deletes all the old amputation items, used for resets
|
||||
---@param playerObj IsoPlayer
|
||||
function ItemsController.Player.DeleteAllOldAmputationItems(playerObj)
|
||||
-- TODO Fix visual bug
|
||||
-- This part is a workaround for a pretty shitty implementation on the java side. Check ProsthesisHandler for more infos
|
||||
local group = BodyLocations.getGroup("Human")
|
||||
group:setMultiItem("TOC_Arm", false)
|
||||
group:setMultiItem("TOC_ArmProst", false)
|
||||
-- local group = BodyLocations.getGroup("Human")
|
||||
-- group:setMultiItem("TOC_Arm", false)
|
||||
-- group:setMultiItem("TOC_ArmProst", false)
|
||||
|
||||
for i = 1, #StaticData.LIMBS_STR do
|
||||
local limbName = StaticData.LIMBS_STR[i]
|
||||
|
||||
-- TODO Won't work with dedicated clothingItems for multi amps
|
||||
local clothItemName = StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. limbName
|
||||
local clothItem = playerObj:getInventory():FindAndReturn(clothItemName)
|
||||
---@cast clothItem InventoryItem
|
||||
@@ -94,8 +97,8 @@ function ItemsController.Player.DeleteAllOldAmputationItems(playerObj)
|
||||
-- Reset model just in case
|
||||
playerObj:resetModel()
|
||||
|
||||
group:setMultiItem("TOC_Arm", true)
|
||||
group:setMultiItem("TOC_ArmProst", true)
|
||||
-- group:setMultiItem("TOC_Arm", true)
|
||||
-- group:setMultiItem("TOC_ArmProst", true)
|
||||
end
|
||||
|
||||
---Spawns and equips the correct amputation item to the player.
|
||||
|
||||
@@ -43,23 +43,26 @@ function BodyLocationsAPI.MoveOrCreateBeforeOrAfter(toRelocateOrCreate, location
|
||||
end
|
||||
end
|
||||
|
||||
-- function TestBodyLocations()
|
||||
-- local group = BodyLocations.getGroup("Human")
|
||||
-- local x = group:getAllLocations()
|
||||
function TestBodyLocations()
|
||||
local group = BodyLocations.getGroup("Human")
|
||||
local x = group:getAllLocations()
|
||||
|
||||
-- for i=0, x:size() -1 do
|
||||
for i=0, x:size() -1 do
|
||||
|
||||
-- ---@type BodyLocation
|
||||
-- local bl = x:get(i)
|
||||
---@type BodyLocation
|
||||
local bl = x:get(i)
|
||||
|
||||
-- print(bl:getId())
|
||||
-- end
|
||||
-- end
|
||||
print(bl:getId())
|
||||
end
|
||||
end
|
||||
|
||||
-- MultiItem causes a ton of issues... fucking hell
|
||||
|
||||
BodyLocationsAPI.MoveOrCreateBeforeOrAfter("TOC_Arm", "FullTop", true)
|
||||
group:setMultiItem("TOC_Arm", true)
|
||||
-- BodyLocationsAPI.MoveOrCreateBeforeOrAfter("TOC_Arm", "Shirt", true)
|
||||
-- group:setMultiItem("TOC_Arm", true)
|
||||
|
||||
local curItem = BodyLocation.new(group, "TOC_Arm") -- create new item
|
||||
group:getAllLocations():add(curItem) -- add to the list
|
||||
|
||||
BodyLocationsAPI.MoveOrCreateBeforeOrAfter("TOC_ArmProst", "TOC_Arm", true)
|
||||
group:setMultiItem("TOC_ArmProst", true)
|
||||
|
||||
BIN
common/media/models_X/Amputation/Amputation_FA_LR.fbx
Normal file
@@ -109,4 +109,24 @@ module TOC
|
||||
CanHaveHoles = false,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
item Amputation_FA_LR
|
||||
{
|
||||
Type = Clothing,
|
||||
DisplayCategory = Amputation,
|
||||
|
||||
ClothingItem = Amputation_ForeArm_LR,
|
||||
BodyLocation = TOC_Arm,
|
||||
|
||||
Weight = 0,
|
||||
CombatSpeedModifier = 0.7,
|
||||
BloodLocation = UpperArms;UpperBody,
|
||||
Insulation = 1.0,
|
||||
WindResistance = 1.0,
|
||||
WaterResistance = 1.0,
|
||||
CanHaveHoles = false,
|
||||
}
|
||||
}
|
||||
BIN
common/media/textures/Amputations/Masks/TestDouble/Belt.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
common/media/textures/Amputations/Masks/TestDouble/Chest.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
common/media/textures/Amputations/Masks/TestDouble/Crotch.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
common/media/textures/Amputations/Masks/TestDouble/Dress.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
common/media/textures/Amputations/Masks/TestDouble/Head.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
common/media/textures/Amputations/Masks/TestDouble/LeftArm.png
Normal file
|
After Width: | Height: | Size: 826 B |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
BIN
common/media/textures/Amputations/Masks/TestDouble/LeftHand.png
Normal file
|
After Width: | Height: | Size: 644 B |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
common/media/textures/Amputations/Masks/TestDouble/RightArm.png
Normal file
|
After Width: | Height: | Size: 844 B |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 20 KiB |
BIN
common/media/textures/Amputations/Masks/TestDouble/Waist.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
dev_stuff/gen_amp_textures/input/body/MaleBody01.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
dev_stuff/gen_amp_textures/input/body/MaleBody01a.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
dev_stuff/gen_amp_textures/input/body/MaleBody02.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
dev_stuff/gen_amp_textures/input/body/MaleBody02a.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
dev_stuff/gen_amp_textures/input/body/MaleBody03.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
dev_stuff/gen_amp_textures/input/body/MaleBody03a.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
dev_stuff/gen_amp_textures/input/body/MaleBody04.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
dev_stuff/gen_amp_textures/input/body/MaleBody04a.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
dev_stuff/gen_amp_textures/input/body/MaleBody05.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
dev_stuff/gen_amp_textures/input/body/MaleBody05a.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
dev_stuff/gen_amp_textures/input/wound.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
46
dev_stuff/gen_amp_textures/main.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from pathlib import Path
|
||||
from PIL import Image
|
||||
|
||||
input_bodies_path = Path('input/body')
|
||||
input_wound_texture = Path('input/wound.png')
|
||||
# 48, 33 TEXTURE
|
||||
|
||||
|
||||
# 256,256
|
||||
|
||||
IMG_WIDTH = 256
|
||||
|
||||
|
||||
COORDS_L = {
|
||||
#"H": (0, 115),
|
||||
"F": (0, 59),
|
||||
"U": (0,21),
|
||||
}
|
||||
|
||||
COORDS_R = {
|
||||
#"H": (IMG_WIDTH - 50- COORDS_L['H'][0], COORDS_L['H'][1]),
|
||||
"F": (IMG_WIDTH - 48 - COORDS_L['F'][0], COORDS_L['F'][1]),
|
||||
"U": (IMG_WIDTH - 48 - COORDS_L['U'][0], COORDS_L['U'][1]),
|
||||
}
|
||||
|
||||
STATES = ["BOTH"]
|
||||
|
||||
|
||||
overlay = Image.open(input_wound_texture)
|
||||
|
||||
for filepath in input_bodies_path.glob('*.png'): # Only PNG files
|
||||
base = Image.open(filepath)
|
||||
body_name = filepath.stem
|
||||
|
||||
|
||||
for key_L, value_L in COORDS_L.items():
|
||||
for key_R, value_R in COORDS_R.items():
|
||||
for state in STATES:
|
||||
result = base.copy()
|
||||
|
||||
if state == "BOTH" or state == "ONLY_LEFT":
|
||||
result.paste(overlay, value_L, mask=overlay)
|
||||
if state == "BOTH" or state == "ONLY_RIGHT":
|
||||
result.paste(overlay, value_R, mask=overlay)
|
||||
|
||||
result.save(f'output/{body_name}_{key_L}_{key_R}_{state}.png')
|
||||