Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit/AppGameKit Studio Showcase / Kenney Konverter - Convert and cleanup Kenny (and other .obj) models for use with AGK

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 6th Dec 2018 23:17 Edited at: 6th Dec 2018 23:18
AGK doesn't load kenney model color values unfortunately. Also Kenney models re notoriously messy.
This app will take kenney models (Only .obj files). Optionally remove duplicate faces. Then generate a new model that uses a texture for the colours.



Attached is the App.
It uses MadBit's super useful FIleExplorer plugin
If it doesn't work out of the box you can install FileExplorer separately here (Download from first post)
How to install a plugin here

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 7th Dec 2018 05:52 Edited at: 7th Dec 2018 05:54
a little confused, blink. what do i select as the output file? i tried to simply select a folder. it began processing multiple files and then errored out:

otherwise, looking forward to using this! kenney has put out tons of media that i'd like to use.

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 7th Dec 2018 12:20 Edited at: 7th Dec 2018 12:20
Ok. The FIle Explorer plugin is a little touchy. When you select the output directory just enter "x" in the filename

i'll add some checking on that
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 8th Dec 2018 06:36 Edited at: 8th Dec 2018 06:36
Updated. Now checks to make sure you select a file. If you can't see any files just enter "x" in the filename
Note that it will attempt to convert any .obj files in the directory where the file was selected
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 8th Dec 2018 17:02 Edited at: 8th Dec 2018 17:04
Very nice !
But I get this:

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 8th Dec 2018 20:19
A nice little project
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 9th Dec 2018 04:56
Thanks Puzzle dude!

Janbo@ Could you post the model? It looks like a face entry is pointing to a vertex index of zero. I might have to change the app to accommodate it
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 9th Dec 2018 09:19
I tried every model from the Character pack
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 9th Dec 2018 18:48
This looks promising, I have all the Kenny packs and would love to use the 3D stuff in AppGameKit, I also have lots of other .obj/.mtl media that currently is completely useless to me! lol

@ blinkok, is it possible to turn this into a "browse directory/batch convert tool" like a typical image converter or file renamer app..... I'd pay for that
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 9th Dec 2018 19:05 Edited at: 9th Dec 2018 19:05
Quote: "is it possible to turn this into a "browse directory/batch convert tool" like a typical image converter "

It's is a batch converter right now. You select a file because the FIleExplorer wont let you select a folder. I'll make it do individual files as well maybe
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 9th Dec 2018 19:34
Quote: "But I get this"


Fixed and updated in the first post.

@janbo : Have you tried converting the race tack set you were looking at all those years ago?
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 9th Dec 2018 20:14
Quote: "It's is a batch converter right now"


DoH! OK, lol

I was sure I posted a File Explorer plugin that had a folder browser and font / color picker I was going to suggest using it instead but I can not find it, not even on my PC.... maybe one of those "I'll write that one day" but never did lol ....

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 9th Dec 2018 20:25
Quote: "I was sure I posted a File Explorer plugin that had a folder browser and font / color picker I was going to suggest using it instead but I can not find it, not even on my PC"

Bugga! I've asked MadBit to have a look at it. I know he's super busy but hopefully he can sort it
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 10th Dec 2018 21:21
Converting works now.
How about the UV data they seem screwed

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Dec 2018 21:29
The idea is that it will convert the models so as to create a texture map of solid colours so you can load it into AGK.
If you want to preserve the UV's then just use the original model.
Is there something else you wanted to achieve by converting this? If you can explain to me what you want i'll do my best to accommodate it
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 11th Dec 2018 15:47 Edited at: 11th Dec 2018 15:48
Haha I just didn't thought about what to achieve with it
Nevertheless, removing redundant faces is useful for every model.
How about adding color attributes to the vertices directly !? ... Sorry I keep saying that but I think I have done that already, in the Mesh-manipulation lib of my shader pack
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2018 19:28 Edited at: 11th Dec 2018 19:29
Quote: "How about adding color attributes to the vertices directly "

Yes that's the idea. It creates a palette image and maps the faces to each color. That's why it screwed up the texture of the character model.
So in this case it's created one palette for all the models in the furniture collection so all models share one palette image.


I think i will make the color processing an option though. For people who just want to get rid of the duplicate faces

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2018 19:52
Oh cool. How is that?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2018 20:12
Can you post the model so i can see?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2018 20:42 Edited at: 11th Dec 2018 20:52
I must be doing something wrong. it just appears as a grey box for me

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2018 20:52
Yes. That is the problem. AppGameKit doesn't load the colours. That is why the converter creates a texture
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 11th Dec 2018 21:10 Edited at: 11th Dec 2018 21:14
That's what I meant.
AGK does't load it from the file but you can create the vertex attribute and use SetMeshMemblockVertexColor to set the vertex color manually.
I don't use the vertex Color part anywhere... but it is there... for you to discover
The only bit that needs to be done is to parse the file for the color data or check the texture color at the vertex position.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2018 21:15
Quote: "Maybe blink0k want to parse all file formats"

No. Just .obj for now

I will have a play around with the vertex color thing though. Thanks for the tip
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 11th Dec 2018 21:23 Edited at: 11th Dec 2018 21:25
Ah I remember what the problem was.
Kenneys models share vertex data, so they would interpolate between colors, but they need hard edges for this kind of style to work with vertex colors.
Well I also have a hardedge attribute flag in my lib but that would create more vertices, so I think the texture atlas method is the best you can do until we get a proper material system.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2018 22:37
So it appears that SetMeshMemblockVertexColor() only works if the mesh has a colour attribute which it doesn't. So i have to re-create the entire memblock.
My head hurts.
I'm going to have a cuppa
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 12th Dec 2018 07:59
Right !
All done in the library
But if you want to do it yourself I can help you ofc
Anyway I think the atlas method is pretty good for kenneys modells
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Green7
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: Switzerland
Posted: 12th Dec 2018 10:29
Agk does in fact load vertex colors, as tested some time ago : https://forum.thegamecreators.com/thread/222817?page=2#msg2629681
But i do not know how kenneys models are built... as janbo stated
Quote: "Kenneys models share vertex data"
this might be the problem.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 12th Dec 2018 11:05
I will investigate. Thanks Green dude
puzzler2018
User Banned
Posted: 25th Dec 2018 15:46
Hi

Im beginnning to think Kenny models are extremely odd too

Example of one of the OBJ VT data


Whats that about - UVs only go from 0.0 to 1.0

My mind boggles!!!!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 25th Dec 2018 21:39
I think they are exponential values. To the power of
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 23rd Jan 2019 05:36
Apart from not all models working, I think its a great little program and works well on kenney models like its supposed to
fubar
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 23rd Jan 2019 07:05
Thanks fubes. If you have a model that's not converting correctly just let me know and i'll have a look at it.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Jul 2020 03:27 Edited at: 10th Jul 2020 03:27
Updated (in the first post) to read the material file from the mtllib entry in the .obj file
Works with models from this website and any models that may share a common material file
Xaby
FPSC Reloaded TGC Backer
16
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 11th Jul 2020 14:44
that is really cool
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 11th Jul 2020 17:02
I will have to check this out at some point. I am familiar with the Kenney graphic sets.

Your utility looks extremely well done from what I can see here. Awesome Blink!

Login to post a reply

Server time is: 2024-03-28 19:19:39
Your offset time is: 2024-03-28 19:19:39