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.

DarkBASIC Professional Discussion / .X file export code

Author
Message
griffirr
22
Years of Service
User Offline
Joined: 27th Apr 2004
Location:
Posted: 23rd Aug 2011 14:31
I noticed a lot of people are looking for code to export an object to a .X file. Here is some code to do the trick. Ezrotate and Styx is required. Styx is only needed to strip the filename from the path. I'm sure there is other ways to do this. Please notice that it only does only one texture stage (you choose) and does not include animations. Please post any updates you make to this code so that we can all make it better. Also note that any object/limb without a texture will not be included. The global variable g_OutputFolder$ must be set to an existing folder that you want the file created in. All textures in the object will be copyied to this folder as well. Sorry if the comments are lacking but this code has worked well for me for some time. Fuctions getFreeObject and getFreeMesh are included but matrix plugins will work fine with some changes. Please post to let me know if I have forgotten something or if you have any questions.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Aug 2011 21:48
Wow, handy function!

Haven't tried it yet but nice

griffirr
22
Years of Service
User Offline
Joined: 27th Apr 2004
Location:
Posted: 25th Aug 2011 17:26
Thanks baxslash. I hope people find it usefull it. Unlike the save mesh function it keeps the limb structure intact.
Mugen Wizardry
User Banned
Posted: 25th Aug 2011 17:31
Is there a way to save more than one texture to a model?

Thanks, griffirr!

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 25th Aug 2011 20:58
bump

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 25th Aug 2011 22:52
You bumped 3 hours later. Give people time to respond.

griffirr
22
Years of Service
User Offline
Joined: 27th Apr 2004
Location:
Posted: 26th Aug 2011 13:58 Edited at: 26th Aug 2011 14:02
Thanks Indicium, Some people are just to busy to sit and watch the forums.

Mugen Wizardry, As baxslash showed in the other thread .X only supports one texture per limb. That is why the code above allows you to set the stage you want exported. If you look at the .X exports of cartshop or 3D world studio you export two models, one of each texture stage, and then ghost one over the other. My perferred method is to load the two objects and copy the uv data of one to the other. First you have to set the FVF so that there is two texture layers in the object you are copying to and then use the vetrex data uv commands to copy over the uv data and then apply the texture to the object. I almost always use shaders as the blend commands in dbpro can be a bit confusing. This works with up to the eight texture layers that dbpro supports.

Hope this helps.

Login to post a reply

Server time is: 2026-07-10 12:02:05
Your offset time is: 2026-07-10 12:02:05