Announcement

Collapse
No announcement yet.

Set Repeat U/V of texmap by Ruby

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

  • Set Repeat U/V of texmap by Ruby


    1/ I didn’t found any officially way to get and set the value of Repeat U/V.
    Now, I have a workaround to get the value of “Repeat U/V” by calculate from the matrix that I got from this code:
    Code:
    my_mtl[:brdf][:diffuse_tex][:uvwgen][:uvw_transform].matrix
    How to set new value for Repeat U/V by Ruby?
    (I tried to change value inside the above matrix but it doesn't updated, seem like readonly)


    2/ When I set the Rotation of texmap, the UI value updated correctly but texmap doesn’t rotate at all.
    Please watch this video to see the problem: https://www.youtube.com/watch?v=3n_vuxQ5gCw
    Code:
    context = VRay::Context.active
    scene = context.scene
    my_mtl = scene['/box']
    
    scene.change{
    my_mtl[:brdf][:diffuse_tex][:uvwgen][:rotation] = 0
    }


    Click image for larger version

Name:	Screenshot 2024-01-19 145539.png
Views:	71
Size:	39.1 KB
ID:	1200272
    Last edited by benmack180; 19-01-2024, 09:15 PM.

  • #2
    1/ I didn’t found any officially way to get and set the value of Repeat U/V.
    Now, I have a workaround to get the value of “Repeat U/V” by calculate on matrix that I got from this code:
    Code:
    my_mtl[:brdf][:diffuse_tex][:uvwgen][:uvw_transform].matrix
    How to set new value for Repeat U/V by Ruby? (I tried to change value inside the above matrix but it doesn't change)


    2/ When I set the Rotation of texmap, the UI value updated correctly but texmap doesn’t rotate at all.
    Please watch this video to see the problem: https://www.youtube.com/watch?v=3n_vuxQ5gCw
    Code:
    context = VRay::Context.active
    scene = context.scene
    my_mtl = scene['/box']
    
    scene.change{
    my_mtl[:brdf][:diffuse_tex][:uvwgen][:rotation] = 0
    }

    Comment


    • #3
      This is the Vantage section of the forum. Sounds like you wanted to post on the Sketchup section.
      Nikola Goranov
      Chaos Developer

      Comment


      • #4
        That's right, sorry, this should be in Sketchup section.

        If anyone can give some guidance for my question, it's really appreciated, I've been stucked here for days.
        Last edited by benmack180; 20-01-2024, 05:58 AM.

        Comment

        Working...
        X