Skip to content

Commit

Permalink
gltf_draw_scene
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfloogle committed Aug 15, 2024
1 parent 48b9d52 commit 58d17f1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
14 changes: 13 additions & 1 deletion gm82gltf.gej
Original file line number Diff line number Diff line change
Expand Up @@ -844,11 +844,23 @@
"argtypes": null,
"returntype": 2
},
{
"name": "gltf_draw_scene",
"extname": "",
"calltype": 2,
"helpline": "gltf_draw_scene(gltf,scene)",
"hidden": false,
"argtypes": [
2,
2
],
"returntype": 2
},
{
"name": "gltf_draw_node",
"extname": "",
"calltype": 2,
"helpline": "gltf_draw_node(gltf,node_id)",
"helpline": "gltf_draw_node(gltf,node)",
"hidden": false,
"argtypes": [
2,
Expand Down
13 changes: 12 additions & 1 deletion gm82gltf.gml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
///gltf_load(fn)
var __i,__j,__k,__gltf,__texfile,__accessor,__type,__usage,__stride;
__gltf=__gltf_load(argument0)
if (__gltf<0) return __gltf
// load textures
__i=0 repeat (gltf_texture_count(__gltf)) {
__texfile=string_replace(gltf_texture_type(__gltf,__i),"image/",temp_directory+"\tmp.")
Expand Down Expand Up @@ -184,8 +185,18 @@
return __ib


#define gltf_draw_scene
///gltf_draw_scene(gltf,scene)
var __i;
show_debug_message(gltf_scene_node_count(argument0,argument1))
__i=0 repeat (gltf_scene_node_count(argument0,argument1)) {
gltf_draw_node(argument0,gltf_scene_node(argument0,argument1,__i))
__i+=1
}


#define gltf_draw_node
///gltf_draw_node(gltf,node_id)
///gltf_draw_node(gltf,node)
var __i,__j,__k,__mesh_id,__cullmode,__unique_mesh_id,__unique_primitive_id,__material,__base_texture_id,__base_texture;

__mesh_id=gltf_node_mesh(argument0,argument1)
Expand Down

0 comments on commit 58d17f1

Please sign in to comment.