sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Wood Cherry Original

    scheduled pinned locked moved Developers' Forum
    4 Posts 3 Posters 598 Views 3 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • M Offline
      MartinRinehart
      last edited by

      There is one wood, [Wood_Cherry_Original], that is a nice hardwood suitable for furniture making. I've written a little Woodworker Tip.

      It uses [Wood_Cherry_Original] and edits in lighter and darker shades to make a selection of cabinet woods.

      I'd like to write a little Ruby that creates these extra woods, but every time I get near this project I meet Bug Splats. Known issue: if you assign [Wood_Cherry_Original] to some geometry, that geometry takes the material but [Wood_Cherry_Original] is not added to the materials list. You are near Bug Splat.

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      one-reply-to-this-post last-reply-time reply quote 0
      • J Offline
        Jim
        last edited by

        The actual code that causes the BugSplat is relevant. May we see it?

        Hi

        one-reply-to-this-post last-reply-time reply quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          @martinrinehart said:

          There is one wood, [Wood_Cherry_Original], that is a nice hardwood suitable for furniture making. I've written a little Woodworker Tip.
          It uses [Wood_Cherry_Original] and edits in lighter and darker shades to make a selection of cabinet woods.
          I'd like to write a little Ruby that creates these extra woods, but every time I get near this project I meet Bug Splats. Known issue: if you assign [Wood_Cherry_Original] to some geometry, that geometry takes the material but [Wood_Cherry_Original] is not added to the materials list. You are near Bug Splat.

          You can't save material/texture skm's externally [yet], though you can save the texture image to file [texture_writer].
          To set a material to an external skm is also not scriptable, but again you can add a material by name, then manipulate its color etc and add a texture image.
          Until a skm-importer arrives... a work around to effectively 'import a skm', is to have previously made a face with the required material and save that as a small skp file.
          Then in the main model use the import method to add this skp as a component, the desired material will come in with it. Get a reference to the definition's face material, and get it's name - on import material names can change with [] <> etc... , erase any instance and all of the imported skp's entities [within a start/commit block] and the skp-component disappears from the browser list... You now have a pointer to the desired material and its name within the main model...
          Cloning a material internally within a model requires you to do some convoluted work - see my material-name=.rb [ http://forums.sketchucation.com/viewtopic.php?p=167219#p167219 ] for ideas on this - with my script because it is not possible to rename an existing material, my method does it by taking the material and 'cloning' it with all the same details and a new name - the original is then deleted... to just clone the material simply make the copy and don't delete the old one... πŸ˜•

          TIG

          one-reply-to-this-post last-reply-time reply quote 0
          • M Offline
            MartinRinehart
            last edited by

            @jim said:

            The actual code that causes the BugSplat is relevant. May we see it?

            Not likely to get back there anytime soon. Materials have been so uncooperative that I've banned them from the Ruby portion of my tutorial.

            @tig said:

            a work around to effectively 'import a skm', is to have previously made a face with the required material and save that as a small skp file.
            Then in the main model use the import method to add this skp as a component, the desired material will come in with it.

            TIG, you have my undying affection for all the great information you provide! This, however, sounds a lot like a "you can't" answer to "I'd like to write a little Ruby..."

            Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

            one-reply-to-this-post last-reply-time reply quote 0
            • 1 / 1
            • first-post
              last-post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement