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

Duplicate Material (in materials) with correct texture API

Scheduled Pinned Locked Moved Developers' Forum
1 Posts 1 Posters 4.4k Views
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.
  • A Offline
    artmusicstudio
    last edited by 16 Jan 2021, 15:22

    hello,
    i have a small script, which

    • takes the material from a selected face
    • creates same material as copy in "materials" with a indexed name
    • copy includes the texture of the source material

    BUT

    my problem is, that the texture in the copied material is beeing reset to original size (although adjusted manually in the material section).

    is it possible to retrieve the texture exctly and asign it again to the indexed material?

    i studied the texture section and can get width/height (original size) an maybe also uv,
    but i do not find a way to aply it again to a new material.

    thanx for any tip!

    stan

    edit: just found a way:

    • create new material
    • retrieve path of source-material-texture
    • load it directly ( material.texture = path)
    • assign [tw,th] from source-material....

    it works this way around 😄

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

    Advertisement