• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

SKM files and the API

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 2 Posters 3.2k Views 2 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
    medeek
    last edited by 3 Jul 2018, 18:28

    Currently with the Wall Plugin (that is in active development) I have a few hard coded materials that the user/designer can select from. Once the user chooses one of these materials I then create the material on the fly either by assigning a color or a texture:

     @Lumberptmat_db = "#ffe5cc"
        @Lumberpt_mat = mats.add(mat_name)
        @Lumberpt_mat.color = @Lumberptmat_db
    
    

    or something like this:

     @Lsl_mat = mats.add(mat_name)
        @Lsl_mat.texture = File.join(this_dir,'materials/WOOD_OSB.jpg')
        @Lsl_mat.texture.size = [36.0, 4.0]
    

    However, I would like to make it possible so that the user can create their own library of files (using .SKM files) and then just have the plugin load the applicable .SKM file into the model.

    Somewhere I was reading that SKM files were creating issues for certain previous SU releases but this may be outdated information.

    I'm just wondering if there are any known problems or issues with using SKM files and the API before I get too far down this road, that I should be aware of.

    Nathaniel P. Wilkerson PE
    Medeek Engineering Inc
    design.medeek.com

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 3 Jul 2018, 20:04

      See http://ruby.sketchup.com/Sketchup/Materials.html#load-instance_method
      This method lets you load a SKM material directly into your model's materials - but it's only useful for versions >= v2017
      If your toolset needs earlier version support... then, if the named material doesn't exist you will need to make a new material, and then add a texture to it, with scaling etc...

      TIG

      1 Reply Last reply Reply Quote 0
      • M Offline
        medeek
        last edited by 3 Jul 2018, 20:19

        After a little further investigating I realized that it only works for 2017 and later. So basically this feature is fairly new.

        I actually would like to make the switch to an SKM based system but with this feature being so new its stability concerns me. If it is running solid though I will probably switch.

        Nathaniel P. Wilkerson PE
        Medeek Engineering Inc
        design.medeek.com

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 4 Jul 2018, 11:18

          It works fine in >= v2017...
          Try it...

          TIG

          1 Reply Last reply Reply Quote 0
          • M Offline
            medeek
            last edited by 4 Jul 2018, 18:10

            Most users of the plugin are SU 2018 but I've received some kickback from others so I may have to put this plan on hold and go a different direction.

            Nathaniel P. Wilkerson PE
            Medeek Engineering Inc
            design.medeek.com

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

            Advertisement