[Plugin] TextureTools

[Plugin] TextureTools

Postby TIG » Thu May 19, 2011 11:35 am

Copyright 2011-2014 (c) TIG
All Rights Reserved.
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES,INCLUDING,WITHOUT LIMITATION,THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
###

TIG-TextureTools.rb >> ../Plugins/ folder

Plus script >>> ../Plugins/TIG-TextureTools/ folder

TIG-TextureTools_code.rb

Plus image files >>> ../Plugins/TIG-TextureTools/Images/ folder

TextureAdjust.png
TextureNudge.png
TextureRotate.png
TextureScale.png
TextureShunt.png
TextureTweak.png

Click below to go to the PluginStore for more details and also download the RBZ ...

Download

36
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TextureRotate v1.0 20110519

Postby Rich O Brien » Thu May 19, 2011 11:57 am

Thanks :thumb:
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] TextureRotate v1.0 20110519

Postby massimo » Thu May 19, 2011 12:16 pm

Finally! :D
Thanks a lot for this TIG. :thumb:
Now a request :mrgreen: : would be possible to add some move commands for the textures (for example the arrows buttons)? As you know moving precisely the textures is a real pain...
1
User avatar
massimo 
 

Re: [Plugin] TextureRotate v1.0 20110519

Postby TIG » Thu May 19, 2011 12:21 pm

I suppose that now that I have a 'proof of concept' in 'transforming' textures then as well as rotating, scaling or translation could be possible. A simple scaling about the center by an entered factor e.g. 2.0 is straight forward, and a translation by entering X & Y values [lengths] to shunt the texture along by on the face could be to - e.g. 100mm & 0 would shunt the texture to the 'right' 100mm...
I'll see what's needed...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TextureRotate v1.0 20110519

Postby pilou » Thu May 19, 2011 12:30 pm

Is there a difference except the process with the Right Click / Texture / Position / rotation yet existing?
-1
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] TextureRotate v1.0 20110519

Postby massimo » Thu May 19, 2011 1:01 pm

I'll see what's needed...

:thumb:
Is there a difference except the process with the Right Click / Texture / Position / rotation yet existing?

Yes mainly two for what I can see:
1)You can input a precise angle of rotation;
2)You don't have to deal with that painful rotate+scale green pin.
0
User avatar
massimo 
 

Re: [Plugin] TextureRotate v1.0 20110519

Postby srx » Thu May 19, 2011 1:56 pm

Great! Thanks!
0
User avatar
srx 
 

Re: [Plugin] TextureRotate v1.0 20110519

Postby TIG » Thu May 19, 2011 1:57 pm

There are a few glitches with non-quad faces etc but a fix is under way... as are the Shunt/Scale versions... watch for announcements...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TextureRotate v1.0 20110519

Postby jgb » Thu May 19, 2011 4:06 pm

Another useful plugin by the master.... TIG :sketchstatic:
0
__________________
jgb
User avatar
jgb 
 

Re: [Plugin] TextureRotate+Shunt v1.1 20110519

Postby TIG » Thu May 19, 2011 4:35 pm

Here's v1.1 viewtopic.php?p=329765#p329765
TextureTools expanded to include Rotate AND Shunt.
Traps now added for colinear vertices and > quad faces etc.

These tools now allow for accurate rotation of a texture anchored about the face's first vertex by typing in an angle in degrees into a dialog; and the shunting of the texture's UV-mapping [in XY/UV] by typing in two offset lengths into a dialog...

A third tool - 'TextureScale' - might follow if I ever get some spare time...

Feedback please...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TextureRotate v1.1 20110519

Postby wolfy » Thu May 19, 2011 4:52 pm

Quite handy, thank you!
0

wolfy 
 

Re: [Plugin] TextureRotate+Shunt v1.1 20110519

Postby massimo » Thu May 19, 2011 4:58 pm

Thanks again TIG. :thumb: :thumb:
Seems to work fine at a first quick try also with irregular shapes (just a little thing: if you don't copy the icon's folder in the plugins folder you get an error at the start of SU. The first version worked without icons).
and the shunting of the texture's UV-mapping [in XY/UV] by typing in two offset lengths into a dialog...

That's really cool... 8-) Would be possible also to have a way to move the texture via keyboard (for example arrow keys)? I mean often you have to align textures each other or with an edge so a "fine" control on the movements with the keyboard would be really great. Something like the move tool of Photoshop.
0
User avatar
massimo 
 

Re: [Plugin] TextureRotate+Shunt v1.1 20110519

Postby TIG » Thu May 19, 2011 5:18 pm

massimo wrote:Thanks again TIG. :thumb: :thumb:
Seems to work fine at a first quick try also with irregular shapes (just a little thing: if you don't copy the icon's folder in the plugins folder you get an error at the start of SU. The first version worked without icons).
and the shunting of the texture's UV-mapping [in XY/UV] by typing in two offset lengths into a dialog...

That's really cool... 8-) Would be possible also to have a way to move the texture via keyboard (for example arrow keys)? I mean often you have to align textures each other or with an edge so a "fine" control on the movements with the keyboard would be really great. Something like the move tool of Photoshop.

I'll look at the code I must have messed something up adding the extra buttons etc...
The 'To Do' list could include a 'nudge' with arrow-keys option as doing it on screen might be little different from the Texture tool...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TextureRotate+Shunt v1.2 20110519

Postby TIG » Thu May 19, 2011 5:24 pm

Here's v1.2 viewtopic.php?p=329765#p329765
I fixed the typo in the toolbar code so it should only make the toolbar and its button[s] if you have the icon[s]...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TextureRotate+Shunt v1.2 20110519

Postby notareal » Thu May 19, 2011 5:56 pm

Sounds good, Thanks!
0
Welcome to try Thea Render, Thea support | kerkythea.net -team member

notareal 
Thea Render Support
Thea Render Support
 

Re: [Plugin] TextureRotate+Shunt+Nudge v1.3 20110519

Postby TIG » Thu May 19, 2011 7:07 pm

Here's v1.3 viewtopic.php?p=329765#p329765
A new tool Texture Nudge is added which allows you to nudge a texture in UV/XY using the four arrow keys, by a factor entered in a dialog or 10x if Shift is held down...

feedback please - especially MAC users as I'm not sure about the key-codes...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TextureRotate+Shunt+Nudge v1.3 20110519

Postby massimo » Thu May 19, 2011 7:21 pm

Seems to work just fine! :D
A "must have" plugin. :ugeek:
0
User avatar
massimo 
 

Re: [Plugin] TextureRotate+Shunt+Nudge v1.3 20110519

Postby massimo » Thu May 19, 2011 8:19 pm

A detail: the first time you start the "nudge" and the "shunt" tools you are obliged to input an increment because if you confirm the default number by just pressing "Ok" they don't work.
0
User avatar
massimo 
 

Re: [Plugin] TextureRotate+Shunt+Nudge v1.3 20110519

Postby TIG » Thu May 19, 2011 10:11 pm

massimo wrote:A detail: the first time you start the "nudge" and the "shunt" tools you are obliged to input an increment because if you confirm the default number by just pressing "Ok" they don't work.

I'll look at it... :?
EDIT:
I recheck and it works fine... :?
Do you have the latest version? [I'm sure you do]
The default for the setting is 1 unit - if you have mm it's likely to be very small - conversely with meters it'll probably be too much...
What's your default template's 'units' ? mm??
Zoom in to a corner to see if things move...
Open the tool and hit OK without editing the dialog, you get the movement required.
With the Nudge tool try holding down the Shift key as the movement is magnified by x10 so 1mm >> 10mm... Once you've set your preferred nudge or shunt values they are remembered across uses of the tool during that session.
IF you want to have a default find @@u, @@v and @@d values near the start of the two tools class initialize and change the numbers there - e.g. '10.0' intsead of '1.0' will make the initial values 10mm not 1mm etc... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TextureRotate+Shunt+Nudge v1.3 20110519

Postby Oxer » Thu May 19, 2011 10:30 pm

TIG wrote:Here's v1.3 viewtopic.php?p=329765#p329765
A new tool Texture Nudge is added which allows you to nudge a texture in UV/XY using the four arrow keys, by a factor entered in a dialog or 10x if Shift is held down...

feedback please - especially MAC users as I'm not sure about the key-codes...

Hi TIG,
I'm a mac user, i don't know the code of the mac keyboard but i have found a web page it's possible that help you
http://wordherd.com/keyboards/
0
"The result is the end what is important is the process" by Oxer
http://www.oxervision.blogspot.com/
User avatar
Oxer 
 

Re: [Plugin] TextureRotate+Shunt+Nudge v1.3 20110519

Postby driven » Fri May 20, 2011 1:35 am

TIG wrote:feedback please - especially MAC users as I'm not sure about the key-codes...


KeyCodes UP, Down, Left, Right work on 10.5.8, and I changed KSHIFT = VK_SHIFT to get shift to work

I'll read the instructions now that I've worked out that you have to apply material to the front face for it to work at all.

Is an alert possible for back face materials, I was trying to adjust texture on a LiveIvy skp and some are front face and some back face and I couldn't figure why TR was working intermittently.

I'll try and get the correct KeyCode for Shift, but Jims script is throwing an error at the moment and I need sleep.

great stuff, again

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] TextureRotate+Shunt+Nudge v1.3 20110519

Postby massimo » Fri May 20, 2011 5:34 am

TIG wrote:
massimo wrote:A detail: the first time you start the "nudge" and the "shunt" tools you are obliged to input an increment because if you confirm the default number by just pressing "Ok" they don't work.

I'll look at it... :?
EDIT:
I recheck and it works fine... :?

I have cm and yes it's the latest version, so i think it's not a matter of small lengths. I think that the culprit is the "." (just noticed the dot). So the default "1.0" should be "1,0" for me. Here you have the ruby console anyway.
Code: Select all
Error: #<ArgumentError: Cannot convert "1.0" to Length>
C:/Program Files (x86)/Google/Google SketchUp 7/Plugins/TextureRotate.rb:282:in `to_l'
C:/Program Files (x86)/Google/Google SketchUp 7/Plugins/TextureRotate.rb:282:in `reset'
C:/Program Files (x86)/Google/Google SketchUp 7/Plugins/TextureRotate.rb:276:in `activate'
C:/Program Files (x86)/Google/Google SketchUp 7/Plugins/TextureRotate.rb:410:in `select_tool'
C:/Program Files (x86)/Google/Google SketchUp 7/Plugins/TextureRotate.rb:410
C:/Program Files (x86)/Google/Google SketchUp 7/Plugins/TextureRotate.rb:410:in `call'

EDIT
IF you want to have a default find @@u, @@v and @@d values near the start of the two tools class initialize and change the numbers there

Changed "1.0" to "1,0" and now seems to work fine. :thumb:

EDIT 2
Tried to change also the "angle" default parameter to "90,0" but it doesn't work. So now I have the "rotate" which works with "dot" and the "shunt+nudge" with "comma". :?
0
User avatar
massimo 
 

Re: [Plugin] TextureRotate+Shunt+Nudge v1.3 20110519

Postby Jean-Luc Clauss » Fri May 20, 2011 8:27 am

Nice tool for geomodeling.
Thank you so much Tig !
0
Auteur de guides et de mémos sur SketchUp aux éditions ENI
http://archi-com21.blogspot.fr/

Jean-Luc Clauss 
 

Re: [Plugin] TextureRotate+Shunt+Nudge v1.3 20110519

Postby TIG » Fri May 20, 2011 8:52 am

Massimo

I hadn't anticipated you weird Eurpoeans using a ',' as a decimal point rather than a sensible '.' :roll:
I can easily trap that in the code... I'll release an update later today - it should also have new tools added - TextureScale and TextureTweak... :D
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] TextureRotate+Shunt+Nudge v1.3 20110519

Postby vidy » Fri May 20, 2011 11:14 am

Wooow.. like this TIG, thank you.. :berserk:
my wish, hopefully it could do also on the complex shape surface like sphere or cylinder.. :bounce:

regards,
0
still so much to learn..

vidy 
 

Re: [Plugin]TextureTools v1.4 20110520

Postby TIG » Fri May 20, 2011 12:06 pm

Here's v1.4 viewtopic.php?p=329765#p329765
New tools have been added - TextureScale & TextureTweak [Scale by Arrows], and TextureAdjust [Rotate by Arrows]. Some button png files have been adjusted.
'Locale' use of a ',' instead of a '.' as a decimal-point now works in all dialogs.

Please read the usage note for each tool...

Feedback please...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]TextureTools v1.4 20110520

Postby massimo » Fri May 20, 2011 12:34 pm

Wonderful. :o :thumb:
A little issue is that now i have to do something like this when input values:
rotate-->dot
adjust-->dot
shunt-->comma
nudge-->comma
scale-->dot
tweak-->dot
While in SU i use always comma.
0
User avatar
massimo 
 

Re: [Plugin]TextureTools v1.4 20110520

Postby Oxer » Fri May 20, 2011 12:49 pm

Thanks TIG, it works fine on Mac, only one thing the dot and comma don't works on all tools.
0
"The result is the end what is important is the process" by Oxer
http://www.oxervision.blogspot.com/
User avatar
Oxer 
 

Re: [Plugin]TextureTools v1.4 20110520

Postby TIG » Fri May 20, 2011 1:01 pm

massimo wrote:Wonderful. :o :thumb:
A little issue is that now i have to do something like this when input values:
rotate-->dot
adjust-->dot
shunt-->comma
nudge-->comma
scale-->dot
tweak-->dot

Massimo [& Oxer]

What's your 'locale' ?
How do you normally input 'decimal-points' ?
In the UK/US it's 1.234 and I know in EU etc its [perversely] 1,234
The rotate/scale tools take 'float' numbers because angles and scaling are always in that format - the 'decimal-point' is determined by the system setup/locale not by me... 'I think 'floats' always use a '.' ??
The shunt/nudge tool takes a 'string' as its input since the user might type '10mm' or '1"' irrespective of their current units, and if they type '1' and their current units are 'cm' it is taken as '1cm', using the API's .to_l method. When the user enters a decimal-point it should be in the format that is determined by the system setup/locale not by me... So '1.234' or '1,234' - however I'm amazed that the two types of input are handled different.
Can you do a test in the Ruby Console for me... type these [exactly as they appear here] and report the result:
1.23.class
1,23.class
1.23.to_l
1,23.to_l
'1.23'.to_l
'1,23'.to_l

Depending on your feedback I COULD try trap it to change the input for the 'string' type so if you entered '1.23' and it couldn't be made into a length in length='1.23'.to_l then it'd try length='1.23'.tr('.',',').to_l - that way all of these tools would expect you always to use a '.' BUT it would substitute a ',' if your system needed it...
The code to swap is
Code: Select all
  u=u.to_l
  v=v.to_l
which becomes
Code: Select all
  begin
    u=u.to_l
  rescue
    u=u.tr('.', ',').to_l
  end
  begin
    v=v.to_l
  rescue
    v=v.tr('.', ',').to_l
  end
 
AND then
Code: Select all
  @d=@@nudge.to_l
which becomes
Code: Select all
  begin
    @d=@@nudge.to_l
  rescue
    @d=@@nudge.tr('.', ',').to_l
  end
:idea:
1
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]TextureTools v1.4 20110520

Postby massimo » Fri May 20, 2011 1:08 pm

Well TIG in SU it's always comma or semicolon (for example when drawing a rectangle) for me, even the plugins, while in CAD, for example, it's always dot...
Anyway here is what i get in the ruby console:
Code: Select all
1.23.class
Float
0
User avatar
massimo 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

Visit our sponsors: