Duplicate Material (in materials) with correct texture API
-
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
Advertisement