Work on level build process

This commit is contained in:
James Lambert 2022-04-07 21:41:58 -06:00
parent 3fff058dbb
commit c75a8bac49
5 changed files with 35 additions and 5 deletions

4
.gitignore vendored
View file

@ -6,4 +6,6 @@
build/
debugger
assets/
assets/
tools/skeletool64

View file

@ -86,6 +86,19 @@ src/models/subject.h src/models/subject_geo.inc.h: assets/fbx/Subject.fbx
src/models/sphere.h src/models/sphere_geo.inc.h: assets/fbx/Sphere.fbx
skeletool64 -s 100 -r 0,0,0 -n sphere -o src/models/sphere.h assets/fbx/Sphere.fbx
####################
## Test Chambers
####################
TEST_CHAMBERS = $(shell find assets/test_chambers -type f -name '*.blend')
build/%.fbx: %.blend
@mkdir -p $(@D)
$(BLENDER_2_9) $< --background --python tools/export_fbx.py -- $@
build/assets/test_chambers/%.h: build/assets/test_chambers/%.fbx
$(SKELATOOL64) -s 256 -n $(<:build/assets/test_chambers/%.fbx=%) -o $@ $<
####################
## Linking
####################

View file

@ -1,3 +1,11 @@
# Portal64
A demake of portal for the Nintendo 64
A demake of portal for the Nintendo 64
## How to build
First, you will need to setup [modern sdk](https://crashoveride95.github.io/n64hbrew/modernsdk/startoff.html)
Next, you will need to downlaod blender 2.9 or higher. Then set the environment variable `BLENDER_2_9` to be the absolute path where the blender executable is located on your computer.
Finally run `make` to build the project

View file

@ -24,12 +24,12 @@ struct CollisionObject gFloorObject = {
};
struct CollisionQuad gFloatingQuad = {
{-1.0f, 0.5f, -1.0f},
{-1.0f, 0.0f, 0.0f},
{1.0f, 0.0f, 0.0f},
2.0f,
{0.0f, 0.0f, 1.0f},
{0.0f, 1.0f, 0.0f},
2.0f,
{{0.0f, 1.0f, 0.0}, -0.5f},
{{0.0f, 0.0f, -1.0}, 0.0f},
0xF,
};

7
tools/export_fbx.py Normal file
View file

@ -0,0 +1,7 @@
import bpy
import sys
print("Blender export scene in FBX Format in file "+sys.argv[-1])
# Doc can be found here: https://docs.blender.org/api/current/bpy.ops.export_scene.html
bpy.ops.export_scene.fbx(filepath=sys.argv[-1])