; WWMI ALPHA-2 INI

; Mod State -------------------------

[Constants]
global $required_wwmi_version = 0.70
global $object_guid = 197598
global $mesh_vertex_count = 54256
global $shapekey_vertex_count = 26653
global $mod_id = -1000
global $state_id = 0
global $mod_enabled = 0
global $object_detected = 0
global persist $body =0
global persist $key1 =0
global persist $key2 =0
global persist $key3 =0
[keybody]
condition= $object_detected
key=5
type = cycle
$body=0,1
[key1]
condition= $object_detected
key=6
type = cycle
$key1=0,1,2

[key2]
condition= $object_detected
key=7
type = cycle
$key2=0,1
[key3]
condition= $object_detected
key=8
type = cycle
$key3=0,1
[Present]
if $object_detected
	if $mod_enabled
		post $object_detected = 0
		run = CommandListUpdateMergedSkeleton
	else
		if $mod_id == -1000
			run = CommandListRegisterMod
		endif
	endif
endif

[CommandListRegisterMod]
$\WWMIv1\required_wwmi_version = $required_wwmi_version
$\WWMIv1\object_guid = $object_guid
Resource\WWMIv1\ModName = ref ResourceModName
Resource\WWMIv1\ModAuthor = ref ResourceModAuthor
Resource\WWMIv1\ModDesc = ref ResourceModDesc
Resource\WWMIv1\ModLink = ref ResourceModLink
Resource\WWMIv1\ModLogo = ref ResourceModLogo
run = CommandList\WWMIv1\RegisterMod
$mod_id = $\WWMIv1\mod_id
if $mod_id >= 0
	$mod_enabled = 1
endif

[CommandListUpdateMergedSkeleton]
if $state_id
	$state_id = 0
else
	$state_id = 1
endif
ResourceMergedSkeleton = copy ResourceMergedSkeletonRW
ResourceExtraMergedSkeleton = copy ResourceExtraMergedSkeletonRW

; Resources: Mod Info -------------------------

[ResourceModName]
type = Buffer
data = "Unnamed Mod"

[ResourceModAuthor]
type = Buffer
data = "kefou"

[ResourceModDesc]
; type = Buffer
; data = "Empty Mod Description"

[ResourceModLink]
; type = Buffer
; data = "Empty Mod Link"

[ResourceModLogo]
; filename = Textures/Logo.dds

; Shading: Draw Call Stacks Processing -------------------------

[TextureOverrideMarkBoneDataCB]
hash = f02baf77
match_priority = 0
filter_index = 3381.7777

[CommandListMergeSkeleton]
$\WWMIv1\custom_mesh_scale = 1.0
cs-cb8 = ref vs-cb4
cs-u6 = ResourceMergedSkeletonRW
run = CustomShader\WWMIv1\SkeletonMerger
cs-cb8 = ref vs-cb3
cs-u6 = ResourceExtraMergedSkeletonRW
run = CustomShader\WWMIv1\SkeletonMerger

[CommandListTriggerResourceOverrides]
CheckTextureOverride = ps-t0
CheckTextureOverride = ps-t1
CheckTextureOverride = ps-t2
CheckTextureOverride = ps-t3
CheckTextureOverride = ps-t4
CheckTextureOverride = ps-t5
CheckTextureOverride = ps-t6
CheckTextureOverride = ps-t7
CheckTextureOverride = vs-cb3
CheckTextureOverride = vs-cb4

[CommandListOverrideSharedResources]
ResourceBypassVB0 = ref vb0
ib = ResourceIndexBuffer
vb0 = ResourcePositionBuffer
vb1 = ResourceVectorBuffer
vb2 = ResourceTexcoordBuffer
vb3 = ResourceColorBuffer
vb4 = ResourceBlendBuffer
if vs-cb3 == 3381.7777
	vs-cb3 = ResourceExtraMergedSkeleton
endif
if vs-cb4 == 3381.7777
	vs-cb4 = ResourceMergedSkeleton
endif

[CommandListCleanupSharedResources]
vb0 = ref ResourceBypassVB0

[TextureOverrideComponent0]
hash = 42702199
match_first_index = 0
match_index_count = 21477
$object_detected = 1
if $mod_enabled
	local $state_id_0
	if $state_id_0 != $state_id
		$state_id_0 = $state_id
		$\WWMIv1\vg_offset = 0
		$\WWMIv1\vg_count = 17
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 0.005
		drawindexed = 21477, 0, 0
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent1]
hash = 42702199
match_first_index = 21477
match_index_count = 42579
if $mod_enabled
	local $state_id_1
	if $state_id_1 != $state_id
		$state_id_1 = $state_id
		$\WWMIv1\vg_offset = 17
		$\WWMIv1\vg_count = 18
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 1.011
		drawindexed = 42579, 21477, 0
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent2]
hash = 42702199
match_first_index = 64056
match_index_count = 11484
if $mod_enabled
	local $state_id_2
	if $state_id_2 != $state_id
		$state_id_2 = $state_id
		$\WWMIv1\vg_offset = 35
		$\WWMIv1\vg_count = 5
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 2.006
		drawindexed = 11484, 64056, 0
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent3]
hash = 42702199
match_first_index = 75540
match_index_count = 32769
if $mod_enabled
	local $state_id_3
	if $state_id_3 != $state_id
		$state_id_3 = $state_id
		$\WWMIv1\vg_offset = 40
		$\WWMIv1\vg_count = 51
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 3.丝袜
		drawindexed = 71508, 75540, 0
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent4]
hash = 42702199
match_first_index = 108309
match_index_count = 87327
if $mod_enabled
	local $state_id_4
	if $state_id_4 != $state_id
		$state_id_4 = $state_id
		$\WWMIv1\vg_offset = 91
		$\WWMIv1\vg_count = 105
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 4.009
		drawindexed = 5916, 147048, 0
 if $key1==0
		; Draw Component 4.上衣.001
		drawindexed = 7806, 152964, 0
else if $key1 ==1
		; Draw Component 4.乳环2
		drawindexed = 6792, 160770, 0
endif
 if $key2==0
		; Draw Component 4.袖子
		drawindexed = 12180, 167562, 0
		; Draw Component 4.袖子.002
		drawindexed = 4392, 181290, 0
endif

                ; Draw Component 4.手环
		drawindexed = 1008, 179742, 0
		
               ; Draw Component 4.腿环
		drawindexed = 540, 180750, 0

if $key3==0	
		; Draw Component 4.裙子
		drawindexed = 6501, 185682, 0
endif

		; Draw Component 4.高跟鞋.001
		drawindexed = 46344, 192183, 0
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent5]
hash = 42702199
match_first_index = 195636
match_index_count = 1872
if $mod_enabled
	local $state_id_5
	if $state_id_5 != $state_id
		$state_id_5 = $state_id
		$\WWMIv1\vg_offset = 196
		$\WWMIv1\vg_count = 1
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 5.002
		drawindexed = 1872, 238527, 0
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent6]
hash = 42702199
match_first_index = 197508
match_index_count = 90
if $mod_enabled
	local $state_id_6
	if $state_id_6 != $state_id
		$state_id_6 = $state_id
		$\WWMIv1\vg_offset = 197
		$\WWMIv1\vg_count = 6
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 6.003
		drawindexed = 90, 240399, 0
		run = CommandListCleanupSharedResources
	endif
endif

; Shading: Textures -------------------------

[ResourceTexture0]
filename = Textures/Components-0 t=7d1b007a.dds

[TextureOverrideTexture0]
hash = 7d1b007a
match_priority = 0
this = ResourceTexture0

[ResourceTexture1]
filename = Textures/Components-0-1-2-3-4 t=ab012b35.dds

[TextureOverrideTexture1]
hash = ab012b35
match_priority = 0
this = ResourceTexture1

[ResourceTexture2]
filename = Textures/Components-0-1-2-3-4-5 t=5019e88f.dds

[TextureOverrideTexture2]
hash = 5019e88f
match_priority = 0
this = ResourceTexture2

[ResourceTexture3]
filename = Textures/Components-0-1-2-3-4-6 t=9f6eaf2e.dds

[TextureOverrideTexture3]
hash = 9f6eaf2e
match_priority = 0
this = ResourceTexture3

[ResourceTexture4]
filename = Textures/Components-0-1-2-3-4-6 t=c235c6a7.dds

[TextureOverrideTexture4]
hash = c235c6a7
match_priority = 0
this = ResourceTexture4

[ResourceTexture5]
filename = Textures/Components-0-2 t=1f0f6dc8.dds

[TextureOverrideTexture5]
hash = 1f0f6dc8
match_priority = 0
this = ResourceTexture5

[ResourceTexture6]
filename = Textures/Components-0-2-3-5 t=86b95122.dds
[ResourceTexture6A]
filename = Textures/Components-0-2-3-5 t=86b95122A.dds
[TextureOverrideTexture6]
hash = 86b95122
match_priority = 0
if $body ==0
this = ResourceTexture6
else
this = ResourceTexture6A
endif


[ResourceTexture7]
filename = Textures/Components-0-2-5 t=8383cbbf.dds

[TextureOverrideTexture7]
hash = 8383cbbf
match_priority = 0
this = ResourceTexture7

[ResourceTexture8]
filename = Textures/Components-1 t=5f0fbdb9.dds

[TextureOverrideTexture8]
hash = 5f0fbdb9
match_priority = 0
this = ResourceTexture8

[ResourceTexture9]
filename = Textures/Components-1 t=76967821.dds

[TextureOverrideTexture9]
hash = 76967821
match_priority = 0
this = ResourceTexture9

[ResourceTexture10]
filename = Textures/Components-2 t=30053482.dds

[TextureOverrideTexture10]
hash = 30053482
match_priority = 0
this = ResourceTexture10

[ResourceTexture11]
filename = Textures/Components-3 t=33d00a20.dds
[ResourceTexture11A]
filename = Textures/Components-3 t=33d00a20A.dds
[TextureOverrideTexture11]
hash = 33d00a20
match_priority = 0
if $body ==0
this = ResourceTexture11
else
this = ResourceTexture11A
endif

[ResourceTexture12]
filename = Textures/Components-3 t=750390fa.dds
[ResourceTexture12A]
filename = Textures/Components-3 t=750390faA.dds
[TextureOverrideTexture12]
hash = 750390fa
match_priority = 0
if $body ==0
this = ResourceTexture12
else
this = ResourceTexture12A
endif

[ResourceTexture13]
filename = Textures/Components-4 t=5065eae3.dds

[TextureOverrideTexture13]
hash = 5065eae3
match_priority = 0
this = ResourceTexture13

[ResourceTexture14]
filename = Textures/Components-4 t=711af10e.dds

[TextureOverrideTexture14]
hash = 711af10e
match_priority = 0
this = ResourceTexture14

[ResourceTexture15]
filename = Textures/Components-4 t=8493df3e.dds

[TextureOverrideTexture15]
hash = 8493df3e
match_priority = 0
this = ResourceTexture15

[ResourceTexture16]
filename = Textures/Components-5 t=e56f82b1.dds

[TextureOverrideTexture16]
hash = e56f82b1
match_priority = 0
this = ResourceTexture16

; Skinning: Shape Keys Override -------------------------

[TextureOverrideShapeKeyOffsets]
hash = 41d656e8
match_priority = 0
override_byte_stride = 24
override_vertex_count = $mesh_vertex_count

[TextureOverrideShapeKeyScale]
hash = 0c7361ae
match_priority = 0
override_byte_stride = 4
override_vertex_count = $mesh_vertex_count

[CommandListSetupShapeKeys]
$\WWMIv1\shapekey_checksum = 1780
cs-t33 = ResourceShapeKeyOffsetBuffer
cs-u5 = ResourceCustomShapeKeyValuesRW
cs-u6 = ResourceShapeKeyCBRW
run = CustomShader\WWMIv1\ShapeKeyOverrider

[CommandListLoadShapeKeys]
$\WWMIv1\shapekey_vertex_count = $shapekey_vertex_count
cs-t0 = ResourceShapeKeyVertexIdBuffer
cs-t1 = ResourceShapeKeyVertexOffsetBuffer
cs-u6 = ResourceShapeKeyCBRW
run = CustomShader\WWMIv1\ShapeKeyLoader

[TextureOverrideShapeKeyLoaderCallback]
hash = 41d656e8
match_priority = 0
if $mod_enabled
	if cs == 3381.3333 && ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListSetupShapeKeys
		run = CommandListLoadShapeKeys
	endif
endif

[CommandListMultiplyShapeKeys]
$\WWMIv1\custom_vertex_count = $mesh_vertex_count
run = CustomShader\WWMIv1\ShapeKeyMultiplier

[TextureOverrideShapeKeyMultiplierCallback]
hash = 41d656e8
match_priority = 0
if $mod_enabled
	if cs == 3381.4444 && ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListMultiplyShapeKeys
	endif
endif

; Resources: Shape Keys Override -------------------------

[ResourceShapeKeyCBRW]
type = RWBuffer
format = R32G32B32A32_UINT
array = 66

[ResourceCustomShapeKeyValuesRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 32

; Resources: Skeleton Override -------------------------

[ResourceMergedSkeleton]

[ResourceMergedSkeletonRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 768

[ResourceExtraMergedSkeleton]

[ResourceExtraMergedSkeletonRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 768

; Resources: Buffers -------------------------

[ResourceBypassVB0]

[ResourceIndexBuffer]
type = Buffer
format = DXGI_FORMAT_R32_UINT
stride = 12
filename = Meshes/Index.buf

[ResourcePositionBuffer]
type = Buffer
format = DXGI_FORMAT_R32G32B32_FLOAT
stride = 12
filename = Meshes/Position.buf

[ResourceBlendBuffer]
type = Buffer
format = DXGI_FORMAT_R8_UINT
stride = 8
filename = Meshes/Blend.buf

[ResourceVectorBuffer]
type = Buffer
format = DXGI_FORMAT_R8G8B8A8_SNORM
stride = 8
filename = Meshes/Vector.buf

[ResourceColorBuffer]
type = Buffer
format = DXGI_FORMAT_R8G8B8A8_UNORM
stride = 4
filename = Meshes/Color.buf

[ResourceTexCoordBuffer]
type = Buffer
format = DXGI_FORMAT_R16G16_FLOAT
stride = 16
filename = Meshes/TexCoord.buf

[ResourceShapeKeyOffsetBuffer]
type = Buffer
format = DXGI_FORMAT_R32G32B32A32_UINT
stride = 16
filename = Meshes/ShapeKeyOffset.buf

[ResourceShapeKeyVertexIdBuffer]
type = Buffer
format = DXGI_FORMAT_R32_UINT
stride = 4
filename = Meshes/ShapeKeyVertexId.buf

[ResourceShapeKeyVertexOffsetBuffer]
type = Buffer
format = DXGI_FORMAT_R16_FLOAT
stride = 2
filename = Meshes/ShapeKeyVertexOffset.buf

; Autogenerated -------------------------

; This mod.ini was automatically generated by WWMI Tools Blender addon v0.9.0 and requires WWMI v0.7.0+ to function
; WWMI GameBanana: https://gamebanana.com/tools/17252
; WWMI Tools GameBanana: https://gamebanana.com/tools/17289
; WWMI GitHub: https://github.com/SpectrumQT/WWMI
; WWMI Tools GitHub: https://github.com/SpectrumQT/WWMI_Tools
; AGMG Modding Community Discord: https://discord.com/invite/agmg

; SHA256 CHECKSUM: 847f5798e316fd735b9e08593ce2647894c43c6d7d72a6e00b7d93e181ba8c26
