sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin]Export Collada with texture names 1.2b [30/9/11]

    Scheduled Pinned Locked Moved Plugins
    38 Posts 15 Posters 46.0k Views 15 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      Morten
      last edited by

      Excellent plugin (and initiative), Aerilius!

      There seems to be a small problem with the texture paths though:

      <init_from>**Boxes_MaterialTest/**C:/Users/ABC/Desktop/Boxes_MaterialTest/_Asphalt_Stamped_Brick_1.jpg</init_from>

      As you can see it seems to add the name of the exported DAE file to the texture path. Once I've removed that I can easily import the DAE file with textures in Lumion πŸ‘

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by

        @unknownuser said:

        Once I've removed that I can easily import the DAE file with textures in Lumion :thumb:

        the folder does stop all the texture being scattered over you desktop, so maybe putting the dae file into it programatically would be better...

        john

        learn from the mistakes of others, you may not live long enough to make them all yourself...

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          <init_from>daetest/C:/Users/TIG/Desktop/daetest/Palm14x.png</init_from>
          should be either
          <init_from>C:/Users/TIG/Desktop/daetest/Palm14x.png</init_from>
          or for a [better] more general solution where the dae has its images in a folder 'kept with it' even when moved
          <init_from>daetest/Palm14x.png</init_from>
          The code is readily tweaked thus
          fileNames.each{|old,new| colladaContent.gsub!(old,new) **colladaContent.gsub!(/#{dir+'/'}/,'')** } to remove the unneeded path...

          πŸ˜’

          TIG

          1 Reply Last reply Reply Quote 0
          • M Offline
            Morten
            last edited by

            Thanks for that, TIG - the textures work great now without the need to manually edit the paths!

            Any idea how to preserve the original SketchUp material names in the DAE file?

            1 Reply Last reply Reply Quote 0
            • A Offline
              Aerilius
              last edited by

              @morten said:

              Any idea how to preserve the original material names in the DAE file?

              That's what I've been working on (while I hadn't read all new posts here). I've also found the mistake myself and fixed it (I had mixed up the file base name and full path).
              So now the plugin not only replaces texture file names, but also the material's screen names. It wasn't simple because collada has several different material names (<material>, <instance_material>) that are scattered over the whole file.

              @driven said:

              maybe putting the dae file into it programatically would be better

              So you mean to put the collada file into the same folder where the textures are? I understand how that would be useful, for now I did only modify the contents of the dae and kept the file structure how SketchUp produced it.

              1 Reply Last reply Reply Quote 0
              • GaieusG Offline
                Gaieus
                last edited by

                @aerilius said:

                So you mean to put the collada file into the same folder where the textures are? I understand how that would be useful, for now I did only modify the contents of the dae and kept the file structure how SketchUp produced it.

                Indeed it could be useful however note that it would be rather unusual. Most of the exporting packages I know place the materials into a subfolder under where the model file is. Would it not cause confusion rather than ease of use? When exporting, most (experienced) users create a folder to collect all exported files and subfolders anyway.

                Gai...

                1 Reply Last reply Reply Quote 0
                • M Offline
                  Morten
                  last edited by

                  @aerilius said:

                  I've also found the mistake myself and fixed it (I had mixed up the file base name and full path). So now the plugin not only replaces texture file names, but also the material's screen names.

                  Hmm, after replacing your Ruby script with the latest version, the imported DAE object appears without textures in both Blender and Lumion.

                  I'm testing a simple box with 1 brick material + 1 default white material on the inside of the box, and as far as I can tell, there's still a slight discrepancy between the material names throughout the DAE file:

                  <instance_material symbol="[Brick_Rough_Tan]" target="#ID5">
                  <instance_material symbol="Material3" target="#ID15">
                  

                  ...

                  <triangles count="12" material="Material2">
                  <triangles count="12" material="Material3">
                  

                  The texture re-appears if I replace "Material2" with "[Brick_Rough_Tan]", so it's almost working.

                  1 Reply Last reply Reply Quote 0
                  • TIGT Offline
                    TIG Moderator
                    last edited by

                    I too have noticed this BUT the SKP dae-importer works just fine πŸ˜• 😲
                    Perhaps these other apps need the image files to be with the dae - but the normal SKP dae-exporter version writes to a similar textures subfolder too ? πŸ˜’

                    I have also played around with trying to adjust the material's names in the xml - you can convolutedly connect the textures to the materials and thereby get the real material's name... BUT changing them in the xml [manually] seems to do nothing because when you import the materials they are still called '<auto>1' etc anyway πŸ˜•

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • pep75P Offline
                      pep75
                      last edited by

                      F I N A L L Y !!!!!!!!!!!!!! 😍 😍 πŸ‘ πŸ‘

                      I LOVE YOU!

                      1 Reply Last reply Reply Quote 0
                      • pep75P Offline
                        pep75
                        last edited by

                        mmm....the love is over.....it doesn't do anything! Is it working? I'm importing the Collada-file into Cinema4d but I just got the "normal" material names...... 😒

                        1 Reply Last reply Reply Quote 0
                        • GaieusG Offline
                          Gaieus
                          last edited by

                          What do you mean by "normal" materials names? Texture0, texture1 etc.?
                          Are you using this exporter? (File > "Export collada with texture names" and not File > Export > 3D...)?

                          Gai...

                          1 Reply Last reply Reply Quote 0
                          • pep75P Offline
                            pep75
                            last edited by

                            Hey Gaius,

                            In Cinema4D I normally get "Material 1, Material 2, etc" instead of the material names I use in SketchUp. When I use the collada-plugin (file > export collada with material names) it really doesn't export it with the material names. I'm working with Windows and version 8...mmm

                            grtzz
                            Pep

                            1 Reply Last reply Reply Quote 0
                            • TIGT Offline
                              TIG Moderator
                              last edited by

                              We can't see how to rename 'Materials' in a DAE file.
                              We can rename their 'Texture' files however.
                              SO depending on the app that you import into - all materials will become something like material0, material1 etc, or in a SKP <auto>1 etc.
                              Assigning a name to a material in the DAE is simply ignored and the app's imported materials are named using their simple numerical order in the DAE file.
                              However, if the material has a texture many apps will list that against the material, so you can then spot it by that image-name IF you've used this exporter-tool and had used sensible image names for textured-materials. With the native DAE exporter material1 will have a texture called perhaps texture1.png etc... but at least this tools gives material1 with ' brick_666.png'...

                              TIG

                              1 Reply Last reply Reply Quote 0
                              • pep75P Offline
                                pep75
                                last edited by

                                Aaaaaah...so only the names of TEXTURED materials will show up...mmm...well that means no improvement for me...😞....grrr....I could already see the linked texture-names in Cinema and the textures are clear to me wich material it is....well...

                                Thanks though!!
                                Grtzz
                                Pep

                                1 Reply Last reply Reply Quote 0
                                • A Offline
                                  Aerilius
                                  last edited by

                                  @tig said:

                                  SO depending on the app that you import into

                                  That could be a explanation (I can't check because I don't have C4D).

                                  It seems collada files contain several "similar" elements like %(#000000)[<image>], %(#000000)[<effect>], %(#000000)[<material>] and %(#000000)[<instance_material>]. SketchUp's exporter applies generic IDs and names ("Material2") to these elements and generic names to the texture files.
                                  I added already the capability to apply the original material's name to %(#000000)[<material name="...">] and %(#000000)[<instance_material symbol="...">] (although that was risky and caused lots of the errors in the posts above, but it should work now). I regret if those names aren't imported into other applications.

                                  1 Reply Last reply Reply Quote 0
                                  • pep75P Offline
                                    pep75
                                    last edited by

                                    Hey Aerilius, please don't apologise for this...you did a great job, and I was getting used for waiting on a more streamlined import method to C4D. It will come! πŸ˜„

                                    Thanks anyway!
                                    Grtz
                                    Pep

                                    1 Reply Last reply Reply Quote 0
                                    • S Offline
                                      StamatisPsarras
                                      last edited by

                                      First of all Thanks for your efford!

                                      I am having 2 problems with this particular plugnin

                                      1. The normal collada file from the native exporter in sketchup is about 62mb but with your is more that 250mb. Is there anything, like filenames, material names or whatever matter when exporting?
                                      2. Importng it to Lumion doesn't seem to show up the names of the materials. Has anyone make it to work properly with lumion? Meaning lots of re-sync with correct materials?

                                      p.s. I don't know if that matters but I am notusing "textres" in sketchup just color "materials" that I change the name (!)

                                      Thanks for your time!

                                      edit: I also tried with "textured" materials and some materials got idd renamed in the first time, but 1) The texture seamed to go to more surfaces than i put it 2) The names on a second export seemed to seize renamed and go to a generic material01, material03...

                                      Although as I understanding there is not a perfect solution here. Has anyone understood what order sketchup uses in order to apply the generic material names? My first thought was alphabetical but this seems not to be the case...Plz help me.... 😞

                                      1 Reply Last reply Reply Quote 0
                                      • McGyverM Offline
                                        McGyver
                                        last edited by

                                        I'm curious if anyone has found out if it is possible to keep the material names (by that I mean the SketchUp "color only type materials" not image textures) when exporting using DAE... Has this been determined to be impossible?

                                        [Visit My ShareCG Freebie Gallery](http://www.ShareCG.com/pf/full_uploads.php?pf_user_name)

                                        1 Reply Last reply Reply Quote 0
                                        • R Offline
                                          rraallvv
                                          last edited by

                                          Could someone add an option to swap Y and Z axis, please

                                          I am using Collada2POD to import my models into my application, but Y and Z axis appears swapped

                                          I'd appreciate it a lot

                                          1 Reply Last reply Reply Quote 0
                                          • E Offline
                                            electrician
                                            last edited by

                                            Hi,
                                            I have problem, i use this plug in but still texture names comes like texture0.bmp, texture01.bmp ect... What is possibly happening? I use File > "Export collada with texture names"

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 2 / 2
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement