View Full Version : Search a script who use Viewport Drawing Methods
externe 09-29-2004, 04:23 PM Hello again :)
It want to have a look to the viewport drawing methods.
Like in the deselect loop tool from RHTools below.
http://jerjer1.free.fr/surligne1.png
I want to look in the script to learn about it, but the script is encrypted :sad:
Can someone know another maxscript that draw something like here ?
Thanks
:)
|
|
DentonVanZan
09-29-2004, 07:08 PM
hey externe, yeah man you are right, I also want to know about this subject. Information shouldnt be encrypted, otherwise shouldnt be created. I dont know but I never encrypt my scripts, who steals codes these days man.
See ya
externe
09-29-2004, 07:17 PM
Well, it's nice idea that encrypt your script if you work hard on it... Just an opinion.
Perharps LFShade talk a few about how to obtain that.
I try a few gw.methods... But that crash max :shrug:
DentonVanZan
09-29-2004, 09:10 PM
yeah that seems right, but I wouldnt let anyone modify and distribute it without my permission. and for example tree maker, that script seems real hard, I mean really. But he gives you the code, if someone has the ability to solve all the content, that will be the first step, which very few people can do, and then if you modify it, you cant distribute it, ask me for example, I cant. then I totally respect to the idea to read or inspire from one script and then totally write a more advanced one with truly different code, one can write something with 1 fn while others can do that thing with 3 fns. And thats why I like the idea of scripting. See the tool (not the code), get the idea, inspire and write yours, and if you stuck or wonder check the original code, just to see what one has written. And then you cant integrate it to yours because of the different working nature of your script. thats what I though. Also I want to ask if its possible to sell scripts: I mean do you know anybody that does this? Maybe a really cool script?
See ya
Hello again :)
It want to have a look to the viewport drawing methods.
Can someone know another maxscript that draw something like here ?
Thanks
:)
Here is a practical example:
fn drawBoundingBox theMin theMax =
(
gw.setTransform(Matrix3 1)
lineArrays = #(
#(theMin ,[theMin.x, theMin.y, theMax.z], [theMin.x, theMax.y, theMax.z],[theMin.x, theMax.y, theMin .z]),
#(theMax ,[theMax.x, theMin.y, theMax.z], [theMax.x, theMin.y, theMin.z],[theMax.x, theMax.y, theMin .z]),
#(theMin ,[theMax.x, theMin.y, theMin.z]),
#([theMin.x,theMax.y,theMin.z] ,[theMax.x, theMax.y, theMin.z]),
#([theMin.x,theMax.y,theMax.z] ,[theMax.x, theMax.y, theMax.z]),
#([theMin.x,theMin.y,theMax.z] ,[theMax.x, theMin.y, theMax.z])
)
gw.setColor #line [255,0,0]
for lines in lineArrays do gw.polyline lines true
gw.enlargeUpdateRect #whole
gw.updateScreen()
)
fn drawBBoxesForSelection =
(
for o in selection do drawBoundingBox o.min o.max
)
unregisterRedrawViewsCallback drawBBoxesForSelection
registerRedrawViewsCallback drawBBoxesForSelection
It registers a viewport redraw callback that calls a function to draw a world-oriented red bounding box around the current selection.
To disable again, execute the line
unregisterRedrawViewsCallback drawBBoxesForSelection
Play around with it to see how it works...
DentonVanZan
09-30-2004, 12:41 AM
thanks bobo, that is cool.
See ya
externe
09-30-2004, 09:50 AM
Your example is terrific ! :eek:
Thank you very much.
externe
09-30-2004, 10:53 AM
Well Bobo, I try to disable it.
By executing :
unregisterRedrawViewsCallback drawBBoxesForSelection
in the Maxscript Listener. 2 or 3 times... But it doesn't work :shrug:
It try to re-execute you script by modify him tlike that ( put in comment the line ) :
... before
fn drawBBoxesForSelection =
(
for o in selection do drawBoundingBox o.min o.max
)
--registerRedrawViewsCallback drawBBoxesForSelection
unregisterRedrawViewsCallback drawBBoxesForSelection
But it doesn' work too:shrug:
So how to disable it please ?
Thanks :)
LFShade
09-30-2004, 02:28 PM
A note about encryption -
I used to do it to hide code that I didn't consider "ready for the world." That is, while the code may have been functional, I saw it as awkward and in need of optimization, formatting, etc. I've basically stopped encrypting for this reason, because it is foolish. In fact, I re-released many of my scripts in un-encrypted form a long while ago, so most of the scripts on my website are no longer encrypted. That includes the latest incarnation of Loop Select/Deselect, if anyone wants to pick apart how I handled edge detection and highlighting. Better ideas and faster routines are welcome if anyone can supply them :)
RH
externe
09-30-2004, 03:26 PM
Woohoo, loop/select/deselect is opensource. Really nice news !
Your install system is really nice too ! Can I use it for my scripts by mentioning its source, you ?
Better ideas and faster routines are welcome if anyone can supply them :)
Well,... I just install it and throw an eye on you script... Update here and there the routines and now it run 200 times more faster...
I joke ;) Bye
CGTalk Moderation
01-19-2006, 10:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.