[Plugin] TextureTools

Re: [Plugin]TextureTools v1.4 20110520

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

massimo wrote: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

I'd like the whole list please ?
I know in EU etc in the SKP's UI the '.' swaps with the ',' and then the ',' with the ';' BUT in the Ruby API I must always use a '.' as the decimal-separator, ',' as the list-separator and ';' as a line-break...
However I'd have expected that the SUp UI would seamlessly swap float '.' for ',' when displayed inputed in a UI.inputbox() to suit the locale, as it seems to take ',' in strings to convert to 'lengths' ??
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]TextureTools v1.4 20110520

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

I'd like the whole list please ?

I've copied and pasted ALL the text you posted, sorry... :oops: :roll:
Here you have the results of every single line
Code: Select all
1.23.class
Float
1,23.class
Error: #<SyntaxError: (eval):894: compile error
(eval):894: syntax error
1,23.class
  ^>
(eval):894
1.23.to_l
1.23
1,23.to_l
Error: #<SyntaxError: (eval):894: compile error
(eval):894: syntax error
1,23.to_l
  ^>
(eval):894
'1.23'.to_l
Error: #<ArgumentError: (eval):894:in `to_l': Cannot convert "1.23" to Length>
(eval):894
'1,23'.to_l
0.484251968503937
0
User avatar
massimo 
 

Re: [Plugin]TextureTools v1.4 20110520

Postby Oxer » Fri May 20, 2011 1:36 pm

Hi TIG,
I had probe to type the text in Ruby Console and this the result:
Captura de pantalla 2011-05-20 a las 14.34.13.JPG


I'm in Spain (EU) and i use metric units.
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:59 pm

So, as I suspected...
I'll reissue a trapped version that will take '.' or ',' as the decimal-separator in the inputbox for every tool, BUT it will if it's a string value it'll convert it to ',' to suit your locale and make a length from it if it has to... entering a number with a ',' it WILL work without failing [IF the locale supports] BUT it'll convert it back into a '.' when you OK the dialog...
Watch for an update...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]TextureTools v1.4 20110520

Postby jgb » Fri May 20, 2011 2:54 pm

Ah yes, A period is as important to a programmer as it is to his girlfriend. :roflmao:
0
__________________
jgb
User avatar
jgb 
 

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

Postby notareal » Fri May 20, 2011 3:04 pm

TIG wrote: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


:shock: ...waiting for the fix.
0
Welcome to try Thea Render, Thea support | kerkythea.net -team member

notareal 
Thea Render Support
Thea Render Support
 

Re: [Plugin]TextureTools v1.5 20110520

Postby TIG » Fri May 20, 2011 3:28 pm

Here's v1.5 viewtopic.php?p=329765#p329765
Irrespective of their locale, users may now type a '.' OR a ',' as a decimal-separator, depending on their preference, for any of the tools' dialogs - issues with conversion of strings to lengths from potential locale-wrong input is addressed in the code, 'behind the scenes'.

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

Re: [Plugin]TextureTools v1.5 20110520

Postby broomstick » Fri May 20, 2011 3:56 pm

TIG wrote:Here's v1.5 viewtopic.php?p=329765#p329765
Irrespective of their locale, users may now type a '.' OR a ',' as a decimal-separator, depending on their preference, for any of the tools' dialogs - issues with conversion of strings to lengths from potential locale-wrong input is addressed in the code behind the scenes.

Feedback please...


Just tried it, win7 64 bit skp 8... works fine and I must say this is one of the best plugins ever made!!!
0
User avatar
broomstick 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby driven » Fri May 20, 2011 4:13 pm

Hi TIG,

all functionality working very well on the Mac, except toolbar tooltips.

They work if I put the icons in the custom toolbar but not on the standard, floating toolbar.

not a big issue here, just thought I'd mention it.

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]TextureTools v1.5 20110520

Postby massimo » Fri May 20, 2011 4:21 pm

Here's v1.5 viewtopic.php?p=329765#p329765...

Perfect! :D
0
User avatar
massimo 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby Oxer » Fri May 20, 2011 7:00 pm

driven wrote:Hi TIG,

all functionality working very well on the Mac, except toolbar tooltips.

john


The same, it works perfect on Mac. :thumb:
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.5 20110520

Postby Oxer » Fri May 20, 2011 7:04 pm

I have translated the plugin to spanish, here is:

TextureTools 1.5-ES.zip


Thanks TIG!!
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.5 20110520

Postby massimo » Fri May 20, 2011 7:31 pm

TIG, i have tried this:
-painted a surface with a material;
-used one texture tool on the texture;
-picked the texture with the sample tool and painted other surfaces with different orientations.
Only with the "tweak" tool i get a strange behaviour following that workflow on connected faces. The texture looks a lot different on each plane... But if the planes are not connected it works just fine... :?
0
User avatar
massimo 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby TIG » Fri May 20, 2011 7:51 pm

I think the built-in UV-mapping of connected-faces assumes a certain 'flow' of the material across their shared edges...
If you have separate faces then their textures are arranged logically on a per-surface basis.
Hence the different behavior of textures on separate and connected faces... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]TextureTools v1.5 20110520

Postby massimo » Fri May 20, 2011 8:16 pm

Hmmm...That happens also with the "texture scale" tool if you input different values for U and V. But that doesn't happen if you use the native "edit" and input different values for length and width. (picture below)
0
User avatar
massimo 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby TIG » Fri May 20, 2011 8:28 pm

Hmmm... this is v1... perhaps there's more to do... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]TextureTools v1.5 20110520

Postby massimo » Fri May 20, 2011 8:55 pm

No worries it's already a wonderful set of tools. :D
0
User avatar
massimo 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby EarthMover » Fri May 20, 2011 9:56 pm

Thanks TIG! Most helpful plugin of the year! :sketchstatic:
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin]TextureTools v1.5 20110520

Postby dfswyf » Sat May 21, 2011 1:36 am

Thank you so much for this, it is very helpful!
0
User avatar
dfswyf 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby rv1974 » Sat May 21, 2011 7:13 am

Looks like another must-have,
Hats off to TIG :thumb:
0

rv1974 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby sumaster » Sat May 21, 2011 9:13 am

Hello sir,

Thank you very much .......
Its very useful .............
Good luck ........

Thanks again .......
0
User avatar
sumaster 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby rv1974 » Sun May 22, 2011 10:18 am

Dear ruby makers!
Please, If you put arrow keys (or any other ones) into the game make a temporary shortcut override!!!
There are some really usefull scripts with vulgar occupation of keys that make the life much harder.
Meanwhile only Thomthom implemented this feature.
0

rv1974 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby TIG » Sun May 22, 2011 11:47 am

rv1974 wrote:Dear ruby makers!
Please, If you put arrow keys (or any other ones) into the game make a temporary shortcut override!!!
There are some really usefull scripts with vulgar occupation of keys that make the life much harder.
Meanwhile only Thomthom implemented this feature.
Sorry to say BUT I consider that you have it quite backwards!

Scripts that use Arrow-keys for 'nudging' values are quite common - which suggests that you shouldn't assign them as your own shortcuts! It's not like we are reusing 'standard shortcut keys' here - we are just using logical key presses within an add-on tool.

Just as you wouldn't sanely assign a shortcut key to a number [0-9], as they is used in the VCB in most native tools, or even 'x' or '*' or '/' as that is used in Move+Ctrl copy array etc, or say swap M from Move to Delete ! ...

There are lots of keys, and modifier-key combinations for you to choose from when setting your custom shortcuts, without you having to use any of those that are needed by add-ons to be used logically...

It was only because Thomthom wanted to use the Move, Rotate etc shortcut keys in his Vertex Tool, that he mimics how they are set up in a default installation for the native tools - so you can use M to Move an entity in the native tools or Move a Vertex within his tool. However, the hoops he has had to jump through in code to get it to work are not acceptable to many scripters. Indeed, if you've ever had his tool crash, leaving these shortcut keys remapped, then you know how annoying even his fix is, because then many of your shortcuts are left permanently reset to the wrong tools, even when you are out of his tool, leaving a manual remap of shortcuts the only option to revert to a default setup... TT's tools are also now compiled as rbs files so the methods are not readily transparent to other scripters...

I wrote the original TextureRotate code from scratch in just two hours... as a 'proof of concept' - you'd have had to wait a lot longer for a 'massaged' version of the code to remap shortcuts etc... BUT if you want shortcut keys remapping temporarily then do it yourself - the code is open to your reuse! If you invent a simple, safe and foolproof temporary key remapping method then I suggest you publish it as then scripters might be more inclined to add the safety-net for those of you who persist in shortcutting to keys that are better left alone to tools that really need them :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]TextureTools v1.5 20110520

Postby rv1974 » Sun May 22, 2011 1:04 pm

'If You Want a Job Done Right...'. Got the message
0

rv1974 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby rv1974 » Sun May 29, 2011 7:22 am

Hi TIG!
May I ask your for some new texture editing functionality (especially after 'extrude edges by offset' is out)?
0

rv1974 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby Matt666 » Wed Jun 29, 2011 9:51 am

Hi TIG, and thank you for this great script!
Just one thing, I've mentioned here an plugin idea, that could rotate a texture along the longest dimension of a surface. Do you think it's possible?
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby TIG » Wed Jun 29, 2011 10:44 am

Matt

Here's a one-liner that gives you the angles of a selected face's longest edge relative to the X_AXIS/Y_AXIS/Z_AXIS - the result in degrees [e.g. 90.0, 66.666, 0.0] you can then copy+pasted the sensible one into the TextureTool's Rotate dialog and the texture will realign with the long edge...
Code: Select all
f=Sketchup.active_model.selection[0];es=f.edges;ed=es[0];d=0;es.each{|e|(d=e.length;ed=e)if e.length>d};x=ed.line[1].angle_between(X_AXIS).radians;y=ed.line[1].angle_between(Y_AXIS).radians-90;z=ed.line[1].angle_between(Z_AXIS).radians;(x=x-90;y=y-90;z=z-90)if f.normal.z.abs==1;p x,y,z
That assumes that the current texture has never been rotated...
It's not perfect but it's a start... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]TextureTools v1.5 20110520

Postby Matt666 » Wed Jun 29, 2011 12:30 pm

Thank you for your answer TIG, I'll take a look!
I was thinking more of a tool that would orient textures in current selection (groupe, component, or faces), or even the entire model... :oops:
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin]TextureTools v1.5 20110520

Postby TIG » Wed Jun 29, 2011 12:52 pm

The three TextureTools Rotate/Scale/Shunt are written to allow passing of arguments, so they can be run from other tools without a dialog.
So, if you pass an angle in degrees to the 'rotate' tool then there's no dialog...
So you can envisage a new tool that iterates all of the faces in a selection and finds the long side of each, calculates the rotation needed, and then uses the 'rotate' tool with the required angle passed to it so that the faces are processed en mass...
It only works on one selected face at a time... so the new tool's code needs to use
ss=model.selection
ssa=ss.to_a
ss.clear
### iterate face in faces
ss.add(face)

then later
### find angle_in_degrees etc...
TextureTools::Rotate.new(angle_in_degrees)
ss.clear
### loop

on close it could then use
ss.clear
ss.add(ssa)

to restore the selection as it was...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]TextureTools v1.5 20110520

Postby Matt666 » Wed Jun 29, 2011 4:04 pm

Ok that's great! Thank you TIG!
0
Frenglish at its best !
My scripts

Matt666 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

cron

Who is online

Users browsing this forum: amitg43, faust07, Google Bot, paulomartinho and 7 guests

Visit our sponsors: