SMF - 3D skeletal animation

RetroBatter

Member
I'm trying to save an smf model through smf_model_save, but the function shows an error if I try to save a model that doesn't have a rig:
GML:
Variable <unknown_object>.nodeList(100251, -2147483648) not set before reading it.
 at gml_Script_smf_model_save (line 946) -        nodeList = rig.nodeList;
 

TheSnidr

Heavy metal viking dentist
GMC Elder
When you go to load a smf file sometimes it crashes in the model editor. Something to do with the rig itself. I tried the axe and it crashed.

as a request, can you make a 7th demo for collisions with the hammer/axe, it would really help out with game generation.
and Can you bring that Zelda demo back but in the way the dwarf is? Not saying the camera follows but in the way the movement is now. Plus I would like a controller support for your demos. My XBox Contoller works on it using
var hInput = gamepad_axis_value(0, 0.5 < gp_axislh < -0.5)
on the 4th Demo for movement but its always diagonal. At least it works. :)
I'm trying to save an smf model through smf_model_save, but the function shows an error if I try to save a model that doesn't have a rig:
GML:
Variable <unknown_object>.nodeList(100251, -2147483648) not set before reading it.
at gml_Script_smf_model_save (line 946) -        nodeList = rig.nodeList;
Thank you so much for these error reports! I've fixed them both:
I'm going to play around with controllers, gonna see what I can do! Finally got myself an actual controller, been a keyboard-mouse guy until now.
I won't bring back the Zelda demo, I'd prefer to only use assets that are either free, or that I've made myself!
Besides, the Zelda demo used the ColMesh scripts that were previously included in the SMF system, but have been taken out and made into their own system. A big update to the ColMesh system is coming relatively soon!

Hello!
I got v095 somewhat running on GMS14
- couldn't get buffer->surface transfer to work [smf_model_load.gml], I think it's busted in 14 (v1.4.9999 Steam), so I'm getting textures from .png
- outline shader is glitchy [sh_smf_vertex_outline.shader]
- character control is wonky in Demo 6
- I don't know math for transformation matrices so I just punched in some constants for Demo 6 shadowmap [smf_shadowmap_create.gml, smf_shadowmap_set_view.gml]
Would be great if somebody could fix it up or port a newer version
Original v095 GMS2 source https://forum.yoyogames.com/index.php?threads/smf-3d-skeletal-animation.19806/post-279300
Thanks in advance if somebody does that and either way thanks so much TheSnidr for this!
Whoa, you ported the whole thing? :O That's dedication!
 
what I meant was not use the Zelda character but use some other toon like your dwarf instead.
Oh this is a random comment you might find funny: AVG the Antivirus keeps tagging your program for being a malicious program, but every time it goes to AVG it gets flagged "not a threat" from the staff on the other end. I think the staff is sick of it by now. :)
 
Last edited:

RetroBatter

Member
How would I use the collision scripts on a .smf model? I know how to do it with an .obj model, but I'm confused on adding a colmesh to an smf model.
 
Whoa, you ported the whole thing? :O That's dedication!
Thanks! To be honest I used a conversion program and then just had to change some things to get it running

I've got outline shader working now and added some functions for shadow maps so they kinda almost work.
I can make them work with a hack.
Also found a hack that makes collisions not glitch on movement. Somersault on Jump3 still bugs out but that's the only thing as far as I can tell.
So there are 3 hacks now (yeah, so almost Bethesda or CDPR territory): in [zeldaclone_init] and [oDemo6Player.Step] and texture loading from sprites in [smf_model_load]
This is as far as I go probably. I don't know anything about 3d models or shaders and I'm pretty happy with how it is now. Still would be great if somebody could properly fix those things.
SMFv95.jpg
 
Last edited:

Yal

🐧 *penguin noises*
GMC Elder
Two minor issues with the latest version:

  • The debug text in the bottom-left corner overlaps some of the buttons, I don't think that's intentional. (I can't really tell if it's debug text that never was intended for mortal end-users' eyes or a part of the interface, it's too informative :p)
    1611644975936.png
  • The "lock node" button is apparently great if you want a node to stay ion place, according to the tooltip.

...aaaaaaaaand also a big one: trying to load a rig from an existing model crashes because of a function being renamed or out of scope? (I did this with a completely unrigged model).

___________________________________________
############################################################################################
ERROR in
action number 1
of Step Event0
for object oAnimEditSystem:

Variable <unknown_object>.rig_create(102210, -2147483648) not set before reading it.
at gml_Script_smf_read_rig_from_buffer
############################################################################################
gml_Script_smf_read_rig_from_buffer (line -1)
gml_Script_rigeditor_press_buttons
gml_Script_press_buttons
gml_Object_oAnimEditSystem_Step_0


I was going to do a regression test with 0.9.7 since I happened to have it lying around in a dusty corner of my hard drive, but turns out the SMF rig loading was a completely new feature, so no luck with that x3 The user-friendliness of the interface has improved miles since 0.9.7, though!

Reusing animations between different models is pretty high on my wishlist, but since one could just copy the Animations / SampleStrips / AnimationMap in-game after loading a model I suppose there's no need to support this in the modelling tool.
 
Last edited:

TheSnidr

Heavy metal viking dentist
GMC Elder
Thank you for the bug report! I will fix it as soon as I am able! :D

EDIT:
Here's a hotfix, importing a rig from a different SMF model should work now:
 
Last edited:
  • Like
Reactions: Yal

Yal

🐧 *penguin noises*
GMC Elder
Please tell me how to make a character transparent. Alpha = 0.5. Thanks
If you just set alpha to 0.5 before drawing a 3D model, you will see triangles on the other side of the character (or worse, things that are behind the character get culled out because of depth testing even though you should see them). I think the easiest way is to
  1. set projection/shader etc
  2. change the drawing target to a screen-sized surface
  3. draw the character model
  4. set drawing mode to "only affect alpha channel, subtract"
  5. draw the environment (so you remove anything that's in front of the character since we erase now)
  6. reset the drawing target
  7. draw the surface to the screen on the GUI layer later, with draw_surface_ext so you can set alpaca to 0.5
3D and transparency doesn't mix well, a lot of games use dithered textures these days
 

haisupham

Member
If you just set alpha to 0.5 before drawing a 3D model, you will see triangles on the other side of the character (or worse, things that are behind the character get culled out because of depth testing even though you should see them). I think the easiest way is to
  1. set projection/shader etc
  2. change the drawing target to a screen-sized surface
  3. draw the character model
  4. set drawing mode to "only affect alpha channel, subtract"
  5. draw the environment (so you remove anything that's in front of the character since we erase now)
  6. reset the drawing target
  7. draw the surface to the screen on the GUI layer later, with draw_surface_ext so you can set alpaca to 0.5
3D and transparency doesn't mix well, a lot of games use dithered textures these days
Thanks for answering.
If there is more detail, it would be good
 
Top