Make uniq texture by script

Hi all,
Is it a way to make uniq texture with ruby API.
I take a look to makeuniq++ but its require imagemagick.

BS !

If you don’t want to edit the texture image you can just save it out as an image file using Texture#write, then create a new material and load the image as its texture.

If you want to edit the image I think you need some sort of image library, the thing in the context menu doesn’t seem to be exposed to the API.

1 Like

Thnaks for your answer eneroth3

Hi all,
I finaly use

@model = Sketchup.active_model
entities = @model.entities
faces = entities.grep(Sketchup::Face)
tw = Sketchup.create_texture_writer
tw.load(faces[0], true)
if tw.write(faces[0], true, "Face.png") == FILE_WRITE_OK
  puts("PNG file successfully written.")

The image is record with the cropped text

1 Like

Ok now I have a texture, but I didn’t achieve to put it on a correct position:
I read this post to understand position_material

But its not clear to me.

How control the position a pin with 2 points for each 4 pins?

Its not clear at all for me.

I finally get answer here:

1 Like

This topic was automatically closed after 91 days. New replies are no longer allowed.