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.

Author
Message
Silence
13
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 20th Feb 2013 17:05
Everytime I export a model from a program it never comes with the color I put on it. They arent textures, I just put color from the program itself onto each individual part. Is there any way to export the models with the colors?
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Feb 2013 17:10 Edited at: 20th Feb 2013 17:11
I'm not entirely sure how colours are saved to an object.

If they are saved as vertex diffuse colours, then it could be a problem with the FVF. Can you run this and tell me what number it prints?



What program are you using and what format are you exporting to?

TheComet

http://blankflankstudios.tumblr.com/
"You're all wrong. You're all idiots." - Fluffy Rabbit
"Bottom line, people are retarded." - Fluffy Rabbit
Silence
13
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 20th Feb 2013 17:38
I am using Blender and I am using the".x" format to make it run but it never comes with the color. As for the code you sent me it flashes rapidly and prints 274.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Feb 2013 17:46 Edited at: 20th Feb 2013 17:51
I think this might be worth a shot: http://forum.unity3d.com/threads/37632-Blender-Vertex-Color-Alpha-Export

It seems like Blender won't export colour by default, so you actually have to "hack" the export script a little to make it work for you (explained in the link).

The export scripts are located somewhere in blender's installation directory.

Can you run the code I posted again after modifying the export script? I'd be interested in knowing if the FVF changes or not. In order to fix the flashing, just add the line sync on at the start.

The FVF means "Frikkin' Vertex Format", or like the higher programmers like to call it, "Flexible Vertex Format". Very basically, it tells DX how your model data is structured so it knows how to render it to the screen properly. You can calculate it by adding these numbers together:



274 is DBP's standard format and excludes diffuse colouring. If you were to add FVF_DIFFUSE, then you'd get 338.

http://forum.thegamecreators.com/?m=forum_view&t=191434&b=1

The reason I'm explaining this is because I believe that colouring the model requires you to use FVF 338. I could be completely wrong though, and could have misunderstood the way faces of objects are coloured.

TheComet

http://blankflankstudios.tumblr.com/
"You're all wrong. You're all idiots." - Fluffy Rabbit
"Bottom line, people are retarded." - Fluffy Rabbit
29 games
20
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 20th Feb 2013 18:37
Hi, Silence, I had a quick look at this as I have coloured objects in 3D modelling programs before and it seems to have worked alright but I've never done it with blender so I thought I'd have a look.

It seems that TheComet is right in the that if you just colour the object (in the object button of the properties panel) then the color doesn't export (in fact I couldn't get it to show up in blender).

I know that DBPro primative (i.e. MAKE OBJECT CUBE etc) do not have any diffuse data, as TheComet mentioned, but this set me thinking about just colouring the object using the diffuse colours that make up part of the object's material.

I've attached the blender and .x model I used. It's just 3 cubes one coloured red, one coloured blue and one coloured green. If you open up the blender file, you'll see that each cube has it's own material where the diffuse color has been changed.

If you load the model into DBPro, you should see three cubes, red, green and blue.

I don't know much more about it other than this, in fact I've only looked at this when I read this post, so I don't know all the ins and outs but I hope you find this useful.

Oh, and I've used Blender 2.59.

one of these days I'll come up with a better signature
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Feb 2013 18:47
It's odd though, because the command color object works fine on models with FVF 274... It makes me think that the colour is being saved somewhere else, and I suspect exported models use exactly this.

TheComet

http://blankflankstudios.tumblr.com/
"You're all wrong. You're all idiots." - Fluffy Rabbit
"Bottom line, people are retarded." - Fluffy Rabbit
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 20th Feb 2013 18:53 Edited at: 20th Feb 2013 18:58
I had a similar problem with my textures not showing up after exporting to .X format from Blender.
Here's how I solved it:

(1) Load your model into Blender and apply your colors/textures.

(2) In EDIT MODE, select all vertices with "A" and then hit "U" and select "SMART UV PROJECT" and then hit OK.

(3) If using textures, make sure your textures are in the same folder as your model.

Now when you export to .X, your model should (hopefully) be intact.
I don't know if this works with all models, but I have had a lot of success with this technique.

D.D.
Silence
13
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 20th Feb 2013 20:48 Edited at: 20th Feb 2013 20:51
Thank you all very much for you time and consideration. I will be trying each and every one of your suggestions. I do have a question though Coment. What am I changing with those two lines of code? Forgive my small knowledge on this subject, but am I going to use those two lines to change when it exports as an "x" file?
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Feb 2013 20:56
Quote: "I do have a question though Coment. What am I changing with those two lines of code? Forgive my small knowledge on this subject, but am I going to use those two lines to change when it exports as an "x" file?"


Scratch what I said, I had a more closer look at the script and it's not what you want.

TheComet

http://blankflankstudios.tumblr.com/
"You're all wrong. You're all idiots." - Fluffy Rabbit
"Bottom line, people are retarded." - Fluffy Rabbit
Silence
13
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 20th Feb 2013 21:12
Derek Darkly I should bow to you. It worked!
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 20th Feb 2013 23:21
Awesome!
I'll settle for a high-five.

I'm glad it worked...
Seems like it's always the little things that hold up otherwise good progress.

D.D.
Nytus Sermus
13
Years of Service
User Offline
Joined: 17th Jan 2013
Location:
Posted: 21st Feb 2013 00:04
Im glad you've found a work around, however, im working on a full blown game-dev system based on DarkBasicPro, and i have an entity editor i created that can modify any aspect of a game models, its almost 100% DBpro code and therefore doesnt require extra plugins to do what you want, Why cant you just use the COLOR OBJECT COMMAND and then export your model from DBpro???

You could be done already.....stop trying to re-invent the wheel.
Silence
13
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 21st Feb 2013 04:54
I have no idea what you just said D:
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Feb 2013 10:28
Quote: "Why cant you just use the COLOR OBJECT COMMAND and then export your model from DBpro???"


Because he's colouring faces of an object, not entire objects.

TheComet

http://blankflankstudios.tumblr.com/
"You're all wrong. You're all idiots." - Fluffy Rabbit
"Bottom line, people are retarded." - Fluffy Rabbit

Login to post a reply

Server time is: 2026-07-07 16:42:42
Your offset time is: 2026-07-07 16:42:42