Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model being a mess of colors/triangles #14

Open
xhixzi opened this issue Jun 19, 2024 · 9 comments
Open

Model being a mess of colors/triangles #14

xhixzi opened this issue Jun 19, 2024 · 9 comments

Comments

@xhixzi
Copy link

xhixzi commented Jun 19, 2024

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
Copy link
Owner

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

@xhixzi
Copy link
Author

xhixzi commented Jun 20, 2024

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
Copy link
Author

xhixzi commented Jun 20, 2024

@Grisgram
Copy link

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
Copy link
Author

xhixzi commented Jun 21, 2024

@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
Copy link
Owner

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
Copy link
Author

xhixzi commented Jun 22, 2024

@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
Copy link

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
Copy link
Author

xhixzi commented Jun 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants