CompuServe Thread

#3D Studio DXF color info

5 messages in this thread
#130913From: Angela PateOct 24, 1994 12:22 PM
Hi Gary, A question (s), In the DXF output from 3D Studio (we've tried both R3 and R4) is it true that there is only color information being sent regarding layer color? No entity color is being saved? And the color information that IS being assigned to each layer is strictly incremental, i.e. the first layer is set to color 1, the second layer is set to color 2 etc. Even when ACAD.MLI is being used, the third object may be called Color05 (because it was originally blue in AutoCAD), thus the layer is named Color05, but the COLOR of this layer is still 3 (green). Is there anyway to get the colors from either the wireframe color index number, or the material ambient, diffuse, whatever, of 3D Studio objects to be saved correctly in DXF files without and IPAS routine to fix it? Are we overlooking anything? If not, we will simply describe reality, as it is now, in our docs, unless you would prefer to offer another suggestion we could offer. In NAVIGATOR we read 3DS file in fine. We know that works. But for a shareware little flyer we are putting out we wanted it to be DXF only. 3D Studio makes the best models but AutoCAD colors them better. This is for NAVFlyer, the new keypad driven real-time flyer. It runs inside AutoCAD now. Has any work been done anywhere that you know of getting a CDK app to run inside of 3DStudio? Any ideas on the subject? Thanks, Ang
#130931From: Yost GroupOct 24, 1994 1:22 PM
At this point (3 years after we wrote the DXF output code) you probably know more about how it works than I do. The basic point of our DXF output code is to produce a valid Acad-readable rats-nest-mesh. Beyond that, you're on your own. – G
#130962From: Bob ProkoppOct 24, 1994 3:46 PM
Hi Millard, If you're outputting the .DXF from 3DS by object, each object will get its own layer. No information about the materials applied to the model in 3DS will get translated. Therefore, 3DS will process the output in the order that the model was created. Even if an object is called Color05, it may be interpretted as being the third object drawn. The import to AutoCAD will put that object on a layer called Color05, but its display color will be green, the third color in the AutoCAD color system. What you are seeing is normal operation. As Gary mentioned, the .DXF export capabilities from 3DS were meant to get rat-nest-mesh data out to other programs. A .3DS/.PRJ file is the only way to get all the color data across to other programs. I would consider this a limitation to the extent of data that 3DS can export via .DXF and the amount of data that AutoCAD can import. Bob P.
#131171From: SyndesisOct 25, 1994 11:31 AM
When my company's translation product, InterChange, converts a 3D model to DXF format, you have the option of using layers and pen numbers to map the materials and sub-objects. For example, sub-objects can be layers and materials as separate pen numbers, or vice-versa. You get the same options when reading DXF models, too. Your question about wireframe colors gives me some ideas for the 3D Studio converter within InterChange. We've already had a request to automatically assign different wireframe colors to sub-objects as we create them. We've extended that to automatically assign different wireframe colors based on materials, too (but this one isn't coded yet, it still needs to be evaluated.) We could also make an option to interpret the wireframe colors instead of or in addition to the material assignments. In other words, we could read the 3DS file, interpret wireframe colors as separate materials, then export to DXF with materials mapped to pens or layers, and you'd get what you want. As for DXF pen "colors", as I understand it, those color assignments are only recommendations. They've varied between AutoCAD releases, too, haven't they? I remember an older default set of 0..8 that repeated itself in a cycle of commmon plotter pen colors, and then Release 12 added an extended set of colors 0..255… In other words, I don't think there's a definite way to assign colors within DXF. If I'm mis-informed, please tell me! 🙂
#131897From: Angela PateOct 28, 1994 4:10 PM
Check out NAVFlyer.zip in the Software Development Kit Library, an interactive CDK flyer that we need this color info to work on 3D Studio created DXF files. >>>>When my company's translation product, InterChange, converts a 3D model to DXF format, …….In other words, we could read the 3DS file, interpret wireframe colors as separate materials, then export to DXF with materials mapped to pens or layers, and you'd get what you want.<<<< Right! Thats what we need! What is InterChange and is it a shipping product I could refer people too so I wouldn't have to write this? It would have to write color info from both material and wireframe colors. I prefer the diffuse color of material to be the deciding color, myself. (ambient being to shadow oriented and specular to bright). Does that make sense to you? >>> In other words, I don't think there's a definite way to assign colors within DXF. If I'm mis-informed, please tell me! :-)<<< Yes, in a DXF file, as in AutoCAD, color information can be contained in the layer definition, block definitions, or in entities themselves. The tuple code is 62. When it falls on the first part of a polyface mesh entity it colors that entity accordingly. I believe that if it falls within the entitiy somewhere along it's VERTEXes it will color just that face, but I am not sure about that, I forget. We have it in our code reading color correctly whether the entity from AutoCAD is colored BYLAYER, BYBLOCK or a specific color index (5 for blue, etc.). Even nested blocks are working well. But there is no correct color info in the dxf files that come out of 3DStudio, since (as -G- points out) they are only interested in getting the rat's nest mesh back to AutoCAD. So we will probably write our first useful (at least for us) IPAS routine to write out dxf files with correct color info unless someone else has an alternative out there???? If we write it we will upload it here for all who would like it. I know most 3D Studio users use 3DS files, intelligently, since it sure is a great file format compared to DXF. And we have no problems using 3DS files, they work great. But this shareware version only reads DXF files so far. If there is enough demand from 3D Studio users we will include 3DS file input in the registered version ($49). Please let me know about InterChange, maybe I could save some time. Also check out the NAVFlyer.zip and give us any feedback you have. Thanks. Angela Pate