Sandman13sq / DmrVBM-blender-to-gms2

Vertex Buffers from Blender to Game Maker Studio 2
25 stars 0 forks source link

Model being a mess of colors/triangles #14

Open xhixzi opened 1 month ago

xhixzi commented 1 month ago

Hello, I'm trying to import a model of an arcade cabinet into GameMaker. On the left is how it appears in Blender, and on the right is in GameMaker and something is clearly wrong with it. The model being upside down is an easy fix, but what's going on with the mess of triangles/colors here?! I assume it has something to do with me not exporting the .vb file correctly? I've been trying for hours to figure it out but I don't know what's going on, please help

Untitled

Sandman13sq commented 1 month ago

What is the format of the vertex buffer you're using (Blender and gms)?

xhixzi commented 1 month ago

In Gamemaker this is the format being defined in the create event

image

image

In blender for the format I tried exporting it changing around the number of floats for position and colorbytes but I get this runtime error (not sure why) image

xhixzi commented 1 month ago

Here are the files: https://drive.google.com/file/d/1ytsflteKj3WsgdImdkGoPwkTltWHmFhA/view?usp=sharing

Grisgram commented 1 month ago

Try the latest .zip file from the code view of the repo (DmrVBM_Blender.zip) https://github.com/Sandman13sq/DmrVBM-blender-to-gms2

In #13 i received similar errors and sandman fixed the blender export like 20hrs ago. try to export again with the new version

xhixzi commented 1 month ago

@Grisgram Thanks for the reply. I just redownloaded the latest version, and I read your thread and tried applying what @Sandman13sq said to do for the export, but am still getting the mess of colorful triangles. This has gotta be me screwing something up on my end...

Here are the specific settings I did when I exported:

I select my mesh, add a color attribute (Domain: Face Corner, Data Type: Byte Color), and go back to Scene where I have a format with Position, Color Bytes (RGBA), and UVs. (The format is: POSITION3 COLORBYTES4@"Color" UV2@"UVMap"). Then I export as a .vb file.

Yet I'm still getting the colorful triangle mess... what specific setting am I missing/ what am I messing up? Help!!!

Sandman13sq commented 4 weeks ago

Make sure the format you create in GMS matches the content and order of the one you have in Blender. Your format has more entries than necessary. arcadehelp

xhixzi commented 4 weeks ago

@Sandman13sq That fixed the problem, thank you so much!

One more question though — as seen here the model is coming out as one whole color (or one whole texture if I use "sprite_get_texture(sprite,0)" in vertex_submit).

image

How would I make each part of the exported mesh different colors? So for example in the original image for the model I sent, the body of the arcade cabinet would be purple, the screen would be black, the buttons are yellow, joystick would be red, etc.

Is it something to do with adding color attributes? But then how would I apply said color attributes to only a specific part of the mesh? Just need to know how to accomplish this and I should be good to go.

Grisgram commented 4 weeks ago

as far as i can tell, you will get a unique-colored model in gamemaker unless you use textures and uv mappings. maybe i am wrong, but that's what i can see in the tutorial project

xhixzi commented 4 weeks ago

Grisgram Yeah that seems like the case. Luckily you can export as a collection so that you can still add different color attributes to the model as a whole, just not the specific parts within a combined mesh (I don't think atleast). That's not too important though. That being said, this add-on is awesome and thank you Sandman13sq !!!! LIKE SERIOUSLY THIS IS THE BEST PLUG IN EVER SO MUCH THANK YOUU!!!! You deserve an award