FYI-A tip about DAE export of materials in SU Free
-
This might be a well known piece of info, or not... but I just thought I'd share something I found...
A while ago in the plugins forum there were several other people asking if there was a plugin that would preserve MATERIAL names when exporting models from SketchUp using the COLLADA (.dae) format... by that I mean the materials "painted" on using the paint bucket tool... NOT image based textures... I suppose it would probably make more sense to call these "sketchup's native shaders", but whatever...
If you export your models using Free SU's COLLADA export feature you know what I mean... Some of us actually go through the trouble of renaming the textures too... But this is for naught when you open the model in most other programs... your fifty shades of gray are now all called ID3, ID14 ID89 ID202836 etc... not very helpful if you want to know which is which... Which I do... I use my models in Blender and Poser and like be able to quickly identify them when tweaking them in these other programs... and I suppose somewhere out there someone else might also...
I recently decided to drop a DAE file into TextEdit and see if it were possible to figure out what was going on in there...(I'm no code monkey... just a plain monkey, monkeying around)... Well, after scrolling down through all the code right near the bottom, I found all the materials I renamed and what their "ID" equivalents are...Usually they are located between a large block of vertices coordinates and a bunch of zig-zagging code...
Basically what you will be looking for will be something that looks like this:
(The relevant code is in blue....)
78 76 80 79 81 79 80 78 82 81 83 81 82 80 84 83 85 83 84 82 84 86 87 86 84 85 87 88 89 88 87 86 89 90 91 90 89 88 91 92 93 92 91 90 93 94 95 94 93 92 95 96 97 96 95 94 97 98 99 98 97 96 99 100 101 100 99 98 101 102 103 102 101 100 103 104 105 104 103 102 105 106 107 106 105 104 107 108 109 108 107 106 110 108 111 108 110 109 112 111 113 111 112 110 114 113 115 113 114 112 116 115 117 115 116 114 118 117 119 117 118 116 120 119 121 119 120 118 122 121 123 121 122 120 124 123 125 123 124 122 126 125 127 125 126 124 128 127 129 127 128 126 130 129 131 129 130 128 132 131 133 131 132 130 134 132 133 132 134 135 136 135 134 135 136 137 138 137 136 137 138 139 140 139 138 139 140 141 142 141 140 141 142 143 50 143 142 143 50 49</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_materials>
%(#0000FF)[<material id="ID3" name="X2619L_MiniCam_VT">
<instance_effect url="#ID4" />
</material>
<material id="ID16" name="LCD_ScreenBezel">
<instance_effect url="#ID17" />
</material>
<material id="ID24" name="MainHousingMaterial">
<instance_effect url="#ID25" />
</material>
<material id="ID44" name="X2605L_MiniCam_VT">
<instance_effect url="#ID45" />
</material>
<material id="ID69" name="X2622L_MiniCam_VT">
<instance_effect url="#ID70" />
</material>
<material id="ID89" name="JackPlastic">
<instance_effect url="#ID90" />
</material>
<material id="ID211" name="BrassContacts">
<instance_effect url="#ID212" />
</material>
<material id="ID267" name="DarkerHousingTexture">
<instance_effect url="#ID268" />
</material>
<material id="ID449" name="EyePeice">
<instance_effect url="#ID450" />
</material>
<material id="ID463" name="DullMetal">
<instance_effect url="#ID464" />]
</material>
</library_materials>
<library_effects>
<effect id="ID4">
<profile_COMMON>
<newparam sid="ID6">
<surface type="2D">
<init_from>ID5</init_from>
</surface>
</newparam>
<newparam sid="ID7">
<sampler2D>
<source>ID6</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<lambert>
<diffuse>So now based on this, I know that for example, that "MainHousingMaterial" is "ID24" and "EyePeice" is "ID449"... which is great because they look pretty similar...
This is no real solution to the problem, but for me it was sort of a Rosetta stone to understand what COLLADA was calling my materials, making it a lot quicker to identify them in other programs.
You could cut and paste that list to a separate document and use it as a decode list... or...
I have in two instances actually used TextEdit (on a MAC, Notepad I suppose would work the same on a PC), to find and replace all the instances of "ID naming" with my original material names... The models worked well and I found no problems with them... BUT- if you do decide to do this too... MAKE A COPY before messing with the code...
Just in case this is a well known thing or someone has a plugin that preserves the Shader/Material names (not image based texture names... this exists already), well sorry if I wasted anyones time... But since this was useful to me, I figured I'd pass it along...
Good Luck!
Advertisement