Results 1 to 5 of 5

Thread: Importing COLLADA into SketchUp - line colours

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    3

    Importing COLLADA into SketchUp - line colours

    I tried several months ago to get an answer to this on the SketchUp forum, but never found an answer... I wanted to look at it again and thought I'd try the COLLADA gurus.

    I'm importing a dae file into SketchUp 8 on Mac OS X 10.6. It contains <lines> sections with materials to set their colours. [Couldn't attach the file - see long file at end of post...] When I look at the file with Apple's Preview, the lines are yellow. If I open it with SketchUp, the lines are black.

    I've tried playing with the "By Material" setting in the edges prefs, but that didn't do anything.

    So am I doing something wrong in my .dae file or is this just unsupported in SketchUp? The file 'validates' using a 3rd party validator and it does work in Preview.

    [If you see anything else i can improve, please point it out!]

    Thanks for any insight...

    - Andy

    Code :
    <?xml version="1.0" encoding="UTF-8"?>
    <COLLADA xmlns="http://www.collada.org/2008/03/COLLADASchema" version="1.5.0">
      <asset>
        <created>2010-07-24T16:17:15</created>
        <modified>2010-07-24T16:17:15</modified>
        <unit meter="0.01" name="centimetre"/>
        <up_axis>Z_UP</up_axis>
      </asset>
      <library_effects>
        <effect id="fx-surfaces">
          <profile_COMMON>
            <technique sid="fx-surfaces">
              <phong>
                <emission>
                  <color>0 0 0 1</color>
                </emission>
                <ambient>
                  <color>0 0 0 1</color>
                </ambient>
                <diffuse>
                  <color>0 0 1 1</color>
                </diffuse>
                <specular>
                  <color>0.500008 0.500008 0.500008 1</color>
                </specular>
                <shininess>
                  <float>20</float>
                </shininess>
                <reflective>
                  <color>0 0 0 1</color>
                </reflective>
                <reflectivity>
                  <float>0</float>
                </reflectivity>
                <transparent>
                  <color>0 0 0 1</color>
                </transparent>
                <transparency>
                  <float>1</float>
                </transparency>
                <index_of_refraction>
                  <float>0</float>
                </index_of_refraction>
              </phong>
            </technique>
          </profile_COMMON>
        </effect>
        <effect id="fx-mylines">
          <profile_COMMON>
            <technique sid="fx-mylines">
              <phong>
                <emission>
                  <color>1 1 0 1</color>
                </emission>
                <ambient>
                  <color>0 0 0 1</color>
                </ambient>
                <diffuse>
                  <color>0 0 0 1</color>
                </diffuse>
                <specular>
                  <color>0.500008 0.500008 0.500008 1</color>
                </specular>
                <shininess>
                  <float>20</float>
                </shininess>
                <reflective>
                  <color>0 0 0 1</color>
                </reflective>
                <reflectivity>
                  <float>0</float>
                </reflectivity>
                <transparent>
                  <color>0 0 0 1</color>
                </transparent>
                <transparency>
                  <float>1</float>
                </transparency>
                <index_of_refraction>
                  <float>0</float>
                </index_of_refraction>
              </phong>
            </technique>
          </profile_COMMON>
        </effect>
      </library_effects>
      <library_materials>
        <material id="mat-surfaces">
          <instance_effect url="#fx-surfaces"/>
        </material>
        <material id="mat-mylines">
          <instance_effect url="#fx-mylines"/>
        </material>
      </library_materials>
      <library_geometries>
        <geometry id="surfaces-lib" name="surfaces">
          <mesh>
            <source id="surfaces-lib-positions" name="position">
              <float_array id="surfaces-lib-positions-array" count="12">0.0 150.0 0.0 0.0 0.0 0.0 200.0 0.0 0.0 200.0 150.0 0.0</float_array>
              <technique_common>
                <accessor count="4" offset="0" stride="3" source="#surfaces-lib-positions-array">
                  <param name="X" type="float"/>
                  <param name="Y" type="float"/>
                  <param name="Z" type="float"/>
                </accessor>
              </technique_common>
            </source>
            <source id="surfaces-lib-normals" name="normal">
              <float_array id="surfaces-lib-normals-array" count="3">0.0 0.0 1.0</float_array>
              <technique_common>
                <accessor count="1" offset="0" stride="3" source="#surfaces-lib-normals-array">
                  <param name="X" type="float"/>
                  <param name="Y" type="float"/>
                  <param name="Z" type="float"/>
                </accessor>
              </technique_common>
            </source>
            <vertices id="surfaces-lib-vertices">
              <input semantic="POSITION" source="#surfaces-lib-positions"/>
            </vertices>
            <polylist count="1" material="mat-sym-surfaces">
              <input offset="0" semantic="VERTEX" source="#surfaces-lib-vertices"/>
              <input offset="1" semantic="NORMAL" source="#surfaces-lib-normals"/>
              <vcount>4</vcount>
     
     
    0 0 1 0 2 0 3 0</p>
            </polylist>
          </mesh>
        </geometry>
        <geometry id="mylines-lib" name="mylines">
          <mesh>
            <source id="mylines-lib-positions" name="position">
              <float_array id="mylines-lib-positions-array" count="12">28.2 0.0 122.8 200.0 60.4 40.9 28.9 0.0 121.1 200.0 67.0 36.0</float_array>
              <technique_common>
                <accessor count="4" offset="0" stride="3" source="#mylines-lib-positions-array">
                  <param name="X" type="float"/>
                  <param name="Y" type="float"/>
                  <param name="Z" type="float"/>
                </accessor>
              </technique_common>
            </source>
            <vertices id="mylines-lib-vertices">
              <input semantic="POSITION" source="#mylines-lib-positions"/>
            </vertices>
            <lines count="2" material="mat-sym-mylines">
              <input semantic="VERTEX" source="#mylines-lib-vertices" offset="0"/>
     
     
    0 1 2 3</p>
            </lines>
          </mesh>
        </geometry>
      </library_geometries>
      <library_cameras>
        <camera id="eyepoint" name="eyepoint">
          <optics>
            <technique_common>
              <perspective>
                <yfov>37.8493</yfov>
                <aspect_ratio>1</aspect_ratio>
                <znear>1.0</znear>
                <zfar>1000.0</zfar>
              </perspective>
            </technique_common>
          </optics>
        </camera>
      </library_cameras>
      <library_visual_scenes>
        <visual_scene id="VisualSceneNode" name="Untitled">
          <node id="Camera" name="Camera">
            <translate>100.0 500.0 300.0</translate>
            <rotate>0 0 1 180</rotate>
            <rotate>1 0 0 60</rotate>
            <instance_camera url="#eyepoint"/>
          </node>
          <node id="Surfaces" name="Surfaces">
            <instance_geometry url="#surfaces-lib">
              <bind_material>
                <technique_common>
                  <instance_material symbol="mat-sym-surfaces" target="#mat-surfaces"/>
                </technique_common>
              </bind_material>
            </instance_geometry>
          </node>
          <node id="mylines" name="mylines">
            <instance_geometry url="#mylines-lib">
              <bind_material>
                <technique_common>
                  <instance_material symbol="mat-sym-mylines" target="#mat-mylines"/>
                </technique_common>
              </bind_material>
            </instance_geometry>
          </node>
        </visual_scene>
      </library_visual_scenes>
      <scene>
        <instance_visual_scene url="#VisualSceneNode"/>
      </scene>
    </COLLADA>

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: Importing COLLADA into SketchUp - line colours

    Quote Originally Posted by asm
    So am I doing something wrong in my .dae file or is this just unsupported in SketchUp? The file 'validates' using a 3rd party validator and it does work in Preview.
    Seems like Sketchup is not supporting the emission color (where you have the yellow). Try putting the yellow color in the diffuse to see if that works. Or try using lambert or constant shader instead.

  3. #3
    Junior Member
    Join Date
    Jan 2011
    Posts
    3

    Re: Importing COLLADA into SketchUp - line colours

    Tried each of your suggestions and still no joy. I guess it must be a problem with SketchUp then. Unfortunate.

    Thanks for your help!

    - Andy

  4. #4
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: Importing COLLADA into SketchUp - line colours

    It's possible that Sketchup does not support materials on lines... if they are always black, unlit, non-textured etc. Maybe report this as a feature request to Google?

  5. #5
    Junior Member
    Join Date
    Jan 2011
    Posts
    3

    Re: Importing COLLADA into SketchUp - line colours

    Thanks - will do. I was just in the process of figuring out how to report/request this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •