Announcement

Collapse
No announcement yet.

API - Import Material Using Ruby Console

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • API - Import Material Using Ruby Console


    Hi guys, I'm studying the new V-Ray for SketchUp API and creating a plugin to add my materials, but I couldn't import it using the parameter.

    scene.import('C:/User/Download/brick.vrmat', as_is: true)

    I'm new in this area and I don't know if I need to use some module or definition to make it work. I appreciate the help.

    Thanks

  • #2
    Hi henriqueb ,

    For some script operations you have to call VRay::refresh_ui at the end of the script.
    This way the Asset Editor will refresh and show the new scene content.

    You can try the following:
    Code:
    scene= VRay::Context.active.scene
    scene.import('C:/User/Download/brick.vrmat', as_is: true)
    VRay::refresh_ui
    Regards,
    Konstantin

    Comment


    • #3
      Thank you so much Konstantin, it worked correctly, but VRayMtl doesn't open and the textures don't load, do you have any tips? Thanks

      Comment


      • #4
        Hi henriqueb ,

        I've consulted with the devs about this and there seems to be a better way to write this script:
        Code:
        scene = VRay::Context.active.scene
        scene.change { scene.import('C:/User/Download/brick.vrmat') }
        If it still fails, please share some more detailed information on what you do and what the end result is.
        You can share the material you're testing with as well.

        Konstantin

        Comment


        • #5
          Many Thanks Konstantin, it worked perfectly.

          Best regards

          Comment

          Working...
          X