I’m using Sketchup for woodworking and improve my workflow by developing the OpenCutList extension. An extension to generate a quite well formated part list from the model.
Recently I release a new build of OpenCutList, that integrate a feature to rotate material’s images directly from the extension itself. I need this feature to avoid to do this from an externel image editor and to permit OpenCutList users to import any wood texture and rotate it after according to the wood grain. (The best orientation is to put the grain horizontaly in picture)
Ok, interesting, I discover this feature on WebDialog.
But in this case it will be difficult to keep texture image at its original size if it is bigger than dialog, no ?
Else, the main problem of using JS or WebDialog, is that currently the extension is working on SU 14 with IE 9 as minimal requirement. And I think that this technic can’t be done in this configuration, no ?
For version 2018 and higher, I’d say the best solution would be to use an Sketchup::ImageRep instance.
You’d transpose the pixel data depending upon the angle of rotation and then set the transposed data back to the ImageRep and then set the material’s texture to the altered ImageRep.
Realy interesting. Thank you Dan ! But in my tries, VB script (As Aerilius did) ask for authorization to execute on my Win 7 test computer.
I will investigate …
In my use case, yes. Because the default strategy of the plugin is to search the length of each part along the red axis, the width along the green axis and the thickness along the blue axis.
In the real world, length direction (even if it’s smaller than width) equals wood grain direction.
Then it would be preferable that the material represents this “strategy”. And if the wood grain representation in the texture image is horizontal, it is correctly displayed along the red axis.
And as the material could be applyed on instance, as on faces it would be easier to have directly the correct orientation. In the goal to reduce the user operations count to have the best result.
Thanks for this snippet @john_drivenupthewall ! I will take a look, but the bad thing is that HtmlDialog doesn’t have this feature. And OpenCutList uses HtmlDialog if the user run on SU 2017 and upper.