Reformat pass

This commit is contained in:
Phillip Stephens 2021-06-07 12:29:18 -07:00
parent d7559823ea
commit a9bcb7a9ce
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
424 changed files with 4377 additions and 4790 deletions

View File

@ -1,3 +1,3 @@
message(STATUS "32-bit asset name map not found; downloading to '${CMAKE_CURRENT_BINARY_DIR}/AssetNameMap32.bin'")
file(DOWNLOAD "https://axiodl.com/files/AssetNameMap32.dat"
${CMAKE_CURRENT_BINARY_DIR}/AssetNameMap32.bin SHOW_PROGRESS EXPECTED_HASH SHA1=90b4e941c192eef41c81e60314f348bc787d1336)
${CMAKE_CURRENT_BINARY_DIR}/AssetNameMap32.bin SHOW_PROGRESS EXPECTED_HASH SHA1=90b4e941c192eef41c81e60314f348bc787d1336)

View File

@ -34,8 +34,9 @@ void LoadAssetMap(athena::io::MemoryReader& ar) {
if (ar.length() >= 4)
ar.readBytesToBuf(&magic, 4);
if (magic != FOURCC('AIDM'))
Log.report(logvisor::Warning,
FMT_STRING(_SYS_STR("Unable to load asset map; Assets will not have proper filenames for most files.")));
Log.report(
logvisor::Warning,
FMT_STRING(_SYS_STR("Unable to load asset map; Assets will not have proper filenames for most files.")));
else {
uint32_t assetCount = ar.readUint32Big();
g_AssetNameMap.reserve(assetCount);
@ -64,8 +65,9 @@ void InitAssetNameMap() {
LoadAssetMap(ar);
delete[](decompressed);
} else {
Log.report(logvisor::Warning,
FMT_STRING(_SYS_STR("AssetNameMap32 unavailable; Assets will not have proper filenames for most files.")));
Log.report(
logvisor::Warning,
FMT_STRING(_SYS_STR("AssetNameMap32 unavailable; Assets will not have proper filenames for most files.")));
}
/* Now load the 64bit map for MP3 */
if (ASSET_NAME_MP64_DECOMPRESSED_SZ != 0u) {
@ -76,8 +78,9 @@ void InitAssetNameMap() {
LoadAssetMap(ar);
delete[](decompressed);
} else {
Log.report(logvisor::Warning,
FMT_STRING(_SYS_STR("AssetNameMap64 unavailable; Assets will not have proper filenames for most files.")));
Log.report(
logvisor::Warning,
FMT_STRING(_SYS_STR("AssetNameMap64 unavailable; Assets will not have proper filenames for most files.")));
}
g_AssetNameMapInit = true;
}

View File

@ -2,6 +2,7 @@
import bpy
# Root Eevee Nodes
# Additive output node
@ -32,6 +33,7 @@ def make_additive_output():
new_grp.links.new(transparent_bdsf.outputs[0], emissive_add_shader.inputs[0])
new_grp.links.new(emissive_add_shader.outputs[0], mat_out.inputs['Surface'])
# Blend output node
def make_blend_opaque_output():
for tp in ('HECLBlendOutput', 'HECLOpaqueOutput'):
@ -50,7 +52,8 @@ def make_blend_opaque_output():
# Links
new_grp.links.new(grp_in.outputs['Surface'], mat_out.inputs['Surface'])
#0 - RetroShader
# 0 - RetroShader
def make_retro_shader():
new_grp = bpy.data.node_groups.new('RetroShader', 'ShaderNodeTree')
surface_output = new_grp.outputs.new('NodeSocketShader', 'Surface')
@ -216,6 +219,7 @@ def make_retro_shader():
new_grp.links.new(final_add_shader.outputs['Shader'], alpha_mix.inputs[2])
new_grp.links.new(alpha_mix.outputs['Shader'], mat_out.inputs['Surface'])
def make_retro_dynamic_shader():
new_grp = bpy.data.node_groups.new('RetroDynamicShader', 'ShaderNodeTree')
surface_output = new_grp.outputs.new('NodeSocketShader', 'Surface')
@ -386,6 +390,7 @@ def make_retro_dynamic_shader():
new_grp.links.new(final_add_shader.outputs['Shader'], alpha_mix.inputs[2])
new_grp.links.new(alpha_mix.outputs['Shader'], mat_out.inputs['Surface'])
def make_retro_dynamic_alpha_shader():
new_grp = bpy.data.node_groups.new('RetroDynamicAlphaShader', 'ShaderNodeTree')
surface_output = new_grp.outputs.new('NodeSocketShader', 'Surface')
@ -567,6 +572,7 @@ def make_retro_dynamic_alpha_shader():
new_grp.links.new(final_add_shader.outputs['Shader'], alpha_mix.inputs[2])
new_grp.links.new(alpha_mix.outputs['Shader'], mat_out.inputs['Surface'])
def make_retro_dynamic_character_shader():
new_grp = bpy.data.node_groups.new('RetroDynamicCharacterShader', 'ShaderNodeTree')
surface_output = new_grp.outputs.new('NodeSocketShader', 'Surface')
@ -721,6 +727,7 @@ def make_retro_dynamic_character_shader():
new_grp.links.new(final_add_shader.outputs['Shader'], alpha_mix.inputs[2])
new_grp.links.new(alpha_mix.outputs['Shader'], mat_out.inputs['Surface'])
# MP3 / DKCR Material Passes:
# https://wiki.axiodl.com/w/Materials_(Metroid_Prime_3)
@ -1000,6 +1007,7 @@ def make_retro_shader_mp3_color():
new_grp.links.new(nodes["Mix Shader"].outputs[0], nodes["Add Shader.011"].inputs[0])
new_grp.links.new(nodes["Group Input"].outputs[12], nodes["Transparent BSDF"].inputs[0])
def make_retro_shader_mp3_bloom():
new_grp = bpy.data.node_groups.new("__RetroShaderMP3Bloom", "ShaderNodeTree")
new_grp.use_fake_user = True
@ -1191,6 +1199,7 @@ def make_retro_shader_mp3_bloom():
new_grp.links.new(nodes["Add Shader.001"].outputs[0], nodes["Add Shader"].inputs[1])
new_grp.links.new(nodes["Group Input"].outputs[11], nodes["Transparent BSDF.001"].inputs[0])
def make_retro_shader_mp3():
new_grp = bpy.data.node_groups.new("RetroShaderMP3", "ShaderNodeTree")
new_grp.use_fake_user = True
@ -1368,6 +1377,7 @@ def make_retro_shader_mp3():
new_grp.links.new(nodes["Group Input"].outputs[18], nodes["Group.001"].inputs[12])
new_grp.links.new(nodes["Group Input"].outputs[18], nodes["Group"].inputs[11])
ROOT_SHADER_GROUPS = (
make_retro_shader,
make_retro_dynamic_shader,
@ -1378,6 +1388,7 @@ ROOT_SHADER_GROUPS = (
make_retro_shader_mp3
)
# UV animation nodes:
# https://wiki.axiodl.com/w/Materials_(Metroid_Prime)#UV_Animations
@ -1415,6 +1426,7 @@ def make_uva0():
new_grp.links.new(vec_xf.outputs[0], uv_scale.inputs[0])
new_grp.links.new(uv_scale.outputs[0], grp_out.inputs[0])
# 1 - Modelview Inverse
def make_uva1():
new_grp = bpy.data.node_groups.new('RetroUVMode1NodeN', 'ShaderNodeTree')
@ -1433,6 +1445,7 @@ def make_uva1():
# Links
new_grp.links.new(grp_in.outputs[0], grp_out.inputs[0])
# 2 - UV Scroll
def make_uva2():
new_grp = bpy.data.node_groups.new('RetroUVMode2Node', 'ShaderNodeTree')
@ -1474,6 +1487,7 @@ def make_uva2():
new_grp.links.new(adder1.outputs[0], adder2.inputs[1])
new_grp.links.new(adder2.outputs[0], grp_out.inputs[0])
# 3 - Rotation
def make_uva3():
new_grp = bpy.data.node_groups.new('RetroUVMode3Node', 'ShaderNodeTree')
@ -1509,6 +1523,7 @@ def make_uva3():
new_grp.links.new(grp_in.outputs[2], mult.inputs[0])
new_grp.links.new(mult.outputs[0], add1.inputs[1])
# 4 - Horizontal Filmstrip Animation
def make_uva4():
new_grp = bpy.data.node_groups.new('RetroUVMode4Node', 'ShaderNodeTree')
@ -1594,6 +1609,7 @@ def make_uva4():
new_grp.links.new(map1.outputs[0], add1.inputs[0])
new_grp.links.new(add1.outputs[0], grp_out.inputs[0])
# 5 - Vertical Filmstrip Animation
def make_uva5():
new_grp = bpy.data.node_groups.new('RetroUVMode5Node', 'ShaderNodeTree')
@ -1679,6 +1695,7 @@ def make_uva5():
new_grp.links.new(map1.outputs[0], add1.inputs[0])
new_grp.links.new(add1.outputs[0], grp_out.inputs[0])
# 6 - Model Matrix
def make_uva6():
new_grp = bpy.data.node_groups.new('RetroUVMode6NodeN', 'ShaderNodeTree')
@ -1708,6 +1725,7 @@ def make_uva6():
new_grp.links.new(geom_in.outputs['Object'], adder1.inputs[1])
new_grp.links.new(adder1.outputs[0], grp_out.inputs[0])
# 7 - Mode Who Must Not Be Named
def make_uva7():
new_grp = bpy.data.node_groups.new('RetroUVMode7NodeN', 'ShaderNodeTree')
@ -1807,6 +1825,7 @@ def make_uva7():
new_grp.links.new(mult5.outputs[0], add2.inputs[1])
new_grp.links.new(add2.outputs[0], grp_out.inputs[0])
# 8 - Mode 8
def make_uva8():
new_grp = bpy.data.node_groups.new('RetroUVMode8Node', 'ShaderNodeTree')
@ -1834,6 +1853,7 @@ def make_uva8():
# Links
new_grp.links.new(grp_in.outputs[0], grp_out.inputs[0])
UV_ANIMATION_GROUPS = (
make_uva0,
make_uva1,
@ -1846,6 +1866,7 @@ UV_ANIMATION_GROUPS = (
make_uva8
)
def make_master_shader_library():
make_additive_output()
make_blend_opaque_output()
@ -1853,4 +1874,3 @@ def make_master_shader_library():
shad()
for uva in UV_ANIMATION_GROUPS:
uva()

View File

@ -1,31 +1,31 @@
# Assembles a source/header pair list for use in a DNA library
macro(make_dnalist)
file(RELATIVE_PATH subdir "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_LIST_DIR}")
set(CMAKE_CURRENT_LIST_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_LIST_BINARY_DIR}")
foreach(type ${ARGN})
get_filename_component(dir ${type} DIRECTORY)
if(dir)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_LIST_BINARY_DIR}/${dir}")
set(dir "${dir}/")
endif()
get_filename_component(name ${type} NAME)
list(APPEND DNA_SOURCES "${subdir}/${dir}atdna_${name}.cpp")
list(APPEND DNA_HEADERS "${subdir}/${dir}${name}.hpp")
endforeach()
file(RELATIVE_PATH subdir "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_LIST_DIR}")
set(CMAKE_CURRENT_LIST_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_LIST_BINARY_DIR}")
foreach (type ${ARGN})
get_filename_component(dir ${type} DIRECTORY)
if (dir)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_LIST_BINARY_DIR}/${dir}")
set(dir "${dir}/")
endif ()
get_filename_component(name ${type} NAME)
list(APPEND DNA_SOURCES "${subdir}/${dir}atdna_${name}.cpp")
list(APPEND DNA_HEADERS "${subdir}/${dir}${name}.hpp")
endforeach ()
endmacro()
# Assembles source files together for the main DataSpecCommon library
macro(dataspec_add_list rel_path a_list)
unset(tmp_list)
foreach(path IN LISTS ${a_list})
if (IS_ABSOLUTE ${path})
list(APPEND tmp_list "${path}")
else()
list(APPEND tmp_list "${rel_path}/${path}")
endif()
endforeach(path)
set(${a_list} "${tmp_list}")
unset(tmp_list)
foreach (path IN LISTS ${a_list})
if (IS_ABSOLUTE ${path})
list(APPEND tmp_list "${path}")
else ()
list(APPEND tmp_list "${rel_path}/${path}")
endif ()
endforeach (path)
set(${a_list} "${tmp_list}")
endmacro(dataspec_add_list)
# Each game's DNA library
@ -41,31 +41,31 @@ bintoc(RetroMasterShader.cpp Blender/RetroMasterShader.py RETRO_MASTER_SHADER)
# Download asset name databases
add_custom_command(OUTPUT AssetNameMap32.bin COMMAND ${CMAKE_COMMAND} ARGS -P
${CMAKE_CURRENT_SOURCE_DIR}/AssetMap32Download.cmake)
${CMAKE_CURRENT_SOURCE_DIR}/AssetMap32Download.cmake)
bintoc_compress(AssetNameMap32.cpp ${CMAKE_CURRENT_BINARY_DIR}/AssetNameMap32.bin ASSET_NAME_MP32)
add_custom_command(OUTPUT AssetNameMap64.bin COMMAND ${CMAKE_COMMAND} ARGS -P
${CMAKE_CURRENT_SOURCE_DIR}/AssetMap64Download.cmake)
${CMAKE_CURRENT_SOURCE_DIR}/AssetMap64Download.cmake)
bintoc_compress(AssetNameMap64.cpp ${CMAKE_CURRENT_BINARY_DIR}/AssetNameMap64.bin ASSET_NAME_MP64)
# Each game's DataSpec implementation
add_library(RetroDataSpec
SpecBase.cpp
${DNACOMMON_SOURCES}
SpecMP1.cpp
${DNAMP1_SOURCES}
${ScriptObjectsMP1_SOURCES}
${DNAMP1_SFX_SOURCES}
SpecMP2.cpp
${DNAMP2_SOURCES}
SpecMP3.cpp
${DNAMP3_SOURCES}
Blender/BlenderSupport.hpp
Blender/BlenderSupport.cpp
Blender/RetroMasterShader.py
AssetNameMap.hpp
AssetNameMap.cpp
RetroMasterShader.cpp)
SpecBase.cpp
${DNACOMMON_SOURCES}
SpecMP1.cpp
${DNAMP1_SOURCES}
${ScriptObjectsMP1_SOURCES}
${DNAMP1_SFX_SOURCES}
SpecMP2.cpp
${DNAMP2_SOURCES}
SpecMP3.cpp
${DNAMP3_SOURCES}
Blender/BlenderSupport.hpp
Blender/BlenderSupport.cpp
Blender/RetroMasterShader.py
AssetNameMap.hpp
AssetNameMap.cpp
RetroMasterShader.cpp)
add_library(AssetNameMap
AssetNameMap32.bin AssetNameMap32.cpp
AssetNameMap64.bin AssetNameMap64.cpp)
@ -74,19 +74,19 @@ add_library(AssetNameMapNull
get_target_property(HECL_INCLUDES hecl-full INCLUDE_DIRECTORIES)
target_include_directories(RetroDataSpec PUBLIC ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}
${HECL_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR})
${HECL_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR})
target_link_libraries(RetroDataSpec PUBLIC amuse zeus nod squish ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} lzokay logvisor)
if(COMMAND add_sanitizers)
add_sanitizers(RetroDataSpec)
endif()
if (COMMAND add_sanitizers)
add_sanitizers(RetroDataSpec)
endif ()
# Resolve all DNA sources into target
list(LENGTH DNA_SOURCES count)
math(EXPR count "${count}-1")
foreach(i RANGE ${count})
list(GET DNA_SOURCES ${i} src)
list(GET DNA_HEADERS ${i} header)
target_atdna(RetroDataSpec ${src} ${header})
endforeach()
foreach (i RANGE ${count})
list(GET DNA_SOURCES ${i} src)
list(GET DNA_HEADERS ${i} header)
target_atdna(RetroDataSpec ${src} ${header})
endforeach ()
add_custom_target(genexdebug COMMAND ${CMAKE_COMMAND} -E echo "$<TARGET_PROPERTY:RetroDataSpec,INCLUDE_DIRECTORIES>")

View File

@ -118,27 +118,25 @@ bool ReadANCSToBlender(hecl::blender::Token& btok, const ANCSDNA& ancs, const he
{
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
os.format(FMT_STRING(
"import bpy\n"
"from mathutils import Vector\n"
"bpy.context.scene.name = '{}'\n"
"bpy.context.scene.hecl_mesh_obj = bpy.context.scene.name\n"
"\n"
"# Clear Scene\n"
"if len(bpy.data.collections):\n"
" bpy.data.collections.remove(bpy.data.collections[0])\n"
"\n"
"actor_data = bpy.context.scene.hecl_sact_data\n"
"arm_obj = None\n"),
pakRouter.getBestEntryName(entry));
os.format(FMT_STRING("import bpy\n"
"from mathutils import Vector\n"
"bpy.context.scene.name = '{}'\n"
"bpy.context.scene.hecl_mesh_obj = bpy.context.scene.name\n"
"\n"
"# Clear Scene\n"
"if len(bpy.data.collections):\n"
" bpy.data.collections.remove(bpy.data.collections[0])\n"
"\n"
"actor_data = bpy.context.scene.hecl_sact_data\n"
"arm_obj = None\n"),
pakRouter.getBestEntryName(entry));
std::unordered_set<typename PAKRouter::IDType> cinfsDone;
for (const auto& info : chResInfo) {
/* Provide data to add-on */
os.format(FMT_STRING(
"actor_subtype = actor_data.subtypes.add()\n"
"actor_subtype.name = '{}'\n\n"),
info.name);
os.format(FMT_STRING("actor_subtype = actor_data.subtypes.add()\n"
"actor_subtype.name = '{}'\n\n"),
info.name);
/* Build CINF if needed */
if (cinfsDone.find(info.cinf) == cinfsDone.end()) {
@ -177,7 +175,7 @@ bool ReadANCSToBlender(hecl::blender::Token& btok, const ANCSDNA& ancs, const he
/* Link CMDL */
if (const typename PAKRouter::EntryType* cmdlE =
pakRouter.lookupEntry(overlay.second.first, nullptr, true, false)) {
pakRouter.lookupEntry(overlay.second.first, nullptr, true, false)) {
hecl::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);
os.linkMesh(cmdlPath.getAbsolutePathUTF8(), pakRouter.getBestEntryName(*cmdlE));
@ -249,18 +247,16 @@ bool ReadANCSToBlender(hecl::blender::Token& btok, const ANCSDNA& ancs, const he
for (const auto& id : animResInfo) {
typename ANCSDNA::ANIMType anim;
if (pakRouter.lookupAndReadDNA(id.second.animId, anim, true)) {
os.format(FMT_STRING(
"act = bpy.data.actions.new('{}')\n"
"act.use_fake_user = True\n"
"act.anim_id = '{}'\n"),
id.second.name, id.second.animId);
os.format(FMT_STRING("act = bpy.data.actions.new('{}')\n"
"act.use_fake_user = True\n"
"act.anim_id = '{}'\n"),
id.second.name, id.second.animId);
anim.sendANIMToBlender(os, inverter, id.second.additive);
}
os.format(FMT_STRING(
"actor_action = actor_data.actions.add()\n"
"actor_action.name = '{}'\n"),
id.second.name);
os.format(FMT_STRING("actor_action = actor_data.actions.add()\n"
"actor_action.name = '{}'\n"),
id.second.name);
/* Extract EVNT if present */
anim.extractEVNT(id.second, outPath, pakRouter, force);

View File

@ -12,7 +12,6 @@ template <class PAKBridge>
struct PATH;
}
struct AROTBuilder {
using ColMesh = hecl::blender::ColMesh;

View File

@ -18,72 +18,67 @@ void ReadBabeDeadLightToBlender(hecl::blender::PyOutStream& os, const BabeDeadLi
switch (light.lightType) {
case BabeDeadLight::LightType::LocalAmbient:
case BabeDeadLight::LightType::LocalAmbient2:
os.format(FMT_STRING(
"bg_node.inputs[0].default_value = ({},{},{},1.0)\n"
"bg_node.inputs[1].default_value = {}\n"),
light.color.simd[0], light.color.simd[1], light.color.simd[2], light.q / 8.f);
os.format(FMT_STRING("bg_node.inputs[0].default_value = ({},{},{},1.0)\n"
"bg_node.inputs[1].default_value = {}\n"),
light.color.simd[0], light.color.simd[1], light.color.simd[2], light.q / 8.f);
return;
case BabeDeadLight::LightType::Directional:
os.format(FMT_STRING(
"lamp = bpy.data.lights.new('LAMP_{:01d}_{:03d}', 'SUN')\n"
"lamp.color = ({},{},{})\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
"lamp_obj.rotation_mode = 'QUATERNION'\n"
"lamp_obj.rotation_quaternion = Vector((0,0,-1)).rotation_difference(Vector(({},{},{})))\n"
"lamp.use_shadow = {}\n"
"\n"),
s, l, light.color.simd[0], light.color.simd[1], light.color.simd[2], light.direction.simd[0],
light.direction.simd[1], light.direction.simd[2], light.castShadows ? "True" : "False");
os.format(FMT_STRING("lamp = bpy.data.lights.new('LAMP_{:01d}_{:03d}', 'SUN')\n"
"lamp.color = ({},{},{})\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
"lamp_obj.rotation_mode = 'QUATERNION'\n"
"lamp_obj.rotation_quaternion = Vector((0,0,-1)).rotation_difference(Vector(({},{},{})))\n"
"lamp.use_shadow = {}\n"
"\n"),
s, l, light.color.simd[0], light.color.simd[1], light.color.simd[2], light.direction.simd[0],
light.direction.simd[1], light.direction.simd[2], light.castShadows ? "True" : "False");
return;
case BabeDeadLight::LightType::Custom:
os.format(FMT_STRING(
"lamp = bpy.data.lights.new('LAMP_{:01d}_{:03d}', 'POINT')\n"
"lamp.color = ({},{},{})\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
"lamp.shadow_soft_size = 1.0\n"
"lamp.use_shadow = {}\n"
"\n"),
s, l, light.color.simd[0], light.color.simd[1], light.color.simd[2],
light.castShadows ? "True" : "False");
os.format(FMT_STRING("lamp = bpy.data.lights.new('LAMP_{:01d}_{:03d}', 'POINT')\n"
"lamp.color = ({},{},{})\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
"lamp.shadow_soft_size = 1.0\n"
"lamp.use_shadow = {}\n"
"\n"),
s, l, light.color.simd[0], light.color.simd[1], light.color.simd[2],
light.castShadows ? "True" : "False");
break;
case BabeDeadLight::LightType::Spot:
case BabeDeadLight::LightType::Spot2:
os.format(FMT_STRING(
"lamp = bpy.data.lights.new('LAMP_{:01d}_{:03d}', 'SPOT')\n"
"lamp.color = ({},{},{})\n"
"lamp.spot_size = {:.6g}\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
"lamp_obj.rotation_mode = 'QUATERNION'\n"
"lamp_obj.rotation_quaternion = Vector((0,0,-1)).rotation_difference(Vector(({},{},{})))\n"
"lamp.shadow_soft_size = 0.5\n"
"lamp.use_shadow = {}\n"
"\n"),
s, l, light.color.simd[0], light.color.simd[1], light.color.simd[2], zeus::degToRad(light.spotCutoff),
light.direction.simd[0], light.direction.simd[1], light.direction.simd[2],
light.castShadows ? "True" : "False");
os.format(FMT_STRING("lamp = bpy.data.lights.new('LAMP_{:01d}_{:03d}', 'SPOT')\n"
"lamp.color = ({},{},{})\n"
"lamp.spot_size = {:.6g}\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
"lamp_obj.rotation_mode = 'QUATERNION'\n"
"lamp_obj.rotation_quaternion = Vector((0,0,-1)).rotation_difference(Vector(({},{},{})))\n"
"lamp.shadow_soft_size = 0.5\n"
"lamp.use_shadow = {}\n"
"\n"),
s, l, light.color.simd[0], light.color.simd[1], light.color.simd[2], zeus::degToRad(light.spotCutoff),
light.direction.simd[0], light.direction.simd[1], light.direction.simd[2],
light.castShadows ? "True" : "False");
break;
default:
return;
}
os.format(FMT_STRING(
"lamp.retro_layer = {}\n"
"lamp.retro_origtype = {}\n"
"lamp.falloff_type = 'INVERSE_COEFFICIENTS'\n"
"lamp.constant_coefficient = 0\n"
"lamp.use_nodes = True\n"
"falloff_node = lamp.node_tree.nodes.new('ShaderNodeLightFalloff')\n"
"lamp.energy = 0.0\n"
"falloff_node.inputs[0].default_value = {}\n"
"hue_sat_node = lamp.node_tree.nodes.new('ShaderNodeHueSaturation')\n"
"hue_sat_node.inputs[1].default_value = 1.25\n"
"hue_sat_node.inputs[4].default_value = ({},{},{},1.0)\n"
"lamp.node_tree.links.new(hue_sat_node.outputs[0], lamp.node_tree.nodes['Emission'].inputs[0])\n"
"lamp_obj.location = ({},{},{})\n"
"bpy.context.scene.collection.objects.link(lamp_obj)\n"
"\n"),
s, unsigned(light.lightType), light.q / 8.f, light.color.simd[0], light.color.simd[1], light.color.simd[2],
light.position.simd[0], light.position.simd[1], light.position.simd[2]);
os.format(FMT_STRING("lamp.retro_layer = {}\n"
"lamp.retro_origtype = {}\n"
"lamp.falloff_type = 'INVERSE_COEFFICIENTS'\n"
"lamp.constant_coefficient = 0\n"
"lamp.use_nodes = True\n"
"falloff_node = lamp.node_tree.nodes.new('ShaderNodeLightFalloff')\n"
"lamp.energy = 0.0\n"
"falloff_node.inputs[0].default_value = {}\n"
"hue_sat_node = lamp.node_tree.nodes.new('ShaderNodeHueSaturation')\n"
"hue_sat_node.inputs[1].default_value = 1.25\n"
"hue_sat_node.inputs[4].default_value = ({},{},{},1.0)\n"
"lamp.node_tree.links.new(hue_sat_node.outputs[0], lamp.node_tree.nodes['Emission'].inputs[0])\n"
"lamp_obj.location = ({},{},{})\n"
"bpy.context.scene.collection.objects.link(lamp_obj)\n"
"\n"),
s, unsigned(light.lightType), light.q / 8.f, light.color.simd[0], light.color.simd[1], light.color.simd[2],
light.position.simd[0], light.position.simd[1], light.position.simd[2]);
switch (light.falloff) {
case BabeDeadLight::Falloff::Constant:

View File

@ -3,7 +3,7 @@
namespace hecl::blender {
struct Light;
class PyOutStream;
}
} // namespace hecl::blender
namespace DataSpec {

View File

@ -84,15 +84,14 @@ void ReadMaterialSetToBlender_1_2(hecl::blender::PyOutStream& os, const Material
}
hecl::SystemString resPath = pakRouter.getResourceRelativePath(entry, tex);
hecl::SystemUTF8Conv resPathView(resPath);
os.format(FMT_STRING(
"if '{}' in bpy.data.images:\n"
" image = bpy.data.images['{}']\n"
"else:\n"
" image = bpy.data.images.load('''//{}''')\n"
" image.name = '{}'\n"
"texmap_list.append(image)\n"
"\n"),
texName, texName, resPathView, texName);
os.format(FMT_STRING("if '{}' in bpy.data.images:\n"
" image = bpy.data.images['{}']\n"
"else:\n"
" image = bpy.data.images.load('''//{}''')\n"
" image.name = '{}'\n"
"texmap_list.append(image)\n"
"\n"),
texName, texName, resPathView, texName);
}
unsigned m = 0;
@ -148,11 +147,10 @@ public:
for (const auto& [ev, evVec] : m_extraVerts) {
for (const std::pair<atInt16, atUint16>& se : evVec) {
if (se.second == nextVert) {
os.format(FMT_STRING(
"bm.verts.ensure_lookup_table()\n"
"orig_vert = bm.verts[{}]\n"
"vert = bm.verts.new(orig_vert.co)\n"),
ev + baseVert);
os.format(FMT_STRING("bm.verts.ensure_lookup_table()\n"
"orig_vert = bm.verts[{}]\n"
"vert = bm.verts.new(orig_vert.co)\n"),
ev + baseVert);
rp.first.second->weightVertex(os, *rp.second.second, se.first);
++nextVert;
++addedVerts;
@ -466,12 +464,11 @@ void InitGeomBlenderContext(hecl::blender::PyOutStream& os, const hecl::ProjectP
"\n";
/* Link master shader library */
os.format(FMT_STRING(
"# Master shader library\n"
"with bpy.data.libraries.load('{}', link=True, relative=True) as (data_from, data_to):\n"
" data_to.node_groups = data_from.node_groups\n"
"\n"),
masterShaderPath.getAbsolutePathUTF8());
os.format(FMT_STRING("# Master shader library\n"
"with bpy.data.libraries.load('{}', link=True, relative=True) as (data_from, data_to):\n"
" data_to.node_groups = data_from.node_groups\n"
"\n"),
masterShaderPath.getAbsolutePathUTF8());
}
void FinishBlenderMesh(hecl::blender::PyOutStream& os, unsigned matSetCount, int meshIdx) {
@ -824,67 +821,73 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
atUint8 flip = 0;
for (int v = 0; v < vertCount - 2; ++v) {
if (flip) {
os.format(FMT_STRING(
"last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, ({},{},{}), {}, od_list, "
"two_face_vert)\n"),
primVerts[c % 3].pos, primVerts[(c + 2) % 3].pos, primVerts[(c + 1) % 3].pos, primVerts[c % 3].norm,
primVerts[(c + 2) % 3].norm, primVerts[(c + 1) % 3].norm, sHead.matIdx);
os.format(FMT_STRING("last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, "
"({},{},{}), {}, od_list, "
"two_face_vert)\n"),
primVerts[c % 3].pos, primVerts[(c + 2) % 3].pos, primVerts[(c + 1) % 3].pos,
primVerts[c % 3].norm, primVerts[(c + 2) % 3].norm, primVerts[(c + 1) % 3].norm,
sHead.matIdx);
if (matUVCount) {
os << "if last_face is not None:\n";
for (unsigned j = 0; j < matUVCount; ++j) {
if (j == 0 && matShortUVs)
os.format(FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[0]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[1]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[2]\n"),
os.format(
FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[0]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[1]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[2]\n"),
primVerts[c % 3].uvs[j], primVerts[(c + 2) % 3].uvs[j], primVerts[(c + 1) % 3].uvs[j],
primVerts[c % 3].pos, j, primVerts[(c + 2) % 3].pos, j, primVerts[(c + 1) % 3].pos, j);
else
os.format(FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"),
os.format(
FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"),
primVerts[c % 3].pos, j, primVerts[c % 3].uvs[j], primVerts[(c + 2) % 3].pos, j,
primVerts[(c + 2) % 3].uvs[j], primVerts[(c + 1) % 3].pos, j, primVerts[(c + 1) % 3].uvs[j]);
}
}
} else {
os.format(FMT_STRING(
"last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, ({},{},{}), {}, od_list, "
"two_face_vert)\n"),
primVerts[c % 3].pos, primVerts[(c + 1) % 3].pos, primVerts[(c + 2) % 3].pos, primVerts[c % 3].norm,
primVerts[(c + 1) % 3].norm, primVerts[(c + 2) % 3].norm, sHead.matIdx);
os.format(FMT_STRING("last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, "
"({},{},{}), {}, od_list, "
"two_face_vert)\n"),
primVerts[c % 3].pos, primVerts[(c + 1) % 3].pos, primVerts[(c + 2) % 3].pos,
primVerts[c % 3].norm, primVerts[(c + 1) % 3].norm, primVerts[(c + 2) % 3].norm,
sHead.matIdx);
if (matUVCount) {
os << "if last_face is not None:\n";
for (unsigned j = 0; j < matUVCount; ++j) {
if (j == 0 && matShortUVs)
os.format(FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[0]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[1]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[2]\n"),
os.format(
FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[0]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[1]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[2]\n"),
primVerts[c % 3].uvs[j], primVerts[(c + 1) % 3].uvs[j], primVerts[(c + 2) % 3].uvs[j],
primVerts[c % 3].pos, j, primVerts[(c + 1) % 3].pos, j, primVerts[(c + 2) % 3].pos, j);
else
os.format(FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"),
os.format(
FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"),
primVerts[c % 3].pos, j, primVerts[c % 3].uvs[j], primVerts[(c + 1) % 3].pos, j,
primVerts[(c + 1) % 3].uvs[j], primVerts[(c + 2) % 3].pos, j, primVerts[(c + 2) % 3].uvs[j]);
}
@ -901,34 +904,36 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
} else if (ptype == GX::TRIANGLES) {
for (int v = 0; v < vertCount; v += 3) {
os.format(FMT_STRING(
"last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, ({},{},{}), {}, od_list, "
"two_face_vert)\n"),
primVerts[0].pos, primVerts[1].pos, primVerts[2].pos, primVerts[0].norm, primVerts[1].norm,
primVerts[2].norm, sHead.matIdx);
os.format(FMT_STRING("last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, "
"({},{},{}), {}, od_list, "
"two_face_vert)\n"),
primVerts[0].pos, primVerts[1].pos, primVerts[2].pos, primVerts[0].norm, primVerts[1].norm,
primVerts[2].norm, sHead.matIdx);
if (matUVCount) {
os << "if last_face is not None:\n";
for (unsigned j = 0; j < matUVCount; ++j) {
if (j == 0 && matShortUVs)
os.format(FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[0]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[1]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[2]\n"),
os.format(
FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[0]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[1]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[2]\n"),
primVerts[0].uvs[j], primVerts[1].uvs[j], primVerts[2].uvs[j], primVerts[0].pos, j,
primVerts[1].pos, j, primVerts[2].pos, j);
else
os.format(FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"),
os.format(
FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"),
primVerts[0].pos, j, primVerts[0].uvs[j], primVerts[1].pos, j, primVerts[1].uvs[j],
primVerts[2].pos, j, primVerts[2].uvs[j]);
}
@ -945,34 +950,36 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
} else if (ptype == GX::TRIANGLEFAN) {
++c;
for (int v = 0; v < vertCount - 2; ++v) {
os.format(FMT_STRING(
"last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, ({},{},{}), {}, od_list, "
"two_face_vert)\n"),
firstPrimVert.pos, primVerts[c % 3].pos, primVerts[(c + 1) % 3].pos, firstPrimVert.norm,
primVerts[c % 3].norm, primVerts[(c + 1) % 3].norm, sHead.matIdx);
os.format(FMT_STRING("last_face, last_mesh = add_triangle(bm, bm.verts, ({},{},{}), norm_list, "
"({},{},{}), {}, od_list, "
"two_face_vert)\n"),
firstPrimVert.pos, primVerts[c % 3].pos, primVerts[(c + 1) % 3].pos, firstPrimVert.norm,
primVerts[c % 3].norm, primVerts[(c + 1) % 3].norm, sHead.matIdx);
if (matUVCount) {
os << "if last_face is not None:\n";
for (unsigned j = 0; j < matUVCount; ++j) {
if (j == 0 && matShortUVs)
os.format(FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[0]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[1]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[2]\n"),
os.format(
FMT_STRING(
" uv_tri = expand_lightmap_triangle(lightmap_tri_tracker, suv_list[{}], suv_list[{}], "
"suv_list[{}])\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[0]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[1]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_tri[2]\n"),
firstPrimVert.uvs[j], primVerts[c % 3].uvs[j], primVerts[(c + 1) % 3].uvs[j], firstPrimVert.pos,
j, primVerts[c % 3].pos, j, primVerts[(c + 1) % 3].pos, j);
else
os.format(FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"),
os.format(
FMT_STRING(
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"
" loop_from_facevert(last_mesh, last_face, {})[last_mesh.loops.layers.uv[{}]].uv = "
"uv_list[{}]\n"),
firstPrimVert.pos, j, firstPrimVert.uvs[j], primVerts[c % 3].pos, j, primVerts[c % 3].uvs[j],
primVerts[(c + 1) % 3].pos, j, primVerts[(c + 1) % 3].uvs[j]);
}
@ -1060,13 +1067,12 @@ bool ReadCMDLToBlender(hecl::blender::Connection& conn, athena::io::IStreamReade
/* Open Py Stream and read sections */
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
os.format(FMT_STRING(
"import bpy\n"
"import bmesh\n"
"\n"
"bpy.context.scene.name = '{}'\n"
"bpy.context.scene.hecl_mesh_obj = bpy.context.scene.name\n"),
pakRouter.getBestEntryName(entry));
os.format(FMT_STRING("import bpy\n"
"import bmesh\n"
"\n"
"bpy.context.scene.name = '{}'\n"
"bpy.context.scene.hecl_mesh_obj = bpy.context.scene.name\n"),
pakRouter.getBestEntryName(entry));
InitGeomBlenderContext(os, dataspec.getMasterShaderPath());
MaterialSet::RegisterMaterialProps(os);
@ -1083,25 +1089,29 @@ bool ReadCMDLToBlender(hecl::blender::Connection& conn, athena::io::IStreamReade
}
template bool ReadCMDLToBlender<PAKRouter<DNAMP1::PAKBridge>, DNAMP1::MaterialSet,
std::pair<std::pair<UniqueID32, DNAMP1::CSKR*>, std::pair<UniqueID32, DNAMP1::CINF*>>, DNACMDL::SurfaceHeader_1, 2>(
std::pair<std::pair<UniqueID32, DNAMP1::CSKR*>, std::pair<UniqueID32, DNAMP1::CINF*>>,
DNACMDL::SurfaceHeader_1, 2>(
hecl::blender::Connection& conn, athena::io::IStreamReader& reader, PAKRouter<DNAMP1::PAKBridge>& pakRouter,
const PAKRouter<DNAMP1::PAKBridge>::EntryType& entry, const SpecBase& dataspec,
const std::pair<std::pair<UniqueID32, DNAMP1::CSKR*>, std::pair<UniqueID32, DNAMP1::CINF*>>& rp);
template bool ReadCMDLToBlender<PAKRouter<DNAMP2::PAKBridge>, DNAMP2::MaterialSet,
std::pair<std::pair<UniqueID32, DNAMP2::CSKR*>, std::pair<UniqueID32, DNAMP2::CINF*>>, DNACMDL::SurfaceHeader_2, 4>(
std::pair<std::pair<UniqueID32, DNAMP2::CSKR*>, std::pair<UniqueID32, DNAMP2::CINF*>>,
DNACMDL::SurfaceHeader_2, 4>(
hecl::blender::Connection& conn, athena::io::IStreamReader& reader, PAKRouter<DNAMP2::PAKBridge>& pakRouter,
const PAKRouter<DNAMP2::PAKBridge>::EntryType& entry, const SpecBase& dataspec,
const std::pair<std::pair<UniqueID32, DNAMP2::CSKR*>, std::pair<UniqueID32, DNAMP2::CINF*>>& rp);
template bool ReadCMDLToBlender<PAKRouter<DNAMP3::PAKBridge>, DNAMP3::MaterialSet,
std::pair<std::pair<UniqueID64, DNAMP3::CSKR*>, std::pair<UniqueID64, DNAMP3::CINF*>>, DNACMDL::SurfaceHeader_3, 4>(
std::pair<std::pair<UniqueID64, DNAMP3::CSKR*>, std::pair<UniqueID64, DNAMP3::CINF*>>,
DNACMDL::SurfaceHeader_3, 4>(
hecl::blender::Connection& conn, athena::io::IStreamReader& reader, PAKRouter<DNAMP3::PAKBridge>& pakRouter,
const PAKRouter<DNAMP3::PAKBridge>::EntryType& entry, const SpecBase& dataspec,
const std::pair<std::pair<UniqueID64, DNAMP3::CSKR*>, std::pair<UniqueID64, DNAMP3::CINF*>>& rp);
template bool ReadCMDLToBlender<PAKRouter<DNAMP3::PAKBridge>, DNAMP3::MaterialSet,
std::pair<std::pair<UniqueID64, DNAMP3::CSKR*>, std::pair<UniqueID64, DNAMP3::CINF*>>, DNACMDL::SurfaceHeader_3, 5>(
std::pair<std::pair<UniqueID64, DNAMP3::CSKR*>, std::pair<UniqueID64, DNAMP3::CINF*>>,
DNACMDL::SurfaceHeader_3, 5>(
hecl::blender::Connection& conn, athena::io::IStreamReader& reader, PAKRouter<DNAMP3::PAKBridge>& pakRouter,
const PAKRouter<DNAMP3::PAKBridge>::EntryType& entry, const SpecBase& dataspec,
const std::pair<std::pair<UniqueID64, DNAMP3::CSKR*>, std::pair<UniqueID64, DNAMP3::CINF*>>& rp);
@ -1592,9 +1602,10 @@ bool WriteHMDLCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& in
return true;
}
template bool WriteHMDLCMDL<DNAMP1::HMDLMaterialSet, DNACMDL::SurfaceHeader_2, 2>(
const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath, const Mesh& mesh,
hecl::blender::PoolSkinIndex& poolSkinIndex);
template bool
WriteHMDLCMDL<DNAMP1::HMDLMaterialSet, DNACMDL::SurfaceHeader_2, 2>(const hecl::ProjectPath& outPath,
const hecl::ProjectPath& inPath, const Mesh& mesh,
hecl::blender::PoolSkinIndex& poolSkinIndex);
struct MaterialPool {
std::vector<const Material*> materials;

View File

@ -1,60 +1,60 @@
make_dnalist(CMDL
FONT
DGRP
FSM2
MAPA
MAPU
PATH
MayaSpline
EGMC
SAVWCommon
ParticleCommon
MetaforceVersionInfo
Tweaks/ITweakPlayerGun)
FONT
DGRP
FSM2
MAPA
MAPU
PATH
MayaSpline
EGMC
SAVWCommon
ParticleCommon
MetaforceVersionInfo
Tweaks/ITweakPlayerGun)
set(DNACOMMON_SOURCES
DNACommon.hpp DNACommon.cpp
PAK.hpp PAK.cpp
GX.hpp GX.cpp
FSM2.hpp FSM2.cpp
MLVL.hpp MLVL.cpp
CMDL.cpp
MAPA.cpp
MAPU.cpp
PATH.hpp PATH.cpp
STRG.hpp STRG.cpp
TXTR.hpp TXTR.cpp
ANCS.hpp ANCS.cpp
ANIM.hpp ANIM.cpp
PART.hpp PART.cpp
SWHC.hpp SWHC.cpp
CRSC.hpp CRSC.cpp
ELSC.hpp ELSC.cpp
WPSC.hpp WPSC.cpp
DPSC.hpp DPSC.cpp
ParticleCommon.cpp
FONT.cpp
DGRP.cpp
ATBL.hpp ATBL.cpp
DeafBabe.hpp DeafBabe.cpp
BabeDead.hpp BabeDead.cpp
RigInverter.hpp RigInverter.cpp
AROTBuilder.hpp AROTBuilder.cpp
OBBTreeBuilder.hpp OBBTreeBuilder.cpp
MetaforceVersionInfo.hpp
Tweaks/ITweak.hpp
Tweaks/TweakWriter.hpp
Tweaks/ITweakGame.hpp
Tweaks/ITweakParticle.hpp
Tweaks/ITweakPlayer.hpp
Tweaks/ITweakPlayerControl.hpp
Tweaks/ITweakGunRes.hpp
Tweaks/ITweakPlayerRes.hpp
Tweaks/ITweakGui.hpp
Tweaks/ITweakSlideShow.hpp
Tweaks/ITweakTargeting.hpp
Tweaks/ITweakAutoMapper.hpp
Tweaks/ITweakBall.hpp
Tweaks/ITweakGuiColors.hpp)
DNACommon.hpp DNACommon.cpp
PAK.hpp PAK.cpp
GX.hpp GX.cpp
FSM2.hpp FSM2.cpp
MLVL.hpp MLVL.cpp
CMDL.cpp
MAPA.cpp
MAPU.cpp
PATH.hpp PATH.cpp
STRG.hpp STRG.cpp
TXTR.hpp TXTR.cpp
ANCS.hpp ANCS.cpp
ANIM.hpp ANIM.cpp
PART.hpp PART.cpp
SWHC.hpp SWHC.cpp
CRSC.hpp CRSC.cpp
ELSC.hpp ELSC.cpp
WPSC.hpp WPSC.cpp
DPSC.hpp DPSC.cpp
ParticleCommon.cpp
FONT.cpp
DGRP.cpp
ATBL.hpp ATBL.cpp
DeafBabe.hpp DeafBabe.cpp
BabeDead.hpp BabeDead.cpp
RigInverter.hpp RigInverter.cpp
AROTBuilder.hpp AROTBuilder.cpp
OBBTreeBuilder.hpp OBBTreeBuilder.cpp
MetaforceVersionInfo.hpp
Tweaks/ITweak.hpp
Tweaks/TweakWriter.hpp
Tweaks/ITweakGame.hpp
Tweaks/ITweakParticle.hpp
Tweaks/ITweakPlayer.hpp
Tweaks/ITweakPlayerControl.hpp
Tweaks/ITweakGunRes.hpp
Tweaks/ITweakPlayerRes.hpp
Tweaks/ITweakGui.hpp
Tweaks/ITweakSlideShow.hpp
Tweaks/ITweakTargeting.hpp
Tweaks/ITweakAutoMapper.hpp
Tweaks/ITweakBall.hpp
Tweaks/ITweakGuiColors.hpp)
dataspec_add_list(DNACommon DNACOMMON_SOURCES)

View File

@ -27,18 +27,22 @@ struct _CRSM {
#define FLOAT_ENTRY(name, identifier) float identifier = 0.f;
#include "CRSC.def"
template<typename _Func>
template <typename _Func>
void constexpr Enumerate(_Func f) {
#define ENTRY(name, identifier) f(FOURCC(name), identifier);
#include "CRSC.def"
}
template<typename _Func>
template <typename _Func>
bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
#define ENTRY(name, identifier) case SBIG(name): f(identifier); return true;
#define ENTRY(name, identifier) \
case SBIG(name): \
f(identifier); \
return true;
#include "CRSC.def"
default: return false;
default:
return false;
}
}
};

View File

@ -29,9 +29,8 @@ hecl::ProjectPath UniqueIDBridge::TranslatePakIdToPath(const IDType& id, bool si
LogDNACommon.report(logvisor::Warning, FMT_STRING("unable to translate {} to path"), id);
return {};
}
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("g_PakRouter or s_Project must be set to non-null before "
"calling UniqueIDBridge::TranslatePakIdToPath"));
LogDNACommon.report(logvisor::Fatal, FMT_STRING("g_PakRouter or s_Project must be set to non-null before "
"calling UniqueIDBridge::TranslatePakIdToPath"));
return {};
}
@ -53,7 +52,8 @@ hecl::ProjectPath UniqueIDBridge::MakePathFromString(std::string_view str) {
return {};
hecl::Database::Project* project = s_Project.get();
if (!project)
LogDNACommon.report(logvisor::Fatal, FMT_STRING("UniqueIDBridge::setGlobalProject must be called before MakePathFromString"));
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("UniqueIDBridge::setGlobalProject must be called before MakePathFromString"));
hecl::ProjectPath path = hecl::ProjectPath(*project, str);
project->addBridgePathToCache(IDType(path).toUint64(), path);
return path;
@ -90,9 +90,7 @@ void UniqueID32::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s)
s += 4;
}
std::string UniqueID32::toString() const {
return fmt::format(FMT_STRING("{}"), *this);
}
std::string UniqueID32::toString() const { return fmt::format(FMT_STRING("{}"), *this); }
template <>
void UniqueID32Zero::Enumerate<BigDNA::Read>(typename Read::StreamT& reader) {
@ -142,9 +140,7 @@ void UniqueID64::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s)
s += 8;
}
std::string UniqueID64::toString() const {
return fmt::format(FMT_STRING("{}"), *this);
}
std::string UniqueID64::toString() const { return fmt::format(FMT_STRING("{}"), *this); }
/** PAK 128-bit Unique ID */
template <>
@ -175,9 +171,7 @@ void UniqueID128::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s)
s += 16;
}
std::string UniqueID128::toString() const {
return fmt::format(FMT_STRING("{}"), *this);
}
std::string UniqueID128::toString() const { return fmt::format(FMT_STRING("{}"), *this); }
/** Word Bitmap reader/writer */
void WordBitmap::read(athena::io::IStreamReader& reader, size_t bitCount) {

View File

@ -144,7 +144,7 @@ public:
copy[8] = '\0';
assign(strtoul(copy, nullptr, 16));
}
UniqueID32(const wchar_t* hexStr) noexcept{
UniqueID32(const wchar_t* hexStr) noexcept {
wchar_t copy[9];
wcsncpy(copy, hexStr, 8);
copy[8] = L'\0';
@ -345,8 +345,12 @@ using ResCooker = std::function<bool(const hecl::ProjectPath&, const hecl::Proje
/** Mappings of resources involved in extracting characters */
template <class IDType>
struct CharacterAssociations {
struct RigPair { IDType cskr, cinf; };
struct ModelRigPair { IDType cinf, cmdl; };
struct RigPair {
IDType cskr, cinf;
};
struct ModelRigPair {
IDType cinf, cmdl;
};
/* CMDL -> (CSKR, CINF) */
std::unordered_map<IDType, RigPair> m_cmdlRigs;
/* CSKR -> ANCS */
@ -377,17 +381,17 @@ inline hecl::ProjectPath GetPathBeginsWith(const hecl::ProjectPath& parentPath,
namespace std {
template <>
struct hash<DataSpec::DNAFourCC> {
size_t operator()(const DataSpec::DNAFourCC& fcc) const noexcept{ return fcc.toUint32(); }
size_t operator()(const DataSpec::DNAFourCC& fcc) const noexcept { return fcc.toUint32(); }
};
template <>
struct hash<DataSpec::UniqueID32> {
size_t operator()(const DataSpec::UniqueID32& id) const noexcept{ return id.toUint32(); }
size_t operator()(const DataSpec::UniqueID32& id) const noexcept { return id.toUint32(); }
};
template <>
struct hash<DataSpec::UniqueID64> {
size_t operator()(const DataSpec::UniqueID64& id) const noexcept{ return id.toUint64(); }
size_t operator()(const DataSpec::UniqueID64& id) const noexcept { return id.toUint64(); }
};
template <>

View File

@ -45,18 +45,22 @@ struct _DPSM {
bool x5c_24_DMAB = false;
bool x5c_25_DMOO = false;
template<typename _Func>
template <typename _Func>
void constexpr Enumerate(_Func f) {
#define ENTRY(name, identifier) f(FOURCC(name), identifier);
#include "DPSC.def"
}
template<typename _Func>
template <typename _Func>
bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
#define ENTRY(name, identifier) case SBIG(name): f(identifier); return true;
#define ENTRY(name, identifier) \
case SBIG(name): \
f(identifier); \
return true;
#include "DPSC.def"
default: return false;
default:
return false;
}
}
};

View File

@ -53,20 +53,19 @@ void DeafBabeSendToBlender(hecl::blender::PyOutStream& os, const DEAFBABE& db, b
os.format(FMT_STRING("tri_verts.append(col_bm.verts[{}])\n"), vindices[1]);
os.format(FMT_STRING("tri_verts.append(col_bm.verts[{}])\n"), vindices[2]);
os.format(FMT_STRING(
"face = col_bm.faces.get(tri_verts)\n"
"if face is None:\n"
" face = col_bm.faces.new(tri_verts)\n"
"else:\n"
" face = face.copy()\n"
" for i in range(3):\n"
" face.verts[i].co = tri_verts[i].co\n"
" col_bm.verts.ensure_lookup_table()\n"
"face.material_index = select_material(0x{:016X}"
")\n"
"face.smooth = False\n"
"\n"),
atUint64(triMat.material));
os.format(FMT_STRING("face = col_bm.faces.get(tri_verts)\n"
"if face is None:\n"
" face = col_bm.faces.new(tri_verts)\n"
"else:\n"
" face = face.copy()\n"
" for i in range(3):\n"
" face.verts[i].co = tri_verts[i].co\n"
" col_bm.verts.ensure_lookup_table()\n"
"face.material_index = select_material(0x{:016X}"
")\n"
"face.smooth = False\n"
"\n"),
atUint64(triMat.material));
}
db.insertNoClimb(os);

View File

@ -25,18 +25,22 @@ struct _ELSM {
#define BOOL_ENTRY(name, identifier) bool identifier = false;
#include "ELSC.def"
template<typename _Func>
template <typename _Func>
void constexpr Enumerate(_Func f) {
#define ENTRY(name, identifier) f(FOURCC(name), identifier);
#include "ELSC.def"
}
template<typename _Func>
template <typename _Func>
bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
#define ENTRY(name, identifier) case SBIG(name): f(identifier); return true;
#define ENTRY(name, identifier) \
case SBIG(name): \
f(identifier); \
return true;
#include "ELSC.def"
default: return false;
default:
return false;
}
}
};

View File

@ -15,4 +15,4 @@ void Color::Enumerate<athena::io::DNA<athena::Endian::Big>::BinarySize>(BinarySi
s += 4;
}
}
} // namespace GX

View File

@ -295,5 +295,4 @@ struct Color : athena::io::DNA<athena::Endian::Big> {
AT_DECL_EXPLICIT_DNA
};
}
} // namespace GX

View File

@ -146,10 +146,9 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
" edge.seam = True\n"
"\n";
os.format(FMT_STRING(
"bpy.context.scene.name = 'MAPA_{}'\n"
"bpy.context.scene.retro_map_vis_mode = '{}'\n"),
entry.id, RetroMapVisModes[mapa.header->visMode()]);
os.format(FMT_STRING("bpy.context.scene.name = 'MAPA_{}'\n"
"bpy.context.scene.retro_map_vis_mode = '{}'\n"),
entry.id, RetroMapVisModes[mapa.header->visMode()]);
/* Add empties representing MappableObjects */
int moIdx = 0;
@ -159,21 +158,20 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
zeus::simd_floats mtxF[3];
for (int i = 0; i < 3; ++i)
moMP12->transformMtx[i].simd.copy_to(mtxF[i]);
os.format(FMT_STRING(
"obj = bpy.data.objects.new('MAPOBJ_{:02d}', None)\n"
"bpy.context.scene.collection.objects.link(obj)\n"
"obj.retro_mappable_type = {}\n"
"obj.retro_mapobj_vis_mode = '{}'\n"
"obj.retro_mappable_sclyid = '0x{:08X}'\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"obj.rotation_mode = 'QUATERNION'\n"
"obj.location = mtxd[0]\n"
"obj.rotation_quaternion = mtxd[1]\n"
"obj.scale = mtxd[2]\n"),
moIdx, int(moMP12->type), RetroMapObjVisModes[moMP12->visMode], moMP12->sclyId, mtxF[0][0], mtxF[0][1],
mtxF[0][2], mtxF[0][3], mtxF[1][0], mtxF[1][1], mtxF[1][2], mtxF[1][3], mtxF[2][0], mtxF[2][1], mtxF[2][2],
mtxF[2][3]);
os.format(FMT_STRING("obj = bpy.data.objects.new('MAPOBJ_{:02d}', None)\n"
"bpy.context.scene.collection.objects.link(obj)\n"
"obj.retro_mappable_type = {}\n"
"obj.retro_mapobj_vis_mode = '{}'\n"
"obj.retro_mappable_sclyid = '0x{:08X}'\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"obj.rotation_mode = 'QUATERNION'\n"
"obj.location = mtxd[0]\n"
"obj.rotation_quaternion = mtxd[1]\n"
"obj.scale = mtxd[2]\n"),
moIdx, int(moMP12->type), RetroMapObjVisModes[moMP12->visMode], moMP12->sclyId, mtxF[0][0], mtxF[0][1],
mtxF[0][2], mtxF[0][3], mtxF[1][0], mtxF[1][1], mtxF[1][2], mtxF[1][3], mtxF[2][0], mtxF[2][1],
mtxF[2][2], mtxF[2][3]);
++moIdx;
continue;
} else {
@ -181,21 +179,20 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
zeus::simd_floats mtxF[3];
for (int i = 0; i < 3; ++i)
moMP3->transformMtx[i].simd.copy_to(mtxF[i]);
os.format(FMT_STRING(
"obj = bpy.data.objects.new('MAPOBJ_{:02d}', None)\n"
"bpy.context.scene.collection.objects.link(obj)\n"
"obj.retro_mappable_type = {}\n"
"obj.retro_mapobj_vis_mode = '{}'\n"
"obj.retro_mappable_sclyid = '0x{:08X}'\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"obj.rotation_mode = 'QUATERNION'\n"
"obj.location = mtxd[0]\n"
"obj.rotation_quaternion = mtxd[1]\n"
"obj.scale = mtxd[2]\n"),
moIdx, int(moMP3->type), RetroMapObjVisModes[moMP3->visMode], moMP3->sclyId, mtxF[0][0], mtxF[0][1],
mtxF[0][2], mtxF[0][3], mtxF[1][0], mtxF[1][1], mtxF[1][2], mtxF[1][3], mtxF[2][0], mtxF[2][1], mtxF[2][2],
mtxF[2][3]);
os.format(FMT_STRING("obj = bpy.data.objects.new('MAPOBJ_{:02d}', None)\n"
"bpy.context.scene.collection.objects.link(obj)\n"
"obj.retro_mappable_type = {}\n"
"obj.retro_mapobj_vis_mode = '{}'\n"
"obj.retro_mappable_sclyid = '0x{:08X}'\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"obj.rotation_mode = 'QUATERNION'\n"
"obj.location = mtxd[0]\n"
"obj.rotation_quaternion = mtxd[1]\n"
"obj.scale = mtxd[2]\n"),
moIdx, int(moMP3->type), RetroMapObjVisModes[moMP3->visMode], moMP3->sclyId, mtxF[0][0], mtxF[0][1],
mtxF[0][2], mtxF[0][3], mtxF[1][0], mtxF[1][1], mtxF[1][2], mtxF[1][3], mtxF[2][0], mtxF[2][1],
mtxF[2][2], mtxF[2][3]);
++moIdx;
continue;
}
@ -278,15 +275,14 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
const zeus::CMatrix4f* tmpMtx = pakRouter.lookupMAPATransform(entry.id);
const zeus::CMatrix4f& mtx = tmpMtx ? *tmpMtx : zeus::skIdentityMatrix4f;
os.format(FMT_STRING(
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"obj.rotation_mode = 'QUATERNION'\n"
"obj.location = mtxd[0]\n"
"obj.rotation_quaternion = mtxd[1]\n"
"obj.scale = mtxd[2]\n"),
mtx[0][0], mtx[1][0], mtx[2][0], mtx[3][0], mtx[0][1], mtx[1][1], mtx[2][1], mtx[3][1], mtx[0][2], mtx[1][2],
mtx[2][2], mtx[3][2]);
os.format(FMT_STRING("mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"obj.rotation_mode = 'QUATERNION'\n"
"obj.location = mtxd[0]\n"
"obj.rotation_quaternion = mtxd[1]\n"
"obj.scale = mtxd[2]\n"),
mtx[0][0], mtx[1][0], mtx[2][0], mtx[3][0], mtx[0][1], mtx[1][1], mtx[2][1], mtx[3][1], mtx[0][2],
mtx[1][2], mtx[2][2], mtx[3][2]);
/* World background */
hecl::ProjectPath worldDir = outPath.getParentPath().getParentPath();

View File

@ -43,37 +43,35 @@ bool ReadMAPUToBlender(hecl::blender::Connection& conn, const MAPU& mapu, const
for (int i = 0; i < 3; ++i)
wldXf.xf[i].simd.copy_to(wldXfF[i]);
zeus::simd_floats hexColorF(wld.hexColor.mSimd);
os.format(FMT_STRING(
"wldObj = bpy.data.objects.new('{}', None)\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"wldObj.rotation_mode = 'QUATERNION'\n"
"wldObj.location = mtxd[0]\n"
"wldObj.rotation_quaternion = mtxd[1]\n"
"wldObj.scale = mtxd[2]\n"
"wldObj.retro_mapworld_color = ({}, {}, {}, {})\n"
"wldObj.retro_mapworld_path = '''{}'''\n"
"bpy.context.scene.collection.objects.link(wldObj)\n"),
wld.name, wldXfF[0][0], wldXfF[0][1], wldXfF[0][2], wldXfF[0][3], wldXfF[1][0], wldXfF[1][1],
wldXfF[1][2], wldXfF[1][3], wldXfF[2][0], wldXfF[2][1], wldXfF[2][2], wldXfF[2][3], hexColorF[0], hexColorF[1],
hexColorF[2], hexColorF[3], path.getParentPath().getRelativePathUTF8());
os.format(FMT_STRING("wldObj = bpy.data.objects.new('{}', None)\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"wldObj.rotation_mode = 'QUATERNION'\n"
"wldObj.location = mtxd[0]\n"
"wldObj.rotation_quaternion = mtxd[1]\n"
"wldObj.scale = mtxd[2]\n"
"wldObj.retro_mapworld_color = ({}, {}, {}, {})\n"
"wldObj.retro_mapworld_path = '''{}'''\n"
"bpy.context.scene.collection.objects.link(wldObj)\n"),
wld.name, wldXfF[0][0], wldXfF[0][1], wldXfF[0][2], wldXfF[0][3], wldXfF[1][0], wldXfF[1][1],
wldXfF[1][2], wldXfF[1][3], wldXfF[2][0], wldXfF[2][1], wldXfF[2][2], wldXfF[2][3], hexColorF[0],
hexColorF[1], hexColorF[2], hexColorF[3], path.getParentPath().getRelativePathUTF8());
int idx = 0;
for (const MAPU::Transform& hexXf : wld.hexTransforms) {
zeus::simd_floats hexXfF[3];
for (int i = 0; i < 3; ++i)
hexXf.xf[i].simd.copy_to(hexXfF[i]);
os.format(FMT_STRING(
"obj = bpy.data.objects.new('{}_{}', hexMesh)\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"obj.rotation_mode = 'QUATERNION'\n"
"obj.location = mtxd[0]\n"
"obj.rotation_quaternion = mtxd[1]\n"
"obj.scale = mtxd[2]\n"
"bpy.context.scene.collection.objects.link(obj)\n"
"obj.parent = wldObj\n"),
wld.name, idx++, hexXfF[0][0], hexXfF[0][1], hexXfF[0][2], hexXfF[0][3], hexXfF[1][0], hexXfF[1][1],
hexXfF[1][2], hexXfF[1][3], hexXfF[2][0], hexXfF[2][1], hexXfF[2][2], hexXfF[2][3]);
os.format(FMT_STRING("obj = bpy.data.objects.new('{}_{}', hexMesh)\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"obj.rotation_mode = 'QUATERNION'\n"
"obj.location = mtxd[0]\n"
"obj.rotation_quaternion = mtxd[1]\n"
"obj.scale = mtxd[2]\n"
"bpy.context.scene.collection.objects.link(obj)\n"
"obj.parent = wldObj\n"),
wld.name, idx++, hexXfF[0][0], hexXfF[0][1], hexXfF[0][2], hexXfF[0][3], hexXfF[1][0], hexXfF[1][1],
hexXfF[1][2], hexXfF[1][3], hexXfF[2][0], hexXfF[2][1], hexXfF[2][2], hexXfF[2][3]);
}
}

View File

@ -11,7 +11,7 @@ class ProjectPath;
namespace hecl::blender {
class Connection;
struct MapUniverse;
} // namespce hecl::blender
} // namespace hecl::blender
namespace DataSpec::DNAMAPU {
struct MAPU : BigDNA {

View File

@ -41,20 +41,19 @@ bool ReadMLVLToBlender(hecl::blender::Connection& conn, const MLVL& mlvl, const
zeus::simd_floats xfMtxF[3];
for (int i = 0; i < 3; ++i)
area.transformMtx[i].simd.copy_to(xfMtxF[i]);
os.format(FMT_STRING(
"box_mesh = bpy.data.meshes.new('''{}''')\n"
"bm.to_mesh(box_mesh)\n"
"bm.free()\n"
"box = bpy.data.objects.new(box_mesh.name, box_mesh)\n"
"bpy.context.scene.collection.objects.link(box)\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"box.rotation_mode = 'QUATERNION'\n"
"box.location = mtxd[0]\n"
"box.rotation_quaternion = mtxd[1]\n"
"box.scale = mtxd[2]\n"),
areaDirName, xfMtxF[0][0], xfMtxF[0][1], xfMtxF[0][2], xfMtxF[0][3], xfMtxF[1][0], xfMtxF[1][1],
xfMtxF[1][2], xfMtxF[1][3], xfMtxF[2][0], xfMtxF[2][1], xfMtxF[2][2], xfMtxF[2][3]);
os.format(FMT_STRING("box_mesh = bpy.data.meshes.new('''{}''')\n"
"bm.to_mesh(box_mesh)\n"
"bm.free()\n"
"box = bpy.data.objects.new(box_mesh.name, box_mesh)\n"
"bpy.context.scene.collection.objects.link(box)\n"
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"box.rotation_mode = 'QUATERNION'\n"
"box.location = mtxd[0]\n"
"box.rotation_quaternion = mtxd[1]\n"
"box.scale = mtxd[2]\n"),
areaDirName, xfMtxF[0][0], xfMtxF[0][1], xfMtxF[0][2], xfMtxF[0][3], xfMtxF[1][0], xfMtxF[1][1],
xfMtxF[1][2], xfMtxF[1][3], xfMtxF[2][0], xfMtxF[2][1], xfMtxF[2][2], xfMtxF[2][3]);
/* Insert dock planes */
int dockIdx = 0;
@ -67,10 +66,9 @@ bool ReadMLVLToBlender(hecl::blender::Connection& conn, const MLVL& mlvl, const
int idx = 0;
for (const atVec3f& pv : dock.planeVerts) {
const zeus::CVector3f pvRel = zeus::CVector3f(pv) - pvAvg;
os.format(FMT_STRING(
"bm.verts.new(({},{},{}))\n"
"bm.verts.ensure_lookup_table()\n"),
pvRel[0], pvRel[1], pvRel[2]);
os.format(FMT_STRING("bm.verts.new(({},{},{}))\n"
"bm.verts.ensure_lookup_table()\n"),
pvRel[0], pvRel[1], pvRel[2]);
if (idx)
os << "bm.edges.new((bm.verts[-2], bm.verts[-1]))\n";
++idx;

View File

@ -23,4 +23,4 @@ struct MayaSpline : public BigDNA {
Value<float> minAmp;
Value<float> maxAmp;
};
}
} // namespace DataSpec

View File

@ -207,7 +207,8 @@ void PAKRouter<BRIDGETYPE>::enterPAKBridge(const BRIDGETYPE& pakBridge) {
++pit;
++bridgeIdx;
}
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKBridge provided to PAKRouter::enterPAKBridge() was not part of build()"));
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("PAKBridge provided to PAKRouter::enterPAKBridge() was not part of build()"));
}
template <class BRIDGETYPE>
@ -310,8 +311,8 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getCooked(const EntryType* entry) const
auto overrideSearch = m_overrideEntries.find(entry->id);
if (overrideSearch != m_overrideEntries.end()) {
return overrideSearch->second.getCookedPath(*m_dataSpec.overrideDataSpec(
overrideSearch->second, m_dataSpec.getDataSpecEntry()));
return overrideSearch->second.getCookedPath(
*m_dataSpec.overrideDataSpec(overrideSearch->second, m_dataSpec.getDataSpecEntry()));
}
const PAKType* pak = m_pak.get();
@ -352,8 +353,9 @@ hecl::SystemString PAKRouter<BRIDGETYPE>::getResourceRelativePath(const EntryTyp
const nod::Node* node = m_node.get();
const PAKType* pak = m_pak.get();
if (!pak)
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("PAKRouter::enterPAKBridge() must be called before PAKRouter::getResourceRelativePath()"));
LogDNACommon.report(
logvisor::Fatal,
FMT_STRING("PAKRouter::enterPAKBridge() must be called before PAKRouter::getResourceRelativePath()"));
const typename BRIDGETYPE::PAKType::Entry* be = lookupEntry(b);
if (!be)
return hecl::SystemString();
@ -487,15 +489,15 @@ bool PAKRouter<BRIDGETYPE>::extractResources(const BRIDGETYPE& pakBridge, bool f
}
template <class BRIDGETYPE>
const typename BRIDGETYPE::PAKType::Entry* PAKRouter<BRIDGETYPE>::lookupEntry(const IDType& entry,
const nod::Node** nodeOut,
bool silenceWarnings,
bool currentPAK) const {
const typename BRIDGETYPE::PAKType::Entry*
PAKRouter<BRIDGETYPE>::lookupEntry(const IDType& entry, const nod::Node** nodeOut, bool silenceWarnings,
bool currentPAK) const {
if (!entry.isValid())
return nullptr;
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::lookupEntry()"));
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("PAKRouter::build() must be called before PAKRouter::lookupEntry()"));
const PAKType* pak = m_pak.get();
const nod::Node* node = m_node.get();
@ -561,7 +563,8 @@ const zeus::CMatrix4f* PAKRouter<BRIDGETYPE>::lookupMAPATransform(const IDType&
template <class BRIDGETYPE>
hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerWorking(const IDType& areaId, int layerIdx) const {
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerWorking()"));
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerWorking()"));
auto bridgePathIt = m_bridgePaths.cbegin();
for (const BRIDGETYPE& bridge : *m_bridges) {
for (const auto& level : bridge.m_levelDeps)
@ -583,7 +586,8 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerWorking(const IDType& areaI
bool& activeOut) const {
activeOut = false;
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerWorking()"));
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerWorking()"));
auto bridgePathIt = m_bridgePaths.cbegin();
for (const BRIDGETYPE& bridge : *m_bridges) {
for (const auto& level : bridge.m_levelDeps)
@ -605,7 +609,8 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerWorking(const IDType& areaI
template <class BRIDGETYPE>
hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerCooked(const IDType& areaId, int layerIdx) const {
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerCooked()"));
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerCooked()"));
auto bridgePathIt = m_bridgePaths.cbegin();
for (const BRIDGETYPE& bridge : *m_bridges) {
for (const auto& level : bridge.m_levelDeps)
@ -626,7 +631,8 @@ template <class BRIDGETYPE>
hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerCooked(const IDType& areaId, int layerIdx, bool& activeOut) const {
activeOut = false;
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerCooked()"));
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("PAKRouter::build() must be called before PAKRouter::getAreaLayerCooked()"));
auto bridgePathIt = m_bridgePaths.cbegin();
for (const BRIDGETYPE& bridge : *m_bridges) {
for (const auto& level : bridge.m_levelDeps)
@ -648,7 +654,8 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getAreaLayerCooked(const IDType& areaId
template <class BRIDGETYPE>
void PAKRouter<BRIDGETYPE>::enumerateResources(const std::function<bool(const EntryType*)>& func) {
if (!m_bridges)
LogDNACommon.report(logvisor::Fatal, FMT_STRING("PAKRouter::build() must be called before PAKRouter::enumerateResources()"));
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("PAKRouter::build() must be called before PAKRouter::enumerateResources()"));
for (const auto& entryPair : m_uniqueEntries)
if (!func(entryPair.second.second))
return;
@ -661,8 +668,9 @@ template <class BRIDGETYPE>
bool PAKRouter<BRIDGETYPE>::mreaHasDupeResources(const IDType& id) const {
const PAKType* pak = m_pak.get();
if (!pak)
LogDNACommon.report(logvisor::Fatal,
FMT_STRING("PAKRouter::enterPAKBridge() must be called before PAKRouter::mreaHasDupeResources()"));
LogDNACommon.report(
logvisor::Fatal,
FMT_STRING("PAKRouter::enterPAKBridge() must be called before PAKRouter::mreaHasDupeResources()"));
return pak->mreaHasDupeResources(id);
}

View File

@ -32,19 +32,23 @@ struct _GPSM {
#define BOOL_ENTRY(name, identifier, def) bool identifier = def;
#include "PART.def"
template<typename _Func>
template <typename _Func>
void constexpr Enumerate(_Func f) {
#define ENTRY(name, identifier) f(FOURCC(name), identifier);
#define BOOL_ENTRY(name, identifier, def) f(FOURCC(name), identifier, def);
#include "PART.def"
}
template<typename _Func>
template <typename _Func>
bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
#define ENTRY(name, identifier) case SBIG(name): f(identifier); return true;
#define ENTRY(name, identifier) \
case SBIG(name): \
f(identifier); \
return true;
#include "PART.def"
default: return false;
default:
return false;
}
}
};

View File

@ -91,13 +91,13 @@ void PATH<PAKBridge>::sendToBlender(hecl::blender::Connection& conn, std::string
os.format(FMT_STRING("tri_verts.append(bm.verts[{}])\n"), r.nodeStart + i);
os.format(FMT_STRING("face = bm.faces.get(tri_verts)\n"
"if face is None:\n"
" face = bm.faces.new(tri_verts)\n"
" face.normal_flip()\n"
"face.material_index = select_material(0x{:04X}, 0x{:04X})\n"
"face.smooth = False\n"
"face[height_lay] = {}\n"
"\n"),
"if face is None:\n"
" face = bm.faces.new(tri_verts)\n"
" face.normal_flip()\n"
"face.material_index = select_material(0x{:04X}, 0x{:04X})\n"
"face.smooth = False\n"
"face[height_lay] = {}\n"
"\n"),
r.meshIndexMask, r.meshTypeMask, r.height);
#if 0
@ -151,11 +151,11 @@ void PATH<PAKBridge>::sendToBlender(hecl::blender::Connection& conn, std::string
for (int i = 0; i < 4; ++i)
w.m[i].mSimd.copy_to(xfMtxF[i]);
os.format(FMT_STRING("mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"path_mesh_obj.rotation_mode = 'QUATERNION'\n"
"path_mesh_obj.location = mtxd[0]\n"
"path_mesh_obj.rotation_quaternion = mtxd[1]\n"
"path_mesh_obj.scale = mtxd[2]\n"),
"mtxd = mtx.decompose()\n"
"path_mesh_obj.rotation_mode = 'QUATERNION'\n"
"path_mesh_obj.location = mtxd[0]\n"
"path_mesh_obj.rotation_quaternion = mtxd[1]\n"
"path_mesh_obj.scale = mtxd[2]\n"),
xfMtxF[0][0], xfMtxF[1][0], xfMtxF[2][0], xfMtxF[3][0], xfMtxF[0][1], xfMtxF[1][1], xfMtxF[2][1],
xfMtxF[3][1], xfMtxF[0][2], xfMtxF[1][2], xfMtxF[2][2], xfMtxF[3][2]);
}

View File

@ -28,7 +28,7 @@ template <class _Basis>
struct PPImpl : BigDNA, _Basis {
AT_DECL_EXPLICIT_DNA_YAML
template<typename T>
template <typename T>
static constexpr bool _shouldStore(T& p, bool defaultBool) {
if constexpr (std::is_same_v<T, bool>) {
return p != defaultBool;
@ -51,23 +51,23 @@ struct PPImpl : BigDNA, _Basis {
clsId.read(r);
while (clsId != SBIG('_END')) {
if (!_Basis::Lookup(clsId, [&](auto& p) {
using Tp = std::decay_t<decltype(p)>;
if constexpr (std::is_same_v<Tp, bool>) {
DNAFourCC tp(r);
if (tp == SBIG('CNST'))
p = r.readBool();
} else if constexpr (std::is_same_v<Tp, uint32_t>) {
DNAFourCC tp(r);
if (tp == SBIG('CNST'))
p = r.readUint32Big();
} else if constexpr (std::is_same_v<Tp, float>) {
DNAFourCC tp(r);
if (tp == SBIG('CNST'))
p = r.readFloatBig();
} else {
p.read(r);
}
})) {
using Tp = std::decay_t<decltype(p)>;
if constexpr (std::is_same_v<Tp, bool>) {
DNAFourCC tp(r);
if (tp == SBIG('CNST'))
p = r.readBool();
} else if constexpr (std::is_same_v<Tp, uint32_t>) {
DNAFourCC tp(r);
if (tp == SBIG('CNST'))
p = r.readUint32Big();
} else if constexpr (std::is_same_v<Tp, float>) {
DNAFourCC tp(r);
if (tp == SBIG('CNST'))
p = r.readFloatBig();
} else {
p.read(r);
}
})) {
LogModule.report(logvisor::Fatal, FMT_STRING("Unknown {} class {} @{}"), RefType, clsId, r.position());
}
clsId.read(r);
@ -131,17 +131,17 @@ struct PPImpl : BigDNA, _Basis {
if (auto rec = r.enterSubRecord(key)) {
const DNAFourCC clsId = key.c_str();
if (!_Basis::Lookup(clsId, [&](auto& p) {
using Tp = std::decay_t<decltype(p)>;
if constexpr (std::is_same_v<Tp, bool>) {
p = r.readBool();
} else if constexpr (std::is_same_v<Tp, uint32_t>) {
p = r.readUint32();
} else if constexpr (std::is_same_v<Tp, float>) {
p = r.readFloat();
} else {
p.read(r);
}
})) {
using Tp = std::decay_t<decltype(p)>;
if constexpr (std::is_same_v<Tp, bool>) {
p = r.readBool();
} else if constexpr (std::is_same_v<Tp, uint32_t>) {
p = r.readUint32();
} else if constexpr (std::is_same_v<Tp, float>) {
p = r.readFloat();
} else {
p.read(r);
}
})) {
LogModule.report(logvisor::Fatal, FMT_STRING("Unknown {} class {}"), RefType, clsId);
}
}
@ -197,10 +197,10 @@ struct PEImpl : BigDNA {
return;
}
if (!_Basis::Lookup(clsId, [&](auto&& p) {
using Tp = std::decay_t<decltype(p)>;
m_elem = std::make_unique<typename Tp::Type>();
m_elem->read(r);
})) {
using Tp = std::decay_t<decltype(p)>;
m_elem = std::make_unique<typename Tp::Type>();
m_elem->read(r);
})) {
LogModule.report(logvisor::Fatal, FMT_STRING("Unknown {} class {} @{}"), _PtrType::TypeName, clsId, r.position());
}
}
@ -234,10 +234,10 @@ struct PEImpl : BigDNA {
if (auto rec = r.enterSubRecord(key)) {
const DNAFourCC clsId = key.c_str();
if (!_Basis::Lookup(clsId, [&](auto&& p) {
using Tp = std::decay_t<decltype(p)>;
m_elem = std::make_unique<typename Tp::Type>();
m_elem->read(r);
})) {
using Tp = std::decay_t<decltype(p)>;
m_elem = std::make_unique<typename Tp::Type>();
m_elem->read(r);
})) {
LogModule.report(logvisor::Fatal, FMT_STRING("Unknown {} class {}"), _PtrType::TypeName, clsId);
}
}
@ -249,14 +249,13 @@ struct PEImpl : BigDNA {
m_elem->write(w);
}
void gatherDependencies(std::vector<hecl::ProjectPath>& deps) const {
_Basis::gatherDependencies(deps, m_elem);
}
void gatherDependencies(std::vector<hecl::ProjectPath>& deps) const { _Basis::gatherDependencies(deps, m_elem); }
explicit operator bool() const { return m_elem.operator bool(); }
auto* get() const { return m_elem.get(); }
auto* operator->() const { return get(); }
void reset() { m_elem.reset(); }
private:
std::unique_ptr<_PtrType> m_elem;
};
@ -308,44 +307,113 @@ struct RECEXT;
struct REIntTimesReal;
struct _RealElementFactory {
using PtrType = IRealElement;
template<typename _Func>
template <typename _Func>
static bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
case SBIG('LFTW'): f(PEType<RELifetimeTween>{}); return true;
case SBIG('CNST'): f(PEType<REConstant>{}); return true;
case SBIG('CHAN'): f(PEType<RETimeChain>{}); return true;
case SBIG('ADD_'): f(PEType<REAdd>{}); return true;
case SBIG('CLMP'): f(PEType<REClamp>{}); return true;
case SBIG('KEYE'): f(PEType<REKeyframeEmitter>{}); return true;
case SBIG('KEYP'): f(PEType<REKeyframeEmitter>{}); return true;
case SBIG('IRND'): f(PEType<REInitialRandom>{}); return true;
case SBIG('RAND'): f(PEType<RERandom>{}); return true;
case SBIG('MULT'): f(PEType<REMultiply>{}); return true;
case SBIG('PULS'): f(PEType<REPulse>{}); return true;
case SBIG('SCAL'): f(PEType<RETimeScale>{}); return true;
case SBIG('RLPT'): f(PEType<RELifetimePercent>{}); return true;
case SBIG('SINE'): f(PEType<RESineWave>{}); return true;
case SBIG('ISWT'): f(PEType<REInitialSwitch>{}); return true;
case SBIG('CLTN'): f(PEType<RECompareLessThan>{}); return true;
case SBIG('CEQL'): f(PEType<RECompareEquals>{}); return true;
case SBIG('PAP1'): f(PEType<REParticleAdvanceParam1>{}); return true;
case SBIG('PAP2'): f(PEType<REParticleAdvanceParam2>{}); return true;
case SBIG('PAP3'): f(PEType<REParticleAdvanceParam3>{}); return true;
case SBIG('PAP4'): f(PEType<REParticleAdvanceParam4>{}); return true;
case SBIG('PAP5'): f(PEType<REParticleAdvanceParam5>{}); return true;
case SBIG('PAP6'): f(PEType<REParticleAdvanceParam6>{}); return true;
case SBIG('PAP7'): f(PEType<REParticleAdvanceParam7>{}); return true;
case SBIG('PAP8'): f(PEType<REParticleAdvanceParam8>{}); return true;
case SBIG('PSLL'): f(PEType<REParticleSizeOrLineLength>{}); return true;
case SBIG('PRLW'): f(PEType<REParticleRotationOrLineWidth>{}); return true;
case SBIG('SUB_'): f(PEType<RESubtract>{}); return true;
case SBIG('VMAG'): f(PEType<REVectorMagnitude>{}); return true;
case SBIG('VXTR'): f(PEType<REVectorXToReal>{}); return true;
case SBIG('VYTR'): f(PEType<REVectorYToReal>{}); return true;
case SBIG('VZTR'): f(PEType<REVectorZToReal>{}); return true;
case SBIG('CEXT'): f(PEType<RECEXT>{}); return true;
case SBIG('ITRL'): f(PEType<REIntTimesReal>{}); return true;
default: return false;
case SBIG('LFTW'):
f(PEType<RELifetimeTween>{});
return true;
case SBIG('CNST'):
f(PEType<REConstant>{});
return true;
case SBIG('CHAN'):
f(PEType<RETimeChain>{});
return true;
case SBIG('ADD_'):
f(PEType<REAdd>{});
return true;
case SBIG('CLMP'):
f(PEType<REClamp>{});
return true;
case SBIG('KEYE'):
f(PEType<REKeyframeEmitter>{});
return true;
case SBIG('KEYP'):
f(PEType<REKeyframeEmitter>{});
return true;
case SBIG('IRND'):
f(PEType<REInitialRandom>{});
return true;
case SBIG('RAND'):
f(PEType<RERandom>{});
return true;
case SBIG('MULT'):
f(PEType<REMultiply>{});
return true;
case SBIG('PULS'):
f(PEType<REPulse>{});
return true;
case SBIG('SCAL'):
f(PEType<RETimeScale>{});
return true;
case SBIG('RLPT'):
f(PEType<RELifetimePercent>{});
return true;
case SBIG('SINE'):
f(PEType<RESineWave>{});
return true;
case SBIG('ISWT'):
f(PEType<REInitialSwitch>{});
return true;
case SBIG('CLTN'):
f(PEType<RECompareLessThan>{});
return true;
case SBIG('CEQL'):
f(PEType<RECompareEquals>{});
return true;
case SBIG('PAP1'):
f(PEType<REParticleAdvanceParam1>{});
return true;
case SBIG('PAP2'):
f(PEType<REParticleAdvanceParam2>{});
return true;
case SBIG('PAP3'):
f(PEType<REParticleAdvanceParam3>{});
return true;
case SBIG('PAP4'):
f(PEType<REParticleAdvanceParam4>{});
return true;
case SBIG('PAP5'):
f(PEType<REParticleAdvanceParam5>{});
return true;
case SBIG('PAP6'):
f(PEType<REParticleAdvanceParam6>{});
return true;
case SBIG('PAP7'):
f(PEType<REParticleAdvanceParam7>{});
return true;
case SBIG('PAP8'):
f(PEType<REParticleAdvanceParam8>{});
return true;
case SBIG('PSLL'):
f(PEType<REParticleSizeOrLineLength>{});
return true;
case SBIG('PRLW'):
f(PEType<REParticleRotationOrLineWidth>{});
return true;
case SBIG('SUB_'):
f(PEType<RESubtract>{});
return true;
case SBIG('VMAG'):
f(PEType<REVectorMagnitude>{});
return true;
case SBIG('VXTR'):
f(PEType<REVectorXToReal>{});
return true;
case SBIG('VYTR'):
f(PEType<REVectorYToReal>{});
return true;
case SBIG('VZTR'):
f(PEType<REVectorZToReal>{});
return true;
case SBIG('CEXT'):
f(PEType<RECEXT>{});
return true;
case SBIG('ITRL'):
f(PEType<REIntTimesReal>{});
return true;
default:
return false;
}
}
static constexpr void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
@ -377,28 +445,65 @@ struct IEModulo;
struct IESubtract;
struct _IntElementFactory {
using PtrType = IIntElement;
template<typename _Func>
template <typename _Func>
static bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
case SBIG('KEYE'): f(PEType<IEKeyframeEmitter>{}); return true;
case SBIG('KEYP'): f(PEType<IEKeyframeEmitter>{}); return true;
case SBIG('DETH'): f(PEType<IEDeath>{}); return true;
case SBIG('CLMP'): f(PEType<IEClamp>{}); return true;
case SBIG('CHAN'): f(PEType<IETimeChain>{}); return true;
case SBIG('ADD_'): f(PEType<IEAdd>{}); return true;
case SBIG('CNST'): f(PEType<IEConstant>{}); return true;
case SBIG('IMPL'): f(PEType<IEImpulse>{}); return true;
case SBIG('ILPT'): f(PEType<IELifetimePercent>{}); return true;
case SBIG('IRND'): f(PEType<IEInitialRandom>{}); return true;
case SBIG('PULS'): f(PEType<IEPulse>{}); return true;
case SBIG('MULT'): f(PEType<IEMultiply>{}); return true;
case SBIG('SPAH'): f(PEType<IESampleAndHold>{}); return true;
case SBIG('RAND'): f(PEType<IERandom>{}); return true;
case SBIG('TSCL'): f(PEType<IETimeScale>{}); return true;
case SBIG('GTCP'): f(PEType<IEGTCP>{}); return true;
case SBIG('MODU'): f(PEType<IEModulo>{}); return true;
case SBIG('SUB_'): f(PEType<IESubtract>{}); return true;
default: return false;
case SBIG('KEYE'):
f(PEType<IEKeyframeEmitter>{});
return true;
case SBIG('KEYP'):
f(PEType<IEKeyframeEmitter>{});
return true;
case SBIG('DETH'):
f(PEType<IEDeath>{});
return true;
case SBIG('CLMP'):
f(PEType<IEClamp>{});
return true;
case SBIG('CHAN'):
f(PEType<IETimeChain>{});
return true;
case SBIG('ADD_'):
f(PEType<IEAdd>{});
return true;
case SBIG('CNST'):
f(PEType<IEConstant>{});
return true;
case SBIG('IMPL'):
f(PEType<IEImpulse>{});
return true;
case SBIG('ILPT'):
f(PEType<IELifetimePercent>{});
return true;
case SBIG('IRND'):
f(PEType<IEInitialRandom>{});
return true;
case SBIG('PULS'):
f(PEType<IEPulse>{});
return true;
case SBIG('MULT'):
f(PEType<IEMultiply>{});
return true;
case SBIG('SPAH'):
f(PEType<IESampleAndHold>{});
return true;
case SBIG('RAND'):
f(PEType<IERandom>{});
return true;
case SBIG('TSCL'):
f(PEType<IETimeScale>{});
return true;
case SBIG('GTCP'):
f(PEType<IEGTCP>{});
return true;
case SBIG('MODU'):
f(PEType<IEModulo>{});
return true;
case SBIG('SUB_'):
f(PEType<IESubtract>{});
return true;
default:
return false;
}
}
static constexpr void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
@ -430,28 +535,65 @@ struct VEPSOR;
struct VEPSOF;
struct _VectorElementFactory {
using PtrType = IVectorElement;
template<typename _Func>
template <typename _Func>
static bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
case SBIG('CONE'): f(PEType<VECone>{}); return true;
case SBIG('CHAN'): f(PEType<VETimeChain>{}); return true;
case SBIG('ANGC'): f(PEType<VEAngleCone>{}); return true;
case SBIG('ADD_'): f(PEType<VEAdd>{}); return true;
case SBIG('CCLU'): f(PEType<VECircleCluster>{}); return true;
case SBIG('CNST'): f(PEType<VEConstant>{}); return true;
case SBIG('CIRC'): f(PEType<VECircle>{}); return true;
case SBIG('KEYE'): f(PEType<VEKeyframeEmitter>{}); return true;
case SBIG('KEYP'): f(PEType<VEKeyframeEmitter>{}); return true;
case SBIG('MULT'): f(PEType<VEMultiply>{}); return true;
case SBIG('RTOV'): f(PEType<VERealToVector>{}); return true;
case SBIG('PULS'): f(PEType<VEPulse>{}); return true;
case SBIG('PVEL'): f(PEType<VEParticleVelocity>{}); return true;
case SBIG('SPOS'): f(PEType<VESPOS>{}); return true;
case SBIG('PLCO'): f(PEType<VEPLCO>{}); return true;
case SBIG('PLOC'): f(PEType<VEPLOC>{}); return true;
case SBIG('PSOR'): f(PEType<VEPSOR>{}); return true;
case SBIG('PSOF'): f(PEType<VEPSOF>{}); return true;
default: return false;
case SBIG('CONE'):
f(PEType<VECone>{});
return true;
case SBIG('CHAN'):
f(PEType<VETimeChain>{});
return true;
case SBIG('ANGC'):
f(PEType<VEAngleCone>{});
return true;
case SBIG('ADD_'):
f(PEType<VEAdd>{});
return true;
case SBIG('CCLU'):
f(PEType<VECircleCluster>{});
return true;
case SBIG('CNST'):
f(PEType<VEConstant>{});
return true;
case SBIG('CIRC'):
f(PEType<VECircle>{});
return true;
case SBIG('KEYE'):
f(PEType<VEKeyframeEmitter>{});
return true;
case SBIG('KEYP'):
f(PEType<VEKeyframeEmitter>{});
return true;
case SBIG('MULT'):
f(PEType<VEMultiply>{});
return true;
case SBIG('RTOV'):
f(PEType<VERealToVector>{});
return true;
case SBIG('PULS'):
f(PEType<VEPulse>{});
return true;
case SBIG('PVEL'):
f(PEType<VEParticleVelocity>{});
return true;
case SBIG('SPOS'):
f(PEType<VESPOS>{});
return true;
case SBIG('PLCO'):
f(PEType<VEPLCO>{});
return true;
case SBIG('PLOC'):
f(PEType<VEPLOC>{});
return true;
case SBIG('PSOR'):
f(PEType<VEPSOR>{});
return true;
case SBIG('PSOF'):
f(PEType<VEPSOF>{});
return true;
default:
return false;
}
}
static constexpr void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
@ -472,17 +614,32 @@ struct CEFade;
struct CEPulse;
struct _ColorElementFactory {
using PtrType = IColorElement;
template<typename _Func>
template <typename _Func>
static bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
case SBIG('KEYE'): f(PEType<CEKeyframeEmitter>{}); return true;
case SBIG('KEYP'): f(PEType<CEKeyframeEmitter>{}); return true;
case SBIG('CNST'): f(PEType<CEConstant>{}); return true;
case SBIG('CHAN'): f(PEType<CETimeChain>{}); return true;
case SBIG('CFDE'): f(PEType<CEFadeEnd>{}); return true;
case SBIG('FADE'): f(PEType<CEFade>{}); return true;
case SBIG('PULS'): f(PEType<CEPulse>{}); return true;
default: return false;
case SBIG('KEYE'):
f(PEType<CEKeyframeEmitter>{});
return true;
case SBIG('KEYP'):
f(PEType<CEKeyframeEmitter>{});
return true;
case SBIG('CNST'):
f(PEType<CEConstant>{});
return true;
case SBIG('CHAN'):
f(PEType<CETimeChain>{});
return true;
case SBIG('CFDE'):
f(PEType<CEFadeEnd>{});
return true;
case SBIG('FADE'):
f(PEType<CEFade>{});
return true;
case SBIG('PULS'):
f(PEType<CEPulse>{});
return true;
default:
return false;
}
}
static constexpr void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
@ -508,22 +665,47 @@ struct MVEWind;
struct MVESwirl;
struct _ModVectorElementFactory {
using PtrType = IModVectorElement;
template<typename _Func>
template <typename _Func>
static bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
case SBIG('IMPL'): f(PEType<MVEImplosion>{}); return true;
case SBIG('EMPL'): f(PEType<MVEExponentialImplosion>{}); return true;
case SBIG('CHAN'): f(PEType<MVETimeChain>{}); return true;
case SBIG('BNCE'): f(PEType<MVEBounce>{}); return true;
case SBIG('CNST'): f(PEType<MVEConstant>{}); return true;
case SBIG('GRAV'): f(PEType<MVEGravity>{}); return true;
case SBIG('EXPL'): f(PEType<MVEExplode>{}); return true;
case SBIG('SPOS'): f(PEType<MVESetPosition>{}); return true;
case SBIG('LMPL'): f(PEType<MVELinearImplosion>{}); return true;
case SBIG('PULS'): f(PEType<MVEPulse>{}); return true;
case SBIG('WIND'): f(PEType<MVEWind>{}); return true;
case SBIG('SWRL'): f(PEType<MVESwirl>{}); return true;
default: return false;
case SBIG('IMPL'):
f(PEType<MVEImplosion>{});
return true;
case SBIG('EMPL'):
f(PEType<MVEExponentialImplosion>{});
return true;
case SBIG('CHAN'):
f(PEType<MVETimeChain>{});
return true;
case SBIG('BNCE'):
f(PEType<MVEBounce>{});
return true;
case SBIG('CNST'):
f(PEType<MVEConstant>{});
return true;
case SBIG('GRAV'):
f(PEType<MVEGravity>{});
return true;
case SBIG('EXPL'):
f(PEType<MVEExplode>{});
return true;
case SBIG('SPOS'):
f(PEType<MVESetPosition>{});
return true;
case SBIG('LMPL'):
f(PEType<MVELinearImplosion>{});
return true;
case SBIG('PULS'):
f(PEType<MVEPulse>{});
return true;
case SBIG('WIND'):
f(PEType<MVEWind>{});
return true;
case SBIG('SWRL'):
f(PEType<MVESwirl>{});
return true;
default:
return false;
}
}
static constexpr void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
@ -541,14 +723,23 @@ struct VESphere;
struct VEAngleSphere;
struct _EmitterElementFactory {
using PtrType = IEmitterElement;
template<typename _Func>
template <typename _Func>
static bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
case SBIG('SETR'): f(PEType<EESimpleEmitterTR>{}); return true;
case SBIG('SEMR'): f(PEType<EESimpleEmitter>{}); return true;
case SBIG('SPHE'): f(PEType<VESphere>{}); return true;
case SBIG('ASPH'): f(PEType<VEAngleSphere>{}); return true;
default: return false;
case SBIG('SETR'):
f(PEType<EESimpleEmitterTR>{});
return true;
case SBIG('SEMR'):
f(PEType<EESimpleEmitter>{});
return true;
case SBIG('SPHE'):
f(PEType<VESphere>{});
return true;
case SBIG('ASPH'):
f(PEType<VEAngleSphere>{});
return true;
default:
return false;
}
}
static constexpr void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
@ -1296,12 +1487,17 @@ struct UVEAnimTexture : IUVElement {
template <class IDType>
struct _UVElementFactory {
using PtrType = IUVElement;
template<typename _Func>
template <typename _Func>
static bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
case SBIG('CNST'): f(PEType<UVEConstant<IDType>>{}); return true;
case SBIG('ATEX'): f(PEType<UVEAnimTexture<IDType>>{}); return true;
default: return false;
case SBIG('CNST'):
f(PEType<UVEConstant<IDType>>{});
return true;
case SBIG('ATEX'):
f(PEType<UVEAnimTexture<IDType>>{});
return true;
default:
return false;
}
}
static constexpr void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,

View File

@ -8,7 +8,8 @@
namespace DataSpec {
void ISTRG::gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const { /* TODO: parse out resource tokens */ }
void ISTRG::gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const { /* TODO: parse out resource tokens */
}
std::unique_ptr<ISTRG> LoadSTRG(athena::io::IStreamReader& reader) {
uint32_t magic = reader.readUint32Big();

View File

@ -28,19 +28,23 @@ struct _SWSH {
#define BOOL_ENTRY(name, identifier, def) bool identifier = def;
#include "SWHC.def"
template<typename _Func>
template <typename _Func>
void constexpr Enumerate(_Func f) {
#define ENTRY(name, identifier) f(FOURCC(name), identifier);
#define BOOL_ENTRY(name, identifier, def) f(FOURCC(name), identifier, def);
#include "SWHC.def"
}
template<typename _Func>
template <typename _Func>
bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
#define ENTRY(name, identifier) case SBIG(name): f(identifier); return true;
#define ENTRY(name, identifier) \
case SBIG(name): \
f(identifier); \
return true;
#include "SWHC.def"
default: return false;
default:
return false;
}
}
};

View File

@ -252,7 +252,7 @@ static void DecodeIA4(png_structp png, png_infop info, const uint8_t* texels, in
for (int y = height - 1; y >= 0; --y) {
for (int x = 0; x < width; ++x) {
const uint8_t texel = Lookup8BPP(texels, width, x, y);
buf[x * 2 ] = Convert4To8(texel & 0xf);
buf[x * 2] = Convert4To8(texel & 0xf);
buf[x * 2 + 1] = Convert4To8(texel >> 4 & 0xf);
}
png_write_row(png, buf.get());
@ -1067,7 +1067,8 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
}
if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to initialize libpng I/O for '{}'")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to initialize libpng I/O for '{}'")),
inPath.getAbsolutePath());
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1386,7 +1387,8 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
}
if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to initialize libpng I/O for '{}'")), inPath.getAbsolutePath());
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to initialize libpng I/O for '{}'")),
inPath.getAbsolutePath());
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1627,9 +1629,7 @@ void DataSpec::TXTR::PaletteMeta::Enumerate(typename Op::StreamT& s) {
AT_SPECIALIZE_DNA_YAML(DataSpec::TXTR::PaletteMeta)
std::string_view DataSpec::TXTR::PaletteMeta::DNAType() {
return "DataSpec::TXTR::PaletteMeta"sv;
}
std::string_view DataSpec::TXTR::PaletteMeta::DNAType() { return "DataSpec::TXTR::PaletteMeta"sv; }
template <class Op>
void DataSpec::TXTR::Meta::Enumerate(typename Op::StreamT& s) {
@ -1645,13 +1645,9 @@ void DataSpec::TXTR::Meta::Enumerate(typename Op::StreamT& s) {
AT_SPECIALIZE_DNA_YAML(DataSpec::TXTR::Meta)
std::string_view DataSpec::TXTR::Meta::DNAType() {
return "DataSpec::TXTR::Meta"sv;
}
std::string_view DataSpec::TXTR::Meta::DNAType() { return "DataSpec::TXTR::Meta"sv; }
static const atInt32 RetroToDol[11] {
0, 1, 2, 3, 8, 9, -1, 4, 5, 6, 14
};
static const atInt32 RetroToDol[11]{0, 1, 2, 3, 8, 9, -1, 4, 5, 6, 14};
TXTR::Meta TXTR::GetMetaData(DataSpec::PAKEntryReadStream& rs) {
const atUint32 retroFormat = rs.readUint32Big();
@ -1679,8 +1675,8 @@ TXTR::Meta TXTR::GetMetaData(DataSpec::PAKEntryReadStream& rs) {
rs.readUBytesToBuf(palData.get(), palSize);
palMeta.dolphinHash = XXH64(palData.get(), palSize, 0);
} else {
switch(format) {
case 0: // I4
switch (format) {
case 0: // I4
case 14: // DXT1
textureSize /= 2;
break;

View File

@ -126,10 +126,10 @@ struct ITweakGui : ITweak {
virtual float GetHudLightAttMulLinear() const = 0;
virtual float GetHudLightAttMulQuadratic() const = 0;
virtual std::string_view GetCreditsTable() const = 0;
virtual std::string_view GetCreditsFont() const =0;
virtual std::string_view GetJapaneseCreditsFont() const=0;
virtual const zeus::CColor& GetCreditsTextFontColor() const=0;
virtual const zeus::CColor& GetCreditsTextBorderColor() const=0;
virtual std::string_view GetCreditsFont() const = 0;
virtual std::string_view GetJapaneseCreditsFont() const = 0;
virtual const zeus::CColor& GetCreditsTextFontColor() const = 0;
virtual const zeus::CColor& GetCreditsTextBorderColor() const = 0;
static float FaceReflectionDistanceDebugValueToActualValue(float v) { return 0.015f * v + 0.2f; }
static float FaceReflectionHeightDebugValueToActualValue(float v) { return 0.005f * v - 0.05f; }

View File

@ -21,8 +21,8 @@ struct ITweakPlayerRes : ITweak {
ResId x18_minesBreakSecondTopIcon;
ResId x1c_minesBreakSecondBottomIcon;
ResId rs5_mapArrowUp;
ResId rs5_mapArrowDown;
ResId rs5_mapArrowUp;
ResId rs5_mapArrowDown;
/* N, U, UL, L, DL, D, DR, R, UR */
std::array<ResId, 9> x24_lStick;

View File

@ -28,19 +28,23 @@ struct _WPSM {
#define BOOL_ENTRY(name, identifier, def) bool identifier = def;
#include "WPSC.def"
template<typename _Func>
template <typename _Func>
void constexpr Enumerate(_Func f) {
#define ENTRY(name, identifier) f(FOURCC(name), identifier);
#define BOOL_ENTRY(name, identifier, def) f(FOURCC(name), identifier, def);
#include "WPSC.def"
}
template<typename _Func>
template <typename _Func>
bool constexpr Lookup(FourCC fcc, _Func f) {
switch (fcc.toUint32()) {
#define ENTRY(name, identifier) case SBIG(name): f(identifier); return true;
#define ENTRY(name, identifier) \
case SBIG(name): \
f(identifier); \
return true;
#include "WPSC.def"
default: return false;
default:
return false;
}
}
};

View File

@ -99,8 +99,6 @@ void AFSM::State::Transition::Trigger::Enumerate<BigDNA::BinarySize>(size_t& __i
__isz += (first ? 8 : 4);
}
std::string_view AFSM::State::Transition::Trigger::DNAType() {
return "DNAMP1::AFSM::State::Transition::Trigger"sv;
}
std::string_view AFSM::State::Transition::Trigger::DNAType() { return "DNAMP1::AFSM::State::Transition::Trigger"sv; }
} // namespace DataSpec::DNAMP1

View File

@ -605,9 +605,7 @@ void ANCS::CharacterSet::CharacterInfo::Enumerate<BigDNA::WriteYaml>(athena::io:
}
}
std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() {
return "DNAMP1::ANCS::CharacterSet::CharacterInfo"sv;
}
std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() { return "DNAMP1::ANCS::CharacterSet::CharacterInfo"sv; }
template <>
void ANCS::AnimationSet::MetaAnimFactory::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
@ -1049,8 +1047,7 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
ch.cskrIce = inPath.ensureAuxInfo(
fmt::format(FMT_STRING(_SYS_STR("{}.{}_{}.CSKR")), chSysName, overlaySys, cskrSys));
} else {
ch.cskrIce = inPath.ensureAuxInfo(
fmt::format(FMT_STRING(_SYS_STR("{}.{}.CSKR")), chSysName, overlaySys));
ch.cskrIce = inPath.ensureAuxInfo(fmt::format(FMT_STRING(_SYS_STR("{}.{}.CSKR")), chSysName, overlaySys));
}
}
}
@ -1101,8 +1098,8 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
ancs.animationSet.animResources.back().animId = pathOut;
/* Check for associated EVNT YAML */
hecl::SystemString testPrefix(inPath.getWithExtension(
fmt::format(FMT_STRING(_SYS_STR(".{}_")), sysStr).c_str(), true).getLastComponent());
hecl::SystemString testPrefix(
inPath.getWithExtension(fmt::format(FMT_STRING(_SYS_STR(".{}_")), sysStr).c_str(), true).getLastComponent());
hecl::ProjectPath evntYamlPath;
for (const auto& ent : dEnum) {
if (hecl::StringUtils::BeginsWith(ent.m_name, testPrefix.c_str()) &&
@ -1126,8 +1123,7 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
static const hecl::SystemRegex regCskrNameId(_SYS_STR(R"((.*)_[0-9a-fA-F]{8}\.CSKR)"),
std::regex::ECMAScript | std::regex::optimize);
static const hecl::SystemRegex regCskrName(_SYS_STR(R"((.*)\.CSKR)"),
std::regex::ECMAScript | std::regex::optimize);
static const hecl::SystemRegex regCskrName(_SYS_STR(R"((.*)\.CSKR)"), std::regex::ECMAScript | std::regex::optimize);
bool ANCS::CookCSKR(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath, const DNAANCS::Actor& actor,
const std::function<bool(const hecl::ProjectPath& modelPath)>& modelCookFunc) {
@ -1220,8 +1216,7 @@ bool ANCS::CookCSKR(const hecl::ProjectPath& outPath, const hecl::ProjectPath& i
const std::string& name = boneNames[bIdx];
auto search = boneIdMap.find(name);
if (search == boneIdMap.cend())
Log.report(logvisor::Fatal, FMT_STRING("unable to find bone '{}' in {}"), name,
inPath.getRelativePathUTF8());
Log.report(logvisor::Fatal, FMT_STRING("unable to find bone '{}' in {}"), name, inPath.getRelativePathUTF8());
virtualBone.first.emplace_back(search->second, weight);
}
virtualBone.second = skinIO.readUint32Big();
@ -1359,8 +1354,7 @@ bool ANCS::CookCSKRPC(const hecl::ProjectPath& outPath, const hecl::ProjectPath&
const std::string& name = boneNames[bIdx];
auto search = boneIdMap.find(name);
if (search == boneIdMap.cend())
Log.report(logvisor::Fatal, FMT_STRING("unable to find bone '{}' in {}"), name,
inPath.getRelativePathUTF8());
Log.report(logvisor::Fatal, FMT_STRING("unable to find bone '{}' in {}"), name, inPath.getRelativePathUTF8());
virtualBone.emplace_back(search->second, weight);
}
}
@ -1380,8 +1374,7 @@ bool ANCS::CookCSKRPC(const hecl::ProjectPath& outPath, const hecl::ProjectPath&
const std::string& name = boneNames[bIdx];
auto search = boneIdMap.find(name);
if (search == boneIdMap.cend())
Log.report(logvisor::Fatal, FMT_STRING("unable to find bone '{}' in {}"), name,
inPath.getRelativePathUTF8());
Log.report(logvisor::Fatal, FMT_STRING("unable to find bone '{}' in {}"), name, inPath.getRelativePathUTF8());
skinOut.writeUint32Big(search->second);
}
}
@ -1403,8 +1396,7 @@ bool ANCS::CookCSKRPC(const hecl::ProjectPath& outPath, const hecl::ProjectPath&
static const hecl::SystemRegex regAnimNameId(_SYS_STR(R"((.*)_[0-9a-fA-F]{8}\.ANIM)"),
std::regex::ECMAScript | std::regex::optimize);
static const hecl::SystemRegex regAnimName(_SYS_STR(R"((.*)\.ANIM)"),
std::regex::ECMAScript | std::regex::optimize);
static const hecl::SystemRegex regAnimName(_SYS_STR(R"((.*)\.ANIM)"), std::regex::ECMAScript | std::regex::optimize);
bool ANCS::CookANIM(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath, const DNAANCS::Actor& actor,
hecl::blender::DataStream& ds, bool pc) {
@ -1438,8 +1430,8 @@ bool ANCS::CookANIM(const hecl::ProjectPath& outPath, const hecl::ProjectPath& i
ANIM anim(action, boneIdMap, *rigInv, pc);
/* Check for associated EVNT YAML */
hecl::SystemString testPrefix(inPath.getWithExtension(
fmt::format(FMT_STRING(_SYS_STR(".{}_")), actName).c_str(), true).getLastComponent());
hecl::SystemString testPrefix(
inPath.getWithExtension(fmt::format(FMT_STRING(_SYS_STR(".{}_")), actName).c_str(), true).getLastComponent());
hecl::ProjectPath evntYamlPath;
for (const auto& ent : hecl::DirectoryEnumerator(inPath.getParentPath().getAbsolutePath())) {
if (hecl::StringUtils::BeginsWith(ent.m_name, testPrefix.c_str()) &&

View File

@ -7,10 +7,9 @@ namespace DataSpec::DNAMP1 {
using ANIMOutStream = hecl::blender::ANIMOutStream;
void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os, const DNAANIM::RigInverter<CINF>& rig) const {
os.format(FMT_STRING(
"act.hecl_fps = round({})\n"
"act.hecl_looping = {}\n"),
(1.0f / mainInterval), looping ? "True" : "False");
os.format(FMT_STRING("act.hecl_fps = round({})\n"
"act.hecl_looping = {}\n"),
(1.0f / mainInterval), looping ? "True" : "False");
auto kit = chanKeys.begin();

View File

@ -44,26 +44,24 @@ void CINF::sendVertexGroupsToBlender(hecl::blender::PyOutStream& os) const {
void CINF::sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID32& cinfId) const {
DNAANIM::RigInverter<CINF> inverter(*this);
os.format(FMT_STRING(
"arm = bpy.data.armatures.new('CINF_{}')\n"
"arm_obj = bpy.data.objects.new(arm.name, arm)\n"
"bpy.context.scene.collection.objects.link(arm_obj)\n"
"bpy.context.view_layer.objects.active = arm_obj\n"
"bpy.ops.object.mode_set(mode='EDIT')\n"
"arm_bone_table = {{}}\n"),
cinfId);
os.format(FMT_STRING("arm = bpy.data.armatures.new('CINF_{}')\n"
"arm_obj = bpy.data.objects.new(arm.name, arm)\n"
"bpy.context.scene.collection.objects.link(arm_obj)\n"
"bpy.context.view_layer.objects.active = arm_obj\n"
"bpy.ops.object.mode_set(mode='EDIT')\n"
"arm_bone_table = {{}}\n"),
cinfId);
for (const DNAANIM::RigInverter<CINF>::Bone& bone : inverter.getBones()) {
zeus::simd_floats originF(bone.m_origBone.origin.simd);
zeus::simd_floats tailF(bone.m_tail.mSimd);
os.format(FMT_STRING(
"bone = arm.edit_bones.new('{}')\n"
"bone.head = ({},{},{})\n"
"bone.tail = ({},{},{})\n"
"bone.use_inherit_scale = False\n"
"arm_bone_table[{}] = bone\n"),
*getBoneNameFromId(bone.m_origBone.id), originF[0], originF[1], originF[2], tailF[0], tailF[1],
tailF[2], bone.m_origBone.id);
os.format(FMT_STRING("bone = arm.edit_bones.new('{}')\n"
"bone.head = ({},{},{})\n"
"bone.tail = ({},{},{})\n"
"bone.use_inherit_scale = False\n"
"arm_bone_table[{}] = bone\n"),
*getBoneNameFromId(bone.m_origBone.id), originF[0], originF[1], originF[2], tailF[0], tailF[1], tailF[2],
bone.m_origBone.id);
}
for (const Bone& bone : bones)
@ -168,14 +166,15 @@ bool CINF::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
auto os = conn.beginPythonOut(true);
os.format(FMT_STRING("import bpy\n"
"from mathutils import Vector\n"
"bpy.context.scene.name = 'CINF_{}'\n"
"bpy.context.scene.hecl_arm_obj = bpy.context.scene.name\n"
"\n"
"# Clear Scene\n"
"if len(bpy.data.collections):\n"
" bpy.data.collections.remove(bpy.data.collections[0])\n"
"\n"), entry.id);
"from mathutils import Vector\n"
"bpy.context.scene.name = 'CINF_{}'\n"
"bpy.context.scene.hecl_arm_obj = bpy.context.scene.name\n"
"\n"
"# Clear Scene\n"
"if len(bpy.data.collections):\n"
" bpy.data.collections.remove(bpy.data.collections[0])\n"
"\n"),
entry.id);
CINF cinf;
cinf.read(rs);

View File

@ -35,9 +35,9 @@ void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t
texLabel = "Texture";
out.format(FMT_STRING("# Texture\n"
"tex_node = new_nodetree.nodes.new('ShaderNodeTexImage')\n"
"tex_node.label = '{} {}'\n"
"texture_nodes.append(tex_node)\n"),
"tex_node = new_nodetree.nodes.new('ShaderNodeTexImage')\n"
"tex_node.label = '{} {}'\n"
"texture_nodes.append(tex_node)\n"),
texLabel, texIdx);
if (texIdx != 0xff)
@ -51,10 +51,11 @@ void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['Normal'], tex_node.inputs['Vector']))\n";
else if (type >= GX::TG_TEX0 && type <= GX::TG_TEX7) {
uint8_t texIdx = type - GX::TG_TEX0;
out.format(FMT_STRING("tex_uv_node = new_nodetree.nodes.new('ShaderNodeUVMap')\n"
out.format(
FMT_STRING("tex_uv_node = new_nodetree.nodes.new('ShaderNodeUVMap')\n"
"tex_links.append(new_nodetree.links.new(tex_uv_node.outputs['UV'], tex_node.inputs['Vector']))\n"
"tex_uv_node.uv_map = 'UV_{}'\n"),
texIdx);
texIdx);
}
out.format(FMT_STRING("tex_uv_node.label = '{}'\n"), mtxLabel);
@ -71,160 +72,160 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
switch (type) {
case UVAnimation::Mode::MvInvNoTranslation:
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode0NodeN']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode0NodeN']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
idx);
break;
case UVAnimation::Mode::MvInv:
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode1NodeN']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode1NodeN']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
idx);
break;
case UVAnimation::Mode::Scroll:
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode2Node']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = ({},{},0)\n"
" node.inputs[2].default_value = ({},{},0)\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode2Node']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = ({},{},0)\n"
" node.inputs[2].default_value = ({},{},0)\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
idx, vals[0], vals[1], vals[2], vals[3]);
break;
case UVAnimation::Mode::Rotation:
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode3Node']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = {}\n"
" node.inputs[2].default_value = {}\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode3Node']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = {}\n"
" node.inputs[2].default_value = {}\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
idx, vals[0], vals[1]);
break;
case UVAnimation::Mode::HStrip:
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode4Node']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = {}\n"
" node.inputs[2].default_value = {}\n"
" node.inputs[3].default_value = {}\n"
" node.inputs[4].default_value = {}\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode4Node']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = {}\n"
" node.inputs[2].default_value = {}\n"
" node.inputs[3].default_value = {}\n"
" node.inputs[4].default_value = {}\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
idx, vals[0], vals[1], vals[2], vals[3]);
break;
case UVAnimation::Mode::VStrip:
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode5Node']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = {}\n"
" node.inputs[2].default_value = {}\n"
" node.inputs[3].default_value = {}\n"
" node.inputs[4].default_value = {}\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode5Node']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = {}\n"
" node.inputs[2].default_value = {}\n"
" node.inputs[3].default_value = {}\n"
" node.inputs[4].default_value = {}\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
idx, vals[0], vals[1], vals[2], vals[3]);
break;
case UVAnimation::Mode::Model:
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode6NodeN']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode6NodeN']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
idx);
break;
case UVAnimation::Mode::CylinderEnvironment:
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode7NodeN']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = {}\n"
" node.inputs[2].default_value = {}\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode7NodeN']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = {}\n"
" node.inputs[2].default_value = {}\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
idx, vals[0], vals[1]);
break;
case UVAnimation::Mode::Eight:
out.format(FMT_STRING("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode8Node']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = {}\n"
" node.inputs[2].default_value = {}\n"
" node.inputs[3].default_value = {}\n"
" node.inputs[4].default_value = {}\n"
" node.inputs[5].default_value = {}\n"
" node.inputs[6].default_value = {}\n"
" node.inputs[7].default_value = {}\n"
" node.inputs[8].default_value = {}\n"
" node.inputs[9].default_value = {}\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
" if link.from_node.label == 'MTX_{}':\n"
" tex_links.remove(link)\n"
" soc_from = link.from_socket\n"
" soc_to = link.to_socket\n"
" node = new_nodetree.nodes.new('ShaderNodeGroup')\n"
" node.node_tree = bpy.data.node_groups['RetroUVMode8Node']\n"
" node.location[0] = link.from_node.location[0] + 50\n"
" node.location[1] = link.from_node.location[1] - 50\n"
" node.inputs[1].default_value = {}\n"
" node.inputs[2].default_value = {}\n"
" node.inputs[3].default_value = {}\n"
" node.inputs[4].default_value = {}\n"
" node.inputs[5].default_value = {}\n"
" node.inputs[6].default_value = {}\n"
" node.inputs[7].default_value = {}\n"
" node.inputs[8].default_value = {}\n"
" node.inputs[9].default_value = {}\n"
" new_nodetree.links.remove(link)\n"
" new_nodetree.links.new(soc_from, node.inputs[0])\n"
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n"),
idx, vals[0], vals[1], vals[2], vals[3], vals[4], vals[5], vals[6], vals[7], vals[8]);
break;
default:
@ -234,8 +235,8 @@ void Material::AddTextureAnim(Stream& out, UVAnimation::Mode type, unsigned idx,
void Material::AddKcolor(Stream& out, const GX::Color& col, unsigned idx) {
out.format(FMT_STRING("kcolors[{}] = ({}, {}, {}, {})\n"
"kalphas[{}] = {}\n"
"\n"),
"kalphas[{}] = {}\n"
"\n"),
idx, (float)col.color[0] / (float)0xff, (float)col.color[1] / (float)0xff,
(float)col.color[2] / (float)0xff, (float)col.color[3] / (float)0xff, idx,
(float)col.color[3] / (float)0xff);
@ -343,10 +344,11 @@ template <class MAT>
static void _DescribeTEV(const MAT& mat) {
for (uint32_t i = 0; i < mat.tevStageCount; ++i) {
const auto& stage = mat.tevStages[i];
fmt::print(stderr, FMT_STRING("A:{} B:{} C:{} D:{} -> {} | A:{} B:{} C:{} D:{} -> {}\n"), ToString(stage.colorInA()),
ToString(stage.colorInB()), ToString(stage.colorInC()), ToString(stage.colorInD()),
ToString(stage.colorOpOutReg()), ToString(stage.alphaInA()), ToString(stage.alphaInB()),
ToString(stage.alphaInC()), ToString(stage.alphaInD()), ToString(stage.alphaOpOutReg()));
fmt::print(stderr, FMT_STRING("A:{} B:{} C:{} D:{} -> {} | A:{} B:{} C:{} D:{} -> {}\n"),
ToString(stage.colorInA()), ToString(stage.colorInB()), ToString(stage.colorInC()),
ToString(stage.colorInD()), ToString(stage.colorOpOutReg()), ToString(stage.alphaInA()),
ToString(stage.alphaInB()), ToString(stage.alphaInC()), ToString(stage.alphaInD()),
ToString(stage.alphaOpOutReg()));
}
bool hasInd = mat.flags.samusReflectionIndirectTexture();
bool hasLm = mat.flags.lightmap();
@ -459,14 +461,14 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
/* Material Flags */
out.format(FMT_STRING("new_material.retro_depth_sort = {}\n"
"new_material.retro_alpha_test = {}\n"
"new_material.retro_samus_reflection = {}\n"
"new_material.retro_depth_write = {}\n"
"new_material.retro_samus_reflection_persp = {}\n"
"new_material.retro_shadow_occluder = {}\n"
"new_material.retro_samus_reflection_indirect = {}\n"
"new_material.retro_lightmapped = {}\n"
"new_material.diffuse_color = (1, 1, 1, {})\n"),
"new_material.retro_alpha_test = {}\n"
"new_material.retro_samus_reflection = {}\n"
"new_material.retro_depth_write = {}\n"
"new_material.retro_samus_reflection_persp = {}\n"
"new_material.retro_shadow_occluder = {}\n"
"new_material.retro_samus_reflection_indirect = {}\n"
"new_material.retro_lightmapped = {}\n"
"new_material.diffuse_color = (1, 1, 1, {})\n"),
material.flags.depthSorting() ? "True" : "False", material.flags.alphaTest() ? "True" : "False",
material.flags.samusReflection() ? "True" : "False", material.flags.depthWrite() ? "True" : "False",
material.flags.samusReflectionSurfaceEye() ? "True" : "False",
@ -763,7 +765,8 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
_GenerateRootShader(out, "RetroShader", "Emissive"_tex, "Reflection"_tex);
break;
case 0xF4DA0A86: /* RetroShader: KColorDiffuse, Emissive, Alpha=KAlpha */
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Emissive"_tex, "Alpha"_kcola); break;
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Emissive"_tex, "Alpha"_kcola);
break;
break;
case 0xF559DB08: /* RetroShader: Lightmap, Diffuse, Emissive, Specular, Reflection, Alpha=1.0 */
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, "Specular"_tex,

View File

@ -469,9 +469,8 @@ struct MaterialSet : BigDNA {
static void AddDynamicAlpha(hecl::blender::PyOutStream& out, unsigned idx);
Material() = default;
Material(const hecl::blender::Material& material,
std::vector<hecl::ProjectPath>& texPathsOut,
int colorCount, bool lightmapUVs, bool matrixSkinning);
Material(const hecl::blender::Material& material, std::vector<hecl::ProjectPath>& texPathsOut, int colorCount,
bool lightmapUVs, bool matrixSkinning);
};
Vector<Material, AT_DNA_COUNT(head.materialCount)> materials;
@ -617,8 +616,7 @@ struct HMDLMaterialSet : BigDNA {
Vector<Chunk, AT_DNA_COUNT(chunkCount)> chunks;
Value<BlendMaterial::BlendMode> blendMode = BlendMaterial::BlendMode::Opaque;
std::pair<hecl::Backend::BlendFactor, hecl::Backend::BlendFactor>
blendFactors() const {
std::pair<hecl::Backend::BlendFactor, hecl::Backend::BlendFactor> blendFactors() const {
switch (blendMode) {
case BlendMaterial::BlendMode::Opaque:
default:

View File

@ -2,68 +2,68 @@ include(DNAMP1/ScriptObjects/CMakeLists.txt)
include(DNAMP1/SFX/CMakeLists.txt)
make_dnalist(PAK
MLVL
AGSC
CSNG
AFSM
ANCS
ANIM
CINF
CSKR
EVNT
CMDLMaterials
MREA
DeafBabe
SCAN
FRME
SAVW
HINT
MazeSeeds
SnowForces
DCLN
Tweaks/CTweakGame
Tweaks/CTweakParticle
Tweaks/CTweakPlayer
Tweaks/CTweakPlayerControl
Tweaks/CTweakPlayerGun
Tweaks/CTweakGunRes
Tweaks/CTweakPlayerRes
Tweaks/CTweakGui
Tweaks/CTweakSlideShow
Tweaks/CTweakCameraBob
Tweaks/CTweakTargeting
Tweaks/CTweakAutoMapper
Tweaks/CTweakBall
Tweaks/CTweakGuiColors)
MLVL
AGSC
CSNG
AFSM
ANCS
ANIM
CINF
CSKR
EVNT
CMDLMaterials
MREA
DeafBabe
SCAN
FRME
SAVW
HINT
MazeSeeds
SnowForces
DCLN
Tweaks/CTweakGame
Tweaks/CTweakParticle
Tweaks/CTweakPlayer
Tweaks/CTweakPlayerControl
Tweaks/CTweakPlayerGun
Tweaks/CTweakGunRes
Tweaks/CTweakPlayerRes
Tweaks/CTweakGui
Tweaks/CTweakSlideShow
Tweaks/CTweakCameraBob
Tweaks/CTweakTargeting
Tweaks/CTweakAutoMapper
Tweaks/CTweakBall
Tweaks/CTweakGuiColors)
set(DNAMP1_SOURCES
DNAMP1.hpp DNAMP1.cpp
AFSM.cpp
PAK.cpp
MLVL.cpp
STRG.hpp STRG.cpp
AGSC.cpp
CSNG.cpp
CSKR.cpp
ANCS.cpp
ANIM.cpp
CINF.cpp
EVNT.cpp
PATH.hpp
CMDL.hpp CMDL.cpp
CMDLMaterials.cpp
DCLN.cpp
MAPA.hpp
MAPU.hpp
MREA.cpp
SCLY.hpp SCLY.cpp
FRME.cpp
SCAN.cpp
DeafBabe.cpp
Tweaks/CTweakAutoMapper.cpp
Tweaks/CTweakPlayer.cpp
Tweaks/CTweakTargeting.cpp
Tweaks/CTweakBall.cpp
Tweaks/CTweakGame.cpp)
DNAMP1.hpp DNAMP1.cpp
AFSM.cpp
PAK.cpp
MLVL.cpp
STRG.hpp STRG.cpp
AGSC.cpp
CSNG.cpp
CSKR.cpp
ANCS.cpp
ANIM.cpp
CINF.cpp
EVNT.cpp
PATH.hpp
CMDL.hpp CMDL.cpp
CMDLMaterials.cpp
DCLN.cpp
MAPA.hpp
MAPU.hpp
MREA.cpp
SCLY.hpp SCLY.cpp
FRME.cpp
SCAN.cpp
DeafBabe.cpp
Tweaks/CTweakAutoMapper.cpp
Tweaks/CTweakPlayer.cpp
Tweaks/CTweakTargeting.cpp
Tweaks/CTweakBall.cpp
Tweaks/CTweakGame.cpp)
dataspec_add_list(DNAMP1 DNAMP1_SOURCES)

View File

@ -45,7 +45,7 @@ bool CSNG::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
athena::io::YAMLDocWriter ydw("amuse::Songs", r ? &*r : nullptr);
r = std::nullopt;
ydw.writeString(fmt::format(FMT_STRING("{:04X}"), head.midiSetupId),
fmt::format(FMT_STRING("../MidiData/{}"), midPath.getLastComponentUTF8()));
fmt::format(FMT_STRING("../MidiData/{}"), midPath.getLastComponentUTF8()));
athena::io::FileWriter w(songsPath.getAbsolutePath());
ydw.finish(&w);

View File

@ -30,16 +30,15 @@ void DCLN::Collision::Node::sendToBlender(hecl::blender::PyOutStream& os) const
void DCLN::sendToBlender(hecl::blender::Connection& conn, std::string_view entryName) {
/* Open Py Stream and read sections */
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
os.format(FMT_STRING(
"import bpy\n"
"import bmesh\n"
"from mathutils import Vector, Matrix\n"
"\n"
"bpy.context.scene.name = '{}'\n"
"# Clear Scene\n"
"if len(bpy.data.collections):\n"
" bpy.data.collections.remove(bpy.data.collections[0])\n"),
entryName);
os.format(FMT_STRING("import bpy\n"
"import bmesh\n"
"from mathutils import Vector, Matrix\n"
"\n"
"bpy.context.scene.name = '{}'\n"
"# Clear Scene\n"
"if len(bpy.data.collections):\n"
" bpy.data.collections.remove(bpy.data.collections[0])\n"),
entryName);
DeafBabe::BlenderInit(os);
atInt32 idx = 0;

View File

@ -306,14 +306,13 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
" bpy.context.scene.collection.objects.link(ob_new)\n"
" return ob_new\n";
os.format(FMT_STRING(
"bpy.context.scene.name = '{}'\n"
"bpy.context.scene.render.resolution_x = 640\n"
"bpy.context.scene.render.resolution_y = 480\n"
"bpy.context.scene.world.use_nodes = True\n"
"bg_node = bpy.context.scene.world.node_tree.nodes['Background']\n"
"bg_node.inputs[1].default_value = 0.0\n"),
pakRouter.getBestEntryName(entry));
os.format(FMT_STRING("bpy.context.scene.name = '{}'\n"
"bpy.context.scene.render.resolution_x = 640\n"
"bpy.context.scene.render.resolution_y = 480\n"
"bpy.context.scene.world.use_nodes = True\n"
"bg_node = bpy.context.scene.world.node_tree.nodes['Background']\n"
"bg_node.inputs[1].default_value = 0.0\n"),
pakRouter.getBestEntryName(entry));
int pIdx = 0;
for (const FRME::Widget& w : frme.widgets) {
@ -321,32 +320,29 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
"angle = Quaternion((1.0, 0.0, 0.0), 0)\n";
if (w.type == SBIG('CAMR')) {
using CAMRInfo = Widget::CAMRInfo;
os.format(FMT_STRING(
"cam = bpy.data.cameras.new(name='{}')\n"
"binding = cam\n"),
w.header.name);
os.format(FMT_STRING("cam = bpy.data.cameras.new(name='{}')\n"
"binding = cam\n"),
w.header.name);
if (CAMRInfo* info = static_cast<CAMRInfo*>(w.widgetInfo.get())) {
if (info->projectionType == CAMRInfo::ProjectionType::Orthographic) {
CAMRInfo::OrthographicProjection* proj =
static_cast<CAMRInfo::OrthographicProjection*>(info->projection.get());
os.format(FMT_STRING(
"cam.type = 'ORTHO'\n"
"cam.ortho_scale = {}\n"
"cam.clip_start = {}\n"
"cam.clip_end = {}\n"),
std::fabs(proj->right - proj->left), proj->znear, proj->zfar);
os.format(FMT_STRING("cam.type = 'ORTHO'\n"
"cam.ortho_scale = {}\n"
"cam.clip_start = {}\n"
"cam.clip_end = {}\n"),
std::fabs(proj->right - proj->left), proj->znear, proj->zfar);
} else if (info->projectionType == CAMRInfo::ProjectionType::Perspective) {
CAMRInfo::PerspectiveProjection* proj = static_cast<CAMRInfo::PerspectiveProjection*>(info->projection.get());
os.format(FMT_STRING(
"cam.type = 'PERSP'\n"
"cam.lens_unit = 'FOV'\n"
"cam.clip_start = {}\n"
"cam.clip_end = {}\n"
"bpy.context.scene.render.resolution_x = 480 * {}\n"),
proj->znear, proj->zfar, proj->aspect);
os.format(FMT_STRING("cam.type = 'PERSP'\n"
"cam.lens_unit = 'FOV'\n"
"cam.clip_start = {}\n"
"cam.clip_end = {}\n"
"bpy.context.scene.render.resolution_x = 480 * {}\n"),
proj->znear, proj->zfar, proj->aspect);
if (proj->aspect > 1.f)
os.format(FMT_STRING("cam.angle = math.atan2({}, 1.0 / math.tan(math.radians({} / 2.0))) * 2.0\n"), proj->aspect,
proj->fov);
os.format(FMT_STRING("cam.angle = math.atan2({}, 1.0 / math.tan(math.radians({} / 2.0))) * 2.0\n"),
proj->aspect, proj->fov);
else
os.format(FMT_STRING("cam.angle = math.radians({})\n"), proj->fov);
}
@ -358,10 +354,9 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
switch (info->type) {
case LITEInfo::ELightType::LocalAmbient: {
zeus::simd_floats colorF(w.header.color.simd);
os.format(FMT_STRING(
"bg_node.inputs[0].default_value = ({},{},{},1.0)\n"
"bg_node.inputs[1].default_value = {}\n"),
colorF[0], colorF[1], colorF[2], info->distQ / 8.0);
os.format(FMT_STRING("bg_node.inputs[0].default_value = ({},{},{},1.0)\n"
"bg_node.inputs[1].default_value = {}\n"),
colorF[0], colorF[1], colorF[2], info->distQ / 8.0);
break;
}
case LITEInfo::ELightType::Spot:
@ -370,24 +365,22 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
[[fallthrough]];
default: {
zeus::simd_floats colorF(w.header.color.simd);
os.format(FMT_STRING(
"lamp = bpy.data.lights.new(name='{}', type='POINT')\n"
"lamp.color = ({}, {}, {})\n"
"lamp.hecl_falloff_constant = {}\n"
"lamp.hecl_falloff_linear = {}\n"
"lamp.hecl_falloff_quadratic = {}\n"
"lamp.retro_light_angle_constant = {}\n"
"lamp.retro_light_angle_linear = {}\n"
"lamp.retro_light_angle_quadratic = {}\n"
"lamp.retro_light_index = {}\n"
"binding = lamp\n"),
w.header.name, colorF[0], colorF[1], colorF[2], info->distC, info->distL, info->distQ, info->angC,
info->angL, info->angQ, info->loadedIdx);
os.format(FMT_STRING("lamp = bpy.data.lights.new(name='{}', type='POINT')\n"
"lamp.color = ({}, {}, {})\n"
"lamp.hecl_falloff_constant = {}\n"
"lamp.hecl_falloff_linear = {}\n"
"lamp.hecl_falloff_quadratic = {}\n"
"lamp.retro_light_angle_constant = {}\n"
"lamp.retro_light_angle_linear = {}\n"
"lamp.retro_light_angle_quadratic = {}\n"
"lamp.retro_light_index = {}\n"
"binding = lamp\n"),
w.header.name, colorF[0], colorF[1], colorF[2], info->distC, info->distL, info->distQ, info->angC,
info->angL, info->angQ, info->loadedIdx);
if (info->type == LITEInfo::ELightType::Spot)
os.format(FMT_STRING(
"lamp.type = 'SPOT'\n"
"lamp.spot_size = {}\n"),
info->cutoff);
os.format(FMT_STRING("lamp.type = 'SPOT'\n"
"lamp.spot_size = {}\n"),
info->cutoff);
else if (info->type == LITEInfo::ELightType::Directional)
os << "lamp.type = 'SUN'\n";
}
@ -413,28 +406,26 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
if (resPath.size()) {
hecl::SystemUTF8Conv resPathView(resPath);
os.format(FMT_STRING(
"if '{}' in bpy.data.images:\n"
" image = bpy.data.images['{}']\n"
"else:\n"
" image = bpy.data.images.load('''//{}''')\n"
" image.name = '{}'\n"),
texName, texName, resPathView, texName);
os.format(FMT_STRING("if '{}' in bpy.data.images:\n"
" image = bpy.data.images['{}']\n"
"else:\n"
" image = bpy.data.images.load('''//{}''')\n"
" image.name = '{}'\n"),
texName, texName, resPathView, texName);
} else {
os << "image = None\n";
}
os.format(FMT_STRING(
"material = bpy.data.materials.new('{}')\n"
"material.use_nodes = True\n"
"new_nodetree = material.node_tree\n"
"for n in new_nodetree.nodes:\n"
" new_nodetree.nodes.remove(n)\n"
"tex_node = new_nodetree.nodes.new('ShaderNodeTexImage')\n"
"tex_node.image = image\n"
"bm = bmesh.new()\n"
"verts = []\n"),
w.header.name);
os.format(FMT_STRING("material = bpy.data.materials.new('{}')\n"
"material.use_nodes = True\n"
"new_nodetree = material.node_tree\n"
"for n in new_nodetree.nodes:\n"
" new_nodetree.nodes.remove(n)\n"
"tex_node = new_nodetree.nodes.new('ShaderNodeTexImage')\n"
"tex_node.image = image\n"
"bm = bmesh.new()\n"
"verts = []\n"),
w.header.name);
for (uint32_t i = 0; i < info->quadCoordCount; ++i) {
int ti;
@ -461,37 +452,36 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
zeus::simd_floats f(info->uvCoords[ti].simd);
os.format(FMT_STRING("bm.verts[{}].link_loops[0][bm.loops.layers.uv[0]].uv = ({},{})\n"), i, f[0], f[1]);
}
os.format(FMT_STRING(
"binding = bpy.data.meshes.new('{}')\n"
"bm.to_mesh(binding)\n"
"bm.free()\n"
"binding.materials.append(material)\n"),
w.header.name);
os.format(FMT_STRING("binding = bpy.data.meshes.new('{}')\n"
"bm.to_mesh(binding)\n"
"bm.free()\n"
"binding.materials.append(material)\n"),
w.header.name);
}
}
zeus::simd_floats colorF(w.header.color.simd);
os.format(FMT_STRING(
"frme_obj = bpy.data.objects.new(name='{}', object_data=binding)\n"
"frme_obj.pass_index = {}\n"
"parentName = '{}'\n"
"frme_obj.retro_widget_type = 'RETRO_{}'\n"
"frme_obj.retro_widget_use_anim_controller = {}\n"
"frme_obj.retro_widget_default_visible = {}\n"
"frme_obj.retro_widget_default_active = {}\n"
"frme_obj.retro_widget_cull_faces = {}\n"
"frme_obj.retro_widget_color = ({},{},{},{})\n"
"frme_obj.retro_widget_model_draw_flags = bpy.types.Object.retro_widget_model_draw_flags[1]['items'][{}][0]\n"
"frme_obj.retro_widget_is_worker = {}\n"
"frme_obj.retro_widget_worker_id = {}\n"
"if parentName not in bpy.data.objects:\n"
" frme_obj.retro_widget_parent = parentName\n"
"else:\n"
" frme_obj.parent = bpy.data.objects[parentName]\n"),
w.header.name, pIdx++, w.header.parent, w.type,
w.header.useAnimController ? "True" : "False", w.header.defaultVisible ? "True" : "False",
w.header.defaultActive ? "True" : "False", w.header.cullFaces ? "True" : "False", colorF[0], colorF[1],
colorF[2], colorF[3], w.header.modelDrawFlags, w.isWorker ? "True" : "False", w.workerId);
os.format(FMT_STRING("frme_obj = bpy.data.objects.new(name='{}', object_data=binding)\n"
"frme_obj.pass_index = {}\n"
"parentName = '{}'\n"
"frme_obj.retro_widget_type = 'RETRO_{}'\n"
"frme_obj.retro_widget_use_anim_controller = {}\n"
"frme_obj.retro_widget_default_visible = {}\n"
"frme_obj.retro_widget_default_active = {}\n"
"frme_obj.retro_widget_cull_faces = {}\n"
"frme_obj.retro_widget_color = ({},{},{},{})\n"
"frme_obj.retro_widget_model_draw_flags = "
"bpy.types.Object.retro_widget_model_draw_flags[1]['items'][{}][0]\n"
"frme_obj.retro_widget_is_worker = {}\n"
"frme_obj.retro_widget_worker_id = {}\n"
"if parentName not in bpy.data.objects:\n"
" frme_obj.retro_widget_parent = parentName\n"
"else:\n"
" frme_obj.parent = bpy.data.objects[parentName]\n"),
w.header.name, pIdx++, w.header.parent, w.type, w.header.useAnimController ? "True" : "False",
w.header.defaultVisible ? "True" : "False", w.header.defaultActive ? "True" : "False",
w.header.cullFaces ? "True" : "False", colorF[0], colorF[1], colorF[2], colorF[3],
w.header.modelDrawFlags, w.isWorker ? "True" : "False", w.workerId);
if (w.type == SBIG('MODL')) {
using MODLInfo = FRME::Widget::MODLInfo;
@ -516,10 +506,9 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
using PANEInfo = Widget::PANEInfo;
if (PANEInfo* info = static_cast<PANEInfo*>(w.widgetInfo.get())) {
zeus::simd_floats f(info->scaleCenter.simd);
os.format(FMT_STRING(
"frme_obj.retro_pane_dimensions = ({},{})\n"
"frme_obj.retro_pane_scale_center = ({},{},{})\n"),
info->xDim, info->zDim, f[0], f[1], f[2]);
os.format(FMT_STRING("frme_obj.retro_pane_dimensions = ({},{})\n"
"frme_obj.retro_pane_scale_center = ({},{},{})\n"),
info->xDim, info->zDim, f[0], f[1], f[2]);
}
} else if (w.type == SBIG('TXPN')) {
using TXPNInfo = Widget::TXPNInfo;
@ -533,35 +522,33 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
zeus::simd_floats fillF(info->fillColor.simd);
zeus::simd_floats outlineF(info->outlineColor.simd);
zeus::simd_floats extentF(info->blockExtent.simd);
os.format(FMT_STRING(
"frme_obj.retro_pane_dimensions = ({},{})\n"
"frme_obj.retro_pane_scale_center = ({},{},{})\n"
"frme_obj.retro_textpane_font_path = '{}'\n"
"frme_obj.retro_textpane_word_wrap = {}\n"
"frme_obj.retro_textpane_horizontal = {}\n"
"frme_obj.retro_textpane_fill_color = ({},{},{},{})\n"
"frme_obj.retro_textpane_outline_color = ({},{},{},{})\n"
"frme_obj.retro_textpane_block_extent = ({},{})\n"
"frme_obj.retro_textpane_jp_font_path = '{}'\n"
"frme_obj.retro_textpane_jp_font_scale = ({},{})\n"
"frme_obj.retro_textpane_hjustification = "
"bpy.types.Object.retro_textpane_hjustification[1]['items'][{}][0]\n"
"frme_obj.retro_textpane_vjustification = "
"bpy.types.Object.retro_textpane_vjustification[1]['items'][{}][0]\n"),
info->xDim, info->zDim, scaleF[0], scaleF[1], scaleF[2], fontPath.getRelativePathUTF8(),
info->wordWrap ? "True" : "False", info->horizontal ? "True" : "False", fillF[0], fillF[1], fillF[2],
fillF[3], outlineF[0], outlineF[1], outlineF[2], outlineF[3], extentF[0], extentF[1],
jpFontPath.getRelativePathUTF8(), info->jpnPointScale[0], info->jpnPointScale[1],
int(info->justification), int(info->verticalJustification));
os.format(FMT_STRING("frme_obj.retro_pane_dimensions = ({},{})\n"
"frme_obj.retro_pane_scale_center = ({},{},{})\n"
"frme_obj.retro_textpane_font_path = '{}'\n"
"frme_obj.retro_textpane_word_wrap = {}\n"
"frme_obj.retro_textpane_horizontal = {}\n"
"frme_obj.retro_textpane_fill_color = ({},{},{},{})\n"
"frme_obj.retro_textpane_outline_color = ({},{},{},{})\n"
"frme_obj.retro_textpane_block_extent = ({},{})\n"
"frme_obj.retro_textpane_jp_font_path = '{}'\n"
"frme_obj.retro_textpane_jp_font_scale = ({},{})\n"
"frme_obj.retro_textpane_hjustification = "
"bpy.types.Object.retro_textpane_hjustification[1]['items'][{}][0]\n"
"frme_obj.retro_textpane_vjustification = "
"bpy.types.Object.retro_textpane_vjustification[1]['items'][{}][0]\n"),
info->xDim, info->zDim, scaleF[0], scaleF[1], scaleF[2], fontPath.getRelativePathUTF8(),
info->wordWrap ? "True" : "False", info->horizontal ? "True" : "False", fillF[0], fillF[1], fillF[2],
fillF[3], outlineF[0], outlineF[1], outlineF[2], outlineF[3], extentF[0], extentF[1],
jpFontPath.getRelativePathUTF8(), info->jpnPointScale[0], info->jpnPointScale[1],
int(info->justification), int(info->verticalJustification));
}
} else if (w.type == SBIG('TBGP')) {
using TBGPInfo = Widget::TBGPInfo;
if (TBGPInfo* info = static_cast<TBGPInfo*>(w.widgetInfo.get())) {
os.format(FMT_STRING(
"frme_obj.retro_tablegroup_elem_count = {}\n"
"frme_obj.retro_tablegroup_elem_default = {}\n"
"frme_obj.retro_tablegroup_wraparound = {}\n"),
info->elementCount, info->defaultSelection, info->selectWraparound ? "True" : "False");
os.format(FMT_STRING("frme_obj.retro_tablegroup_elem_count = {}\n"
"frme_obj.retro_tablegroup_elem_default = {}\n"
"frme_obj.retro_tablegroup_wraparound = {}\n"),
info->elementCount, info->defaultSelection, info->selectWraparound ? "True" : "False");
}
} else if (w.type == SBIG('GRUP')) {
using GRUPInfo = Widget::GRUPInfo;
@ -571,12 +558,11 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
} else if (w.type == SBIG('SLGP')) {
using SLGPInfo = Widget::SLGPInfo;
if (SLGPInfo* info = static_cast<SLGPInfo*>(w.widgetInfo.get())) {
os.format(FMT_STRING(
"frme_obj.retro_slider_min = {}\n"
"frme_obj.retro_slider_max = {}\n"
"frme_obj.retro_slider_default = {}\n"
"frme_obj.retro_slider_increment = {}\n"),
info->min, info->max, info->cur, info->increment);
os.format(FMT_STRING("frme_obj.retro_slider_min = {}\n"
"frme_obj.retro_slider_max = {}\n"
"frme_obj.retro_slider_default = {}\n"
"frme_obj.retro_slider_increment = {}\n"),
info->min, info->max, info->cur, info->increment);
}
} else if (w.type == SBIG('ENRG')) {
using ENRGInfo = Widget::ENRGInfo;
@ -588,11 +574,10 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
} else if (w.type == SBIG('METR')) {
using METRInfo = Widget::METRInfo;
if (METRInfo* info = static_cast<METRInfo*>(w.widgetInfo.get())) {
os.format(FMT_STRING(
"frme_obj.retro_meter_no_round_up = {}\n"
"frme_obj.retro_meter_max_capacity = {}\n"
"frme_obj.retro_meter_worker_count = {}\n"),
info->noRoundUp ? "True" : "False", info->maxCapacity, info->workerCount);
os.format(FMT_STRING("frme_obj.retro_meter_no_round_up = {}\n"
"frme_obj.retro_meter_max_capacity = {}\n"
"frme_obj.retro_meter_worker_count = {}\n"),
info->noRoundUp ? "True" : "False", info->maxCapacity, info->workerCount);
}
}
@ -600,16 +585,15 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
for (int i = 0; i < 3; ++i)
w.basis[i].simd.copy_to(xfMtxF[i]);
zeus::simd_floats originF(w.origin.simd);
os.format(FMT_STRING(
"mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"frme_obj.rotation_mode = 'QUATERNION'\n"
"frme_obj.location = mtxd[0]\n"
"frme_obj.rotation_quaternion = mtxd[1] @ angle\n"
"frme_obj.scale = mtxd[2]\n"
"bpy.context.scene.collection.objects.link(frme_obj)\n"),
xfMtxF[0][0], xfMtxF[0][1], xfMtxF[0][2], originF[0], xfMtxF[1][0], xfMtxF[1][1], xfMtxF[1][2], originF[1],
xfMtxF[2][0], xfMtxF[2][1], xfMtxF[2][2], originF[2]);
os.format(FMT_STRING("mtx = Matrix((({},{},{},{}),({},{},{},{}),({},{},{},{}),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"
"frme_obj.rotation_mode = 'QUATERNION'\n"
"frme_obj.location = mtxd[0]\n"
"frme_obj.rotation_quaternion = mtxd[1] @ angle\n"
"frme_obj.scale = mtxd[2]\n"
"bpy.context.scene.collection.objects.link(frme_obj)\n"),
xfMtxF[0][0], xfMtxF[0][1], xfMtxF[0][2], originF[0], xfMtxF[1][0], xfMtxF[1][1], xfMtxF[1][2],
originF[1], xfMtxF[2][0], xfMtxF[2][1], xfMtxF[2][2], originF[2]);
}
os.centerView();

View File

@ -202,8 +202,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
"from mathutils import Vector\n"
"bpy.context.scene.render.fps = 60\n"
"\n";
os.format(FMT_STRING("bpy.context.scene.name = '{}'\n"),
pakRouter.getBestEntryName(entry, false));
os.format(FMT_STRING("bpy.context.scene.name = '{}'\n"), pakRouter.getBestEntryName(entry, false));
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath());
MaterialSet::RegisterMaterialProps(os);
os << "# Clear Scene\n"
@ -244,13 +243,13 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
rs.seek(secStart + head.secSizes[curSec++], athena::SeekOrigin::Begin);
curSec += DNACMDL::ReadGeomSectionsToBlender<PAKRouter<PAKBridge>, MaterialSet, RigPair, DNACMDL::SurfaceHeader_1>(
os, rs, pakRouter, entry, dummy, true, true, vertAttribs, m, head.secCount, 0, &head.secSizes[curSec]);
os.format(FMT_STRING(
"obj.retro_disable_enviro_visor = {}\n"
"obj.retro_disable_thermal_visor = {}\n"
"obj.retro_disable_xray_visor = {}\n"
"obj.retro_thermal_level = '{}'\n"),
mHeader.visorFlags.disableEnviro() ? "True" : "False", mHeader.visorFlags.disableThermal() ? "True" : "False",
mHeader.visorFlags.disableXray() ? "True" : "False", mHeader.visorFlags.thermalLevelStr());
os.format(FMT_STRING("obj.retro_disable_enviro_visor = {}\n"
"obj.retro_disable_thermal_visor = {}\n"
"obj.retro_disable_xray_visor = {}\n"
"obj.retro_thermal_level = '{}'\n"),
mHeader.visorFlags.disableEnviro() ? "True" : "False",
mHeader.visorFlags.disableThermal() ? "True" : "False",
mHeader.visorFlags.disableXray() ? "True" : "False", mHeader.visorFlags.thermalLevelStr());
}
/* Skip AROT */
@ -314,8 +313,8 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
"bpy.context.view_layer.layer_collection.children['Collision'].hide_viewport = True\n";
/* Link MLVL scene as background */
os.linkBackground(fmt::format(FMT_STRING("//../!world_{}.blend"),
pakRouter.getCurrentBridge().getLevelId()), "World"sv);
os.linkBackground(fmt::format(FMT_STRING("//../!world_{}.blend"), pakRouter.getCurrentBridge().getLevelId()),
"World"sv);
os.centerView();
os.close();

View File

@ -114,13 +114,15 @@ void SCLY::ScriptLayer::Enumerate<BigDNA::Read>(athena::io::IStreamReader& rs) {
objects.push_back(std::move(obj));
size_t actualLen = rs.position() - start;
if (actualLen != len)
Log.report(logvisor::Fatal,
FMT_STRING(_SYS_STR("Error while reading object of type 0x{:02X}, did not read the expected amount of "
Log.report(
logvisor::Fatal,
FMT_STRING(_SYS_STR("Error while reading object of type 0x{:02X}, did not read the expected amount of "
"data, read 0x{:x}, expected 0x{:x}")),
(atUint32)type, actualLen, len);
(atUint32)type, actualLen, len);
rs.seek(start + len, athena::SeekOrigin::Begin);
} else {
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to find type 0x{:X} in object database")), (atUint32)type);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to find type 0x{:X} in object database")),
(atUint32)type);
}
}
}
@ -145,7 +147,8 @@ void SCLY::ScriptLayer::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& r
obj->type = type;
objects.push_back(std::move(obj));
} else
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to find type 0x{:X} in object database")), (atUint32)type);
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to find type 0x{:X} in object database")),
(atUint32)type);
}
}
} else

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0001 1
#define SFXelu_a_elec_lp_00 42
#define SFXat2_b_fly_lp_00 43
#define SFXatm_b_fly_lp_00 44
@ -27,5 +25,3 @@
#define SFXsfx0039 57
#define SFXsfx003A 58
#define SFXsfx003B 59

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0002 2
#define SFXsfx003C 60
#define SFXsfx003D 61
#define SFXsfx003E 62
@ -41,5 +39,3 @@
#define SFXsfx0059 89
#define SFXsfx005A 90
#define SFXsfx005B 91

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0003 3
#define SFXsfx005C 92
#define SFXsfx005D 93
#define SFXsfx005E 94
@ -16,5 +14,3 @@
#define SFXsfx0060 96
#define SFXsfx0061 97
#define SFXsfx0062 98

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0004 4
#define SFXblf_a_btmspit_00 99
#define SFXblf_a_bulb_00 100
#define SFXsfx0065 101
@ -30,5 +28,3 @@
#define SFXsfx0075 117
#define SFXsfx0076 118
#define SFXsfx0077 119

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0005 5
#define SFXbur_a_attack_00 120
#define SFXbur_b_burrow_lp_00 121
#define SFXbur_b_idle_00 122
@ -29,5 +27,3 @@
#define SFXsfx0089 137
#define SFXsfx008A 138
#define SFXsfx008B 139

View File

@ -1,7 +1,7 @@
unset(DNAMP1_SFX_SOURCES)
macro(add_sfx_header HEADER SYMBOL)
bintoc("DNAMP1/SFX/${SYMBOL}.cpp" "DNAMP1/SFX/${HEADER}" "${SYMBOL}")
list(APPEND DNAMP1_SFX_SOURCES "DNAMP1/SFX/${SYMBOL}.cpp" "DNAMP1/SFX/${HEADER}")
bintoc("DNAMP1/SFX/${SYMBOL}.cpp" "DNAMP1/SFX/${HEADER}" "${SYMBOL}")
list(APPEND DNAMP1_SFX_SOURCES "DNAMP1/SFX/${SYMBOL}.cpp" "DNAMP1/SFX/${HEADER}")
endmacro(add_sfx_header)
add_sfx_header(Atomic.h Atomic_H)

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0006 6
#define SFXchg_a_dball_00 140
#define SFXchg_a_dcharge_00 141
#define SFXchg_a_dfire_00 142
@ -61,5 +59,3 @@
#define SFXsfx00BD 189
#define SFXsfx00BE 190
#define SFXsfx00BF 191

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0007 7
#define SFXchb_r_scream_00 192
#define SFXchb_r_alert_00_lp 193
#define SFXsfx00C2 194
@ -16,5 +14,3 @@
#define SFXsfx00C4 196
#define SFXsfx00C5 197
#define SFXsfx00C6 198

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup003B 59
#define SFXci7_x_jump_00 2972
#define SFXsja_c_electric_lp_00 2973
#define SFXsfx0B9E 2974
@ -29,5 +27,3 @@
#define SFXsfx0BAD 2989
#define SFXsfx0BAE 2990
#define SFXsfx0BAF 2991

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup003C 60
#define SFXsfx0BB0 2992
#define SFXsfx0BB1 2993
#define SFXci5_x_mapdown_00 2994
@ -50,5 +48,3 @@
#define SFXsfx0BD6 3030
#define SFXsfx0BD7 3031
#define SFXsfx0BD8 3032

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup003E 62
#define SFXsfx0BE5 3045
#define SFXci3_x_clank_00 3046
#define SFXci4_x_clank_00 3047
@ -23,5 +21,3 @@
#define SFXsfx0BF0 3056
#define SFXsfx0BF1 3057
#define SFXsfx0BF2 3058

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup003F 63
#define SFXsfx0BF3 3059
#define SFXsfx0BF4 3060
#define SFXsfx0BF5 3061
@ -19,5 +17,3 @@
#define SFXsfx0BFA 3066
#define SFXsfx0BFB 3067
#define SFXsfx0BFC 3068

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0040 64
#define SFXci2_x_energy_lp_00 3069
#define SFXci2_x_energy_lp_01 3070
#define SFXsfx0BFF 3071
@ -34,5 +32,3 @@
#define SFXsfx0C13 3091
#define SFXsfx0C14 3092
#define SFXsfx0C15 3093

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup003D 61
#define SFXcin_x_visor_00 3033
#define SFXsfx0BDA 3034
#define SFXsfx0BDB 3035
@ -21,5 +19,3 @@
#define SFXsfx0BE2 3042
#define SFXsfx0BE3 3043
#define SFXsfx0BE4 3044

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup002C 44
#define SFXsfx0764 1892
#define SFXsfx0765 1893
#define SFXsfx0766 1894
@ -39,5 +37,3 @@
#define SFXsfx077F 1919
#define SFXsfx0780 1920
#define SFXsfx0781 1921

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0008 8
#define SFXcry_b_idle_00 199
#define SFXsfx00C8 200
#define SFXsfx00C9 201
@ -19,5 +17,3 @@
#define SFXsfx00CE 206
#define SFXsfx00CF 207
#define SFXsfx00D0 208

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0009 9
#define SFXepr_a_shockhit_00 209
#define SFXsfx00D2 210
#define SFXdrn_b_burst_00 211
@ -69,5 +67,3 @@
#define SFXsfx010A 266
#define SFXsfx010B 267
#define SFXsfx010C 268

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup000A 10
#define SFXepr_a_grenade_00 269
#define SFXsfx010E 270
#define SFXsfx010F 271
@ -63,5 +61,3 @@
#define SFXsfx0140 320
#define SFXsfx0141 321
#define SFXsfx0142 322

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup000B 11
#define SFXfif_b_idle_lp_00 323
#define SFXsfx0144 324
#define SFXfif_b_light_00 325
@ -22,5 +20,3 @@
#define SFXsfx014D 333
#define SFXsfx014E 334
#define SFXsfx014F 335

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0034 52
#define SFXfla_a_hitgrnd_00 2600
#define SFXfla_a_swoosh_00 2601
#define SFXfla_a_swoosh_01 2602
@ -90,5 +88,3 @@
#define SFXsfx0A76 2678
#define SFXsfx0A77 2679
#define SFXsfx0A78 2680

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup000C 12
#define SFXflk_b_flicker_00 336
#define SFXflk_b_talk_00 337
#define SFXflk_b_talk_01 338
@ -21,5 +19,3 @@
#define SFXsfx0159 345
#define SFXsfx015A 346
#define SFXsfx015B 347

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup000D 13
#define SFXsfx015C 348
#define SFXfpr_a_chaff_00 349
#define SFXsfx015E 350
@ -68,5 +66,3 @@
#define SFXsfx0194 404
#define SFXsfx0195 405
#define SFXsfx0196 406

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0026 38
#define SFXfnt_transfore_00L 1090
#define SFXfnt_advance_R 1091
#define SFXsfx0444 1092
@ -47,5 +45,3 @@
#define SFXsfx0465 1125
#define SFXsfx0466 1126
#define SFXsfx0467 1127

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup000E 14
#define SFXgab_r_hitlight_01 407
#define SFXga2_b_digexplod_00 408
#define SFXga2_b_digscream_00 409
@ -61,5 +59,3 @@
#define SFXsfx01C8 456
#define SFXsfx01C9 457
#define SFXsfx01CA 458

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup000F 15
#define SFXsfx01CB 459
#define SFXsfx01CC 460
#define SFXsfx01CD 461
@ -16,5 +14,3 @@
#define SFXsfx01CF 463
#define SFXsfx01D0 464
#define SFXsfx01D1 465

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0010 16
#define SFXgrz_b_idle_00 466
#define SFXsfx01D3 467
#define SFXsfx01D4 468
@ -21,5 +19,3 @@
#define SFXsfx01DB 475
#define SFXsfx01DC 476
#define SFXsfx01DD 477

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0043 67
#define SFXsfx0C31 3121
#define SFXsfx0C32 3122
#define SFXsfx0C33 3123
@ -29,5 +27,3 @@
#define SFXsfx0C42 3138
#define SFXsfx0C43 3139
#define SFXsfx0C44 3140

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup002D 45
#define SFXice_x_gateopen_lp_00 1922
#define SFXice_x_gatestop_00 1923
#define SFXsfx0784 1924
@ -129,5 +127,3 @@
#define SFXsfx07F7 2039
#define SFXsfx07F8 2040
#define SFXsfx07F9 2041

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0011 17
#define SFXsfx01DE 478
#define SFXsfx01DF 479
#define SFXspr_b_exhale_00 480
@ -39,5 +37,3 @@
#define SFXsfx01F9 505
#define SFXsfx01FA 506
#define SFXsfx01FB 507

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0000 0
#define SFXsfx0000 0
#define SFXsfx0001 1
#define SFXsfx0002 2
@ -51,5 +49,3 @@
#define SFXsfx0027 39
#define SFXsfx0028 40
#define SFXsfx0029 41

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup002E 46
#define SFXsfx07FA 2042
#define SFXsfx07FB 2043
#define SFXsfx07FC 2044
@ -148,5 +146,3 @@
#define SFXsfx0882 2178
#define SFXsfx0883 2179
#define SFXsfx0884 2180

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0012 18
#define SFXjzp_a_shock_00 508
#define SFXjzp_a_suck_lp_00 509
#define SFXjzp_b_bubbles_00 510
@ -19,5 +17,3 @@
#define SFXsfx0203 515
#define SFXsfx0204 516
#define SFXsfx0205 517

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup002F 47
#define SFXsfx0885 2181
#define SFXsfx0886 2182
#define SFXlav_wlklava_00 2183
@ -112,5 +110,3 @@
#define SFXsfx08E9 2281
#define SFXsfx08EA 2282
#define SFXsfx08EB 2283

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0013 19
#define SFXmag_b_alert_00 518
#define SFXmag_b_idle_00 519
#define SFXsfx0208 520
@ -39,5 +37,3 @@
#define SFXsfx0221 545
#define SFXsfx0222 546
#define SFXsfx0223 547

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0014 20
#define SFXmtr_a_scream_00 548
#define SFXsfx0225 549
#define SFXmtr_b_spin_lp_06 550
@ -20,5 +18,3 @@
#define SFXsfx022C 556
#define SFXsfx022D 557
#define SFXsfx022E 558

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0015 21
#define SFXsfx022F 559
#define SFXsfx0230 560
#define SFXmtd_a_facehug_02 561
@ -74,5 +72,3 @@
#define SFXsfx026D 621
#define SFXsfx026E 622
#define SFXsfx026F 623

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup003A 58
#define SFXmtb_b_voxtaunt_00 2891
#define SFXsfx0B4C 2892
#define SFXmtb_a_claw_00 2893
@ -90,5 +88,3 @@
#define SFXmtb_a_nrgfire_lp_00 2969
#define SFXsfx0B9A 2970
#define SFXsfx0B9B 2971

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0030 48
#define SFXsfx08EC 2284
#define SFXsfx08ED 2285
#define SFXsfx08EE 2286
@ -90,5 +88,3 @@
#define SFXsfx093A 2362
#define SFXsfx093B 2363
#define SFXsfx093C 2364

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPmisc 39
#define SFXdor_x_close_00 1128
#define SFXdor_x_open_00 1129
#define SFXsfx046A 1130
@ -256,5 +254,3 @@
#define SFXsfx055C 1372
#define SFXsfx055D 1373
#define SFXsfx055E 1374

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPmiscSamus 41
#define SFXsam_wlkstone_00 1465
#define SFXsam_wlkstone_01 1466
#define SFXsam_suit_damage 1467
@ -268,5 +266,3 @@
#define SFXsfx06B9 1721
#define SFXsfx06BA 1722
#define SFXsfx06BB 1723

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0039 57
#define SFXsfx0B0F 2831
#define SFXsfx0B10 2832
#define SFXopr_b_voxcall_00 2833
@ -69,5 +67,3 @@
#define SFXsfx0B48 2888
#define SFXsfx0B49 2889
#define SFXsfx0B4A 2890

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0033 51
#define SFXsfx09E0 2528
#define SFXsfx09E1 2529
#define SFXsfx09E2 2530
@ -81,5 +79,3 @@
#define SFXsfx0A25 2597
#define SFXsfx0A26 2598
#define SFXsfx0A27 2599

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0016 22
#define SFXpar_a_voxangry_00 624
#define SFXsfx0271 625
#define SFXsfx0272 626
@ -33,5 +31,3 @@
#define SFXsfx0285 645
#define SFXsfx0286 646
#define SFXsfx0287 647

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0042 66
#define SFXphz_damage_lp 3114
#define SFXsfx0C2B 3115
#define SFXsfx0C2C 3116
@ -16,5 +14,3 @@
#define SFXsfx0C2E 3118
#define SFXsfx0C2F 3119
#define SFXsfx0C30 3120

View File

@ -5,11 +5,7 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0044 68
#define SFXphg_charge_lp 3141
#define SFXsfx0C46 3142

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0017 23
#define SFXsfx0288 648
#define SFXpds_a_voxactive_00 649
#define SFXpds_b_bubbles_00 650
@ -36,5 +34,3 @@
#define SFXsfx02A0 672
#define SFXsfx02A1 673
#define SFXsfx02A2 674

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0018 24
#define SFXpud_a_suckin_00 675
#define SFXpud_a_spitout_00 676
#define SFXsfx02A5 677
@ -38,5 +36,3 @@
#define SFXsfx02BD 701
#define SFXsfx02BE 702
#define SFXsfx02BF 703

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0019 25
#define SFXpuf_b_fly_lp_00 704
#define SFXsfx02C1 705
#define SFXsfx02C2 706
@ -16,5 +14,3 @@
#define SFXsfx02C4 708
#define SFXsfx02C5 709
#define SFXsfx02C6 710

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0031 49
#define SFXdor_x_close_01 2365
#define SFXdor_x_open_01 2366
#define SFXsfx093F 2367
@ -22,5 +20,3 @@
#define SFXsfx0947 2375
#define SFXsfx0948 2376
#define SFXsfx0949 2377

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0038 56
#define SFXrid_a_flamerake_00 2771
#define SFXrid_a_flame_lp_00 2772
#define SFXsfx0AD5 2773
@ -69,5 +67,3 @@
#define SFXsfx0B0C 2828
#define SFXsfx0B0D 2829
#define SFXsfx0B0E 2830

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup001A 26
#define SFXrip_b_float_lp_00 711
#define SFXrip_b_scream_00 712
#define SFXsfx02C9 713
@ -19,5 +17,3 @@
#define SFXsfx02CE 718
#define SFXsfx02CF 719
#define SFXsfx02D0 720

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup0032 50
#define SFXsfx094A 2378
#define SFXsfx094B 2379
#define SFXsfx094C 2380
@ -159,5 +157,3 @@
#define SFXsfx09DD 2525
#define SFXsfx09DE 2526
#define SFXsfx09DF 2527

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup002A 42
#define SFXsas_x_dooropen_00 1724
#define SFXsas_x_dooropen_01 1725
#define SFXsas_x_dooropen_02 1726
@ -41,5 +39,3 @@
#define SFXsfx06D9 1753
#define SFXsfx06DA 1754
#define SFXsfx06DB 1755

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup001B 27
#define SFXsfx02D1 721
#define SFXsfx02D2 722
#define SFXsfx02D3 723
@ -17,5 +15,3 @@
#define SFXsfx02D6 726
#define SFXsfx02D7 727
#define SFXsfx02D8 728

View File

@ -5,10 +5,8 @@
* Date: Sat Sep 1 12:32:04 2018
*/
#define GRPgroup001C 28
#define SFXsed_a_spine_00 729
#define SFXsed_b_idle_lp_00 730
#define SFXsfx02DB 731
@ -29,5 +27,3 @@
#define SFXsfx02EA 746
#define SFXsfx02EB 747
#define SFXsfx02EC 748

Some files were not shown because too many files have changed in this diff Show More