Possible or Impossible? (or post your favourite jQuery..)
-
i've done some good searching and a few weekends trying things out, but am not much further than i started. so better just ask some masters about whether these are just impossible to achieve and rest the case.
Q1 - move a texture along a curved mesh of faces by arrow keys. rather like TIG's texture rotate tool but able to work on curved faces.
Q2 - change the sun position/time by drawing a vector (line). i was thinking that if i can draw a line, given a set location, i'd be able to calculate the position of the sun and then change the shadowinfo to match it.
Q3 - activate the color picker without calling the paint bucket. just like when on pc i click on the icon on the mat browser.
Q4 - would the new toolbar system allow for input fields? (you know where this is going) - no info whatever on this.
Q1 can be achieved manually by Fredo's thrupain,t but not in the way TIG's works. when i tried my own tweaks, on a texture cylinder, the curved texture just became a mess.
Q2 most internet finds say it is not possible, but none was using the above technique.
thanks in advance
-
Q1: The trouble with curved surfaces is the mesh complexity. If the curved surface is based on quads, then it's much more feasible.
Q2: I should think so... ...though I'm not sure how you calculate this...
Q3: You want to prompt the user for a colour? Unfortunately not any API calls for that.
Q4: The current API - no. But it would be a great feature though.
-
@cadfather said:
Q3 - activate the color picker without calling the paint bucket. just like when on pc i click on the icon on the mat browser.
On PC I have done this using an special integer for
Sketchup.send_action()
...
... BUT that dialog is not yet setup to return a value to Ruby. -
Thanks, so Q4 out of the question for the foreseeable (probably long) future, while there is gradual hope for the others. not too bad.
one more Q1 question - insane, but if SU allowed one to fix the texture in coordinates apart from the face... in other words move the face while the texture stays fixed.
re Q3, i was thinking of getting some winscript to key the 'alt' down while on paint - since that tiny icon in the browser just can't be accessed(!), maybe i can trick it. it may be useful for example when i've got vray mat editor + mat browser opening up all the time and i have to constantly shift between paint and select.
-
@cadfather said:
Q2 - change the sun position/time by drawing a vector (line).
Yes I know how to do this .. it was on my "todo" list. Have not gotten to it yet.
-
@cadfather said:
re Q3, i was thinking of getting some winscript to key the 'alt' down while on paint - since that tiny icon in the browser just can't be accessed(!), maybe i can trick it. it may be useful for example when i've got vray mat editor + mat browser opening up all the time and i have to constantly shift between paint and select.
You mean the material picker? You want to activate that?
-
@ Dan - might ask some feedback on that one if i get somewhere,
@ Thomas - Yes, that's the one - just the color sampler without invoking the painter.
-
hm... not sure about that one. It doesn't appear to be a standalone tool...
-
that's right, no send.action, no shortcut, no nothing... i'll post something if i get it working (would be only on pc)
-
@cadfather said:
Q3 - activate the color picker without calling the paint bucket. just like when on pc i click on the icon on the mat browser.
not the same, but have you looked at this
http://sketchucation.com/forums/viewtopic.php?f=180&t=47808#p428608john
-
@cadfather said:
Q3 - activate the color picker without calling the paint bucket. just like when on pc i click on the icon on the mat browser.
Apart from what was suggested here is an alternative that I am currently using for an upcoming plugin done with "jQuery"...
http://www.jswidget.com/lab/canvas-based-color-picker.html
Cheers!
Note: This is limited to people that have internet IE10 or newer installed. Also on html for web-dialog this needs to be put <meta http-equiv="X-UA-Compatible" content="IE=10">
-
-
Here is another just in case...
http://acko.net/blog/farbtastic-jquery-color-picker-plug-in/
Cheers!
-
wow, some good stuff, but just in case it isn't clear, i'm trying to sample 'textures' under the mouse...
i'm sure there is some code hidden somewhere that does this - Fredo has a sampler in his thrupaint, however the code is quite complex to just isolate the block. but in fact, it doesn't have to be the material sampler it could just be 'find the texture under the mouse'.. i've been looking at 'pickhelper' (especially Thom's good 'revolting' posts on it) but it doesn't seems to contain materials in the array (that i could fathom).
didn't know Chris colour picker post, great implementation!
-
Ah! Ok now we're getting at the core of things. This is possible though. You use the PickHelper to get the best picked face - in a custom Tool - where you can then obtain from the face entity (face.material.texture).
-
I know you want to be able to pick from SketchUp models but maybe picking from and image you upload on web-dialog is not that bad of an idea.
Sorry for this sudden spam of jQuery plugins I just discover them and am little too excited.
Demo: http://www.script-tutorials.com/creating-an-html5-canvas-image-color-picker/Script: http://www.script-tutorials.com/creating-an-html5-canvas-image-color-picker/
Cheers!
note: posted before seeing thomthom post and I think his suggestion is way better than mind...cheers!
2nd note: Although don't think that will work with textures...maybe you can get average color of texture but not much else...not 100% sure though
-
Maybe when clicking on a texture where you want to sample color, start by creating a small face on that spot with script so that you can make unique and then use PickHelper to get color.
-
@thomthom said:
Ah! Ok now we're getting at the core of things. This is possible though. You use the PickHelper to get the best picked face - in a custom Tool - where you can then obtain from the face entity (face.material.texture).
ok, so 'best_picked' and then extract the material - i thought i was going to use 'pickhelper.all_picked' to do that, that's a start (how many years testing did you do to write all that stuff in the blog!)
-
Rafael, if you don't stop posting colour pickers, i will have to rename this 'possible or impossible Jqueries'..
really, the sampler idea started when i became tired of having to shift between the paint bucket only to select textures to highlight in vray. then you move around the model and you have the paint bucket active but you don't need it. i thought why not just have a picker directly to do JUST this? (this is actually part of few beta suggestions i'm sending to the Chaos guys).
-
best_picked - or best_face if you want to avoid getting an edge or group or whatnot.
Yea, I've spent a lot of time testing things. The API docs are much better now then in 2007 when I started, but it's still lacking details.
Advertisement