Go Back   AC3D Forums > General > AC3D General
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 27th January 2005, 05:52 PM   #1
dre99gsx
Junior Member
Advanced member
 
Join Date: Sep 2004
Posts: 27
Default Export to .x with texture STRIPS all materials

Wondering if there is a work around for this? I am exporting a .ac file to Direct X .x file with a texture and multiple materials. If I remove the texture, the .x file shows all 9 or so materials as Material_Mat 1 through 9. If I put the texture file back in, I only get one material, andn the rest are "lost".

Any work around for this?
dre99gsx is offline   Reply With Quote
Old 27th January 2005, 07:51 PM   #2
FRAME
Member
Expert member
 
Join Date: Jun 2003
Location: Löhne, Germany
Posts: 58
Default

Yes, if an object has a texture, only the material setting of the first found surface is used.
This is not a bug. However, it is not very nice either.
And - sorry - there is no workaround for this and it is not easy to change it.

Would it be very important for you to change this ?

Frank
(Author of the DirectX plugin.)
FRAME is offline   Reply With Quote
Old 28th January 2005, 01:42 AM   #3
dre99gsx
Junior Member
Advanced member
 
Join Date: Sep 2004
Posts: 27
Default

Hey Frank, appreciate the quick reply.

Well, I'de like to use some textures, and some materials. The objects I create don't use that many materials, but I noticed when exporting, we have an option to export all materials. Could there be another option that exports materials AND texture information?

I could really use that feature if possible. If there is a workaround by editing the .x file, let me know what I can do. Thanks.
dre99gsx is offline   Reply With Quote
Old 28th January 2005, 07:05 AM   #4
FRAME
Member
Expert member
 
Join Date: Jun 2003
Location: Löhne, Germany
Posts: 58
Default

Always only the materials are stored which also are used in the saved model.
If the option 'Save Materials' is disabled, the x file does not contain ANY material information. ( The 'MeshMaterialList' structure is not created. )

Of course you can save material and texture information into the same x file.

For example :
You have an AC3D model with two objects. The first object is not textured. The second has a texture. ( Please remember, that a texture is valid for the whole object or the object has completly no texture. )
Now you can select different materials for the first object ( which has no texture ).

The x file of this model contains:
- All materials used for the first ( untextured ) object. Each surface can have its own material.
- The texture with the material setting of the first surface of the second object. This material is used only for this textured object - not for the whole model.

The question is now :
Do you need different material settings for textured surfaces in the same object ? If you need some textured surfaces with the same material and some untextured surfaces with different material settings you can simply use different objects ( of course in the same model ).

Frank

( I hope my bad English was good enough for the explanation. )
FRAME is offline   Reply With Quote
Old 28th January 2005, 09:25 AM   #5
dre99gsx
Junior Member
Advanced member
 
Join Date: Sep 2004
Posts: 27
Default

I see, interesting. So, If I have one .ac file that contains one big object that is textured, exporting to .x will only bring one material (material 1), which will have a texture associated with it.

Now, If I could somehow split the object into two objects, (half and half), and have only the first object assigned to a texture (material 1), and paint the 2nd object with material 5, then exporting to .x will bring over both materials, correct?

If thiis is true, It would work, excpet I find it hard to "unselect" smaller objects from one large object.

Would there be a way to export all the materials for the one large object, including material 1 that has a texture assigned to it? Or, is there a more effective way to handle this?
dre99gsx is offline   Reply With Quote
Old 28th January 2005, 09:54 AM   #6
Dughor
Member
Expert member
 
Join Date: Dec 2004
Location: Cologne/Germany
Posts: 62
Default

If you are in surface select mode, you can right-click on material type.
Then click "select all surfaces with that material" in the context menu.

Now you have all surfaces with that material selected.
Then you only need to ctrl-x ctrl-v to copy&paste selection.

Reslut: two objects in the same .ac file...
__________________
Richthofens Skies Dev-Team
Dughor is offline   Reply With Quote
Old 28th January 2005, 11:27 AM   #7
dre99gsx
Junior Member
Advanced member
 
Join Date: Sep 2004
Posts: 27
Default

Woah, thats a trick way of doing it, thanks. I gave it a shot, having 2 objects. One with a texture, and the other with a red color (material).

When importing it to a direct-x program I am writing, it sees the textured object, but doesn't paint the red object red, leaves it white (since I set the default material to white). I've tried 3 or 4 objects, and they all turn out white in my program. This may be something on my side, but at least we have some options at this point. Thanks again.
dre99gsx is offline   Reply With Quote
Old 28th January 2005, 11:46 AM   #8
dre99gsx
Junior Member
Advanced member
 
Join Date: Sep 2004
Posts: 27
Default

Ok, got it all to work. I made 3 objects, 3 colors, one object has a texture. It now shows up in my direct-x applet (using C#), BUT, something now changed.

I have an applet that rotates the object, with 1 light. 3 objects with 3 colors, no texture, it rotates very smooth and quick. by adding 1 texture using a small 256color .bmp, the thing rotates VERY slowly.

Any advice? I checked the .x file, and it seems very simple, is only calling the .bmp once.
dre99gsx is offline   Reply With Quote
Old 28th January 2005, 12:06 PM   #9
dre99gsx
Junior Member
Advanced member
 
Join Date: Sep 2004
Posts: 27
Default

Fixed. I was using "software processing". Switched it to "hardware processing" and it now rotates very smoothly. CPU usage dropped from 100% to 20%. Excellent.
dre99gsx is offline   Reply With Quote
Old 31st January 2005, 04:15 PM   #10
FRAME
Member
Expert member
 
Join Date: Jun 2003
Location: Löhne, Germany
Posts: 58
Default

I have changed the x file exporter.
Now, it is using the material settings of each surface for textured objects, too.

The new version ( v1.9 ) can be loaded from : www.frank-meinert.de/ac3d/directx.zip

The ZIP file contains the files 'DirectX.p' and 'DirectX.tcl' which must be copied into the AC3D plugin directory.

Very important :
Because the name of the plugin was changed as of this version, the old plugin files must be deleted manually !
( 'xdx_export.p', 'xdx_export.tcl' and 'xdx_export.opt' found in the AC3D plugin directory. )

Frank
FRAME is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 08:00 AM.


AC3D Forum
(C) Inivis Limited 2020