Keep material names in collada export

Got an idea to improve SketchUp?

Keep material names in collada export

Postby Gaieus » Thu Sep 29, 2011 1:43 pm

I would like to have an option in the collada (dae/kmz) export to keep/maintain the SU material names. Something like the attached below.



The reason is: compatibility with third party products. Currently SU, when exporting to collada, renames each material to Material1, Material2 etc. I know the original reason/intention was good: to improve export to GE where non-English characters screwed up materials.

However this way collada is almost entirely useless in third party applications. When I need to "tweak" a material there, it is often futile to find which material is which by the name.

Even worse, some applications (would) allow "reloading" the model after some changes were done and when these changes include using new materials, the result is rather unpredictable as SU exports the modified model with the material names often "swapped" when renaming (thus previously grass material now ending up on the roof and roof tiles on the walls etc.)

An easy solution could be to allow the user to keep the original SU material names (on his/her responsibility if you want, maybe with a warning popup). In this case, Google’s aim at making collada a universal 3D exchange format could even come true - without this, everyone will (and does) discard his possibility.
0
User avatar
Gaieus 
 

Re: Keep material names in collada export

Postby Aerilius » Thu Sep 29, 2011 4:25 pm

Not yet to speak of the thousand-texture-pieces for distorted texture coordinates (They make models unusable for rendering).
As much as I appreciate SketchUp's support for the open Collada standard, but fixing these severe issues would turn SketchUp's sterling cutlery into gold.

Why not make the generic filenames optional (and turn this option on for kmz export)?
Why not just replace foreign characters while keeping the filename still readable?
example: "my ŠketchUp.jpg"
filename.gsub(/[^0-9a-zA-Z\-\_\.]+/,"_")
becomes "my_ketchUp.jpg"
instead of "texture1.jpg"
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: Keep material names in collada export

Postby TIG » Thu Sep 29, 2011 4:34 pm

This is approach is already used in OBJ-exporters - like the v8 one AND mine - to ensure that the file-name AND materials'/textures' names are not going to mess up - still keep the names compliant AND unique but recognizable - otherwise we get
"my ŠketchUp.jpg".gsub(/[^0-9a-zA-Z\-\_\.]+/,"_")
>>> "my_ketchUp.jpg"

AND
"my ŞketchUp.jpg".gsub(/[^0-9a-zA-Z\-\_\.]+/,"_")
>>> "my_ketchUp.jpg"

which is NOT what we need...
It straightforward to keep a list of materials/textures and if one already exists then the next one becomes say >>> "my_ketchUp1.jpg"
This is NOT hard to do, so why it's not been done for DAE yet is a mystery... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Keep material names in collada export

Postby Gaieus » Thu Sep 29, 2011 5:20 pm

Aerilius wrote:Not yet to speak of the thousand-texture-pieces for distorted texture coordinates (They make models unusable for rendering).

It's not only the current, "official" collada exporter but can happen with other exporters as well. Only recently Tomasz has overcome this behaviour for the Thea exporter for instance. You can also prevent it if you (pre)triangulate your mesh prior to exporting (collada will triangulate anyway so you will not add extra polygons)
0
User avatar
Gaieus 
 

Re: Keep material names in collada export

Postby Gaieus » Thu Sep 29, 2011 6:11 pm

Aerilius: I see you are faster at fulfilling feature requests than the Googlers!
:)

viewtopic.php?f=323&t=40397
0
User avatar
Gaieus 
 

Re: Keep material names in collada export

Postby Aerilius » Thu Sep 29, 2011 7:10 pm

Gaieus: I had a similar method in my KML tools. So it was only a little change and wrapping into a plugin. I hope this will not be accepted as a "fullfilled" feature request ;-)
Actually it is not a solution, because it exports all materials a second time and then afterwards manipulates the exported collada text file.

Another point to think about:
material's screen name or original texture filename? (SketchUp remembers each texture image's original file path)
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: Keep material names in collada export

Postby Gaieus » Thu Sep 29, 2011 7:14 pm

I guess best would be the SU "screen name" as
  • most users never meet the original image file name anyway
  • and this is also what you can modify easily in SU when it is needed.
Now as for the technical details; you know how much I understand those... :cry:
0
User avatar
Gaieus 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to SketchUp Feature Requests

Who is online

Users browsing this forum: vincentm67 and 2 guests

Visit our sponsors: