Switch to collada

This commit is contained in:
zontreck 2024-08-03 06:19:15 -07:00
parent 95ba2d6565
commit 22b26f85d2

View file

@ -6,24 +6,24 @@ set(TEMP_EGGS ${CMAKE_BINARY_DIR}/temp/bossbotHQ/eggs)
# Create TEMP_EGGS directory # Create TEMP_EGGS directory
file(MAKE_DIRECTORY ${TEMP_EGGS}) file(MAKE_DIRECTORY ${TEMP_EGGS})
# Find all .fbx files in the cwd directory # Find all .dae files in the cwd directory
file(GLOB FBX_FILES "${cwd}/*.fbx") file(GLOB DAE_FILES "${cwd}/*.dae")
# Iterate over each .fbx file and convert to .egg # Iterate over each .dae file and convert to .egg
foreach(fbx_file ${FBX_FILES}) foreach(dae_file ${DAE_FILES})
get_filename_component(filename ${fbx_file} NAME_WE) get_filename_component(filename ${dae_file} NAME_WE)
set(egg_file "${TEMP_EGGS}/${filename}.egg") set(egg_file "${TEMP_EGGS}/${filename}.egg")
# Command to convert .fbx to .egg # Command to convert .dae to .egg
add_custom_command( add_custom_command(
OUTPUT ${egg_file} OUTPUT ${egg_file}
COMMAND fbx2egg ${fbx_file} ${egg_file} COMMAND dae2egg ${dae_file} -o ${egg_file}
DEPENDS ${fbx_file} DEPENDS ${dae_file}
COMMENT "Converting ${fbx_file} to ${egg_file}" COMMENT "Converting ${dae_file} to ${egg_file}"
) )
# Add the egg file to a custom target # Add the egg file to a custom target
add_custom_target(cvfbx2egg_${filename} ALL DEPENDS ${egg_file}) add_custom_target(cvobj2egg_${filename} ALL DEPENDS ${egg_file})
endforeach() endforeach()
# Add a custom target to ensure all conversions are done # Add a custom target to ensure all conversions are done