CGTalk > Software > Autodesk 3ds max
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 08-24-2004, 12:53 PM   #1
Cthulhu
Piranha No.9
 
Cthulhu's Avatar
André Hotz
Lead Animator
Piranha-Bytes
Germany
 
Join Date: Jun 2002
Posts: 297
Send a message via MSN to Cthulhu
Legolizer

Hi there,

i found a thread in the lightwave forum (http://www.cgtalk.com/showthread.php?t=163202) some days ago where someone wrote a plugin to convert an object into a legolike structure. i found that pretty funny so i tried to write something like it for 3dsmax. i ran into the same problems (very slow, and sometimes holes won't get filled), but beside this, it is working pretty well i will try to fix the remaining bugs and add some more things this week...

take a look at it, if you want, you can download it here
there is a short description within the script

i really would like to see some results (i think we can do better than the lightwave guys ), because i don't have much time to do some tests by myself...

Happy Legolizing
__________________
Don't panic!

Piranha-Bytes
Risen 2
3dsmax scripts


 
Old 08-24-2004, 01:08 PM   #2
percydaman
VRay enthusiast
 
percydaman's Avatar
jack thompson
USA
 
Join Date: Aug 2002
Posts: 1,267
cool will check it out. saw that lightwave plug and was jealous






.

Last edited by percydaman : 08-24-2004 at 01:13 PM.
 
Old 08-24-2004, 01:43 PM   #3
Taoizm
Forum Monkey
 
Taoizm's Avatar
portfolio
Tony O'Dell
Director of Motion Design
Illumen
Evanston, USA
 
Join Date: Dec 2001
Posts: 1,606
great googly-moogly... I can't wait to give this a try.
__________________
I love deadlines. I like the whooshing sound they make as they fly by.
-Douglas Adams

 
Old 08-24-2004, 03:58 PM   #4
micco
Love and peace
 
micco's Avatar
portfolio
Mikko K
Finland
 
Join Date: Jun 2004
Posts: 310
Great one! Gave me good laughs. Alltho it's a quite slow...
 
Old 08-24-2004, 04:01 PM   #5
peekoot
we come in peace
 
peekoot's Avatar
Vladimir Mastilovic
Art/Tech Lead
Novi Sad, Serbia
 
Join Date: Mar 2003
Posts: 791
haha.... this is great! bit heavy on the processor, but works like a charm! gave it a quick test ride... will play with it as soon as i find some free time...


great work!
__________________
.:|x/infinity=your life|:.
 
Old 08-24-2004, 04:23 PM   #6
pixel-abuse
Lurker
 
pixel-abuse's Avatar
portfolio
Andy Stent
CAD Monkey
Stedman Blower Architects
Aldershot, United Kingdom
 
Join Date: Aug 2003
Posts: 110
Send a message via MSN to pixel-abuse
Talking

Gonna try it right now! Thanx
__________________
Placeholder for something witty and erudite.......
 
Old 08-24-2004, 10:53 PM   #7
Arnage
Frequenter
 
Arnage's Avatar
Arne Bezuijen
Rotterdam, Netherlands
 
Join Date: Sep 2002
Posts: 242
Such a fun plugin and still no cool pictures posted?

Here's my Teapot + Legolizer + ReallySimpleLightningSetupThatRendersReallySlow™



Some little comments on how you could improve the script if you plan to work on it further: (and make it better then the lightwave one :thumbsup

- Real lego's always have a seam where they meet, would be nice to have the lego's edges automaticly chamfered so you see the seam.
- An option to change the number of sides of the cylinder on top would be nice.
- Max doesn't really like a lot of seperate objects in a scene so making all lego's one editable mesh/poly would probably make the viewport run a lot smoother. (I say probably because my max crashed with an out of memory error when i attempted to attach 5000 lego's at once...)

keep up with the good work!
 
Old 08-25-2004, 01:31 AM   #8
f97ao
PolySpeeded!
 
f97ao's Avatar
CGSociety Member
Andreas Oberg
 
Join Date: Aug 2004
Posts: 1,023
Send a message via ICQ to f97ao Send a message via MSN to f97ao
Hiya, Very cool good work.

I modified the script somewhat and disabled screen redraw completely and also closed the command panel (withcui.commandPanelOpen ). It made the script twice as fast.

Also, if it's going to be even remotely close to fast in the viewport then the number of independent object must be far less. Just attaching them to one or possibly some more meshes will make it extremely much faster in the viewport.

Also, how do you make the geometry? It looked like you do a very great deal of things in the nested for loops, do you really have to do all of it all the times?
I haven't looked at the problem or the code in depth but wouldn't it make sense to do it this way:
- build the lego block, they are all the same size right?
- figure out where they should be placed, for example by movin in a 3d matrix over the object and checkning if there should be pieces or not.
- copy and attach the small blocks into the bigger mesh

It seems like it should be quite alot faster, but then again I haven't looked that closely at the problem

Anyway it creates great pictures even though it almost kills the computer.

I can upload my modifications if you like, but they should be easy for you to do if you like them.
Keep up the good work.

/Andreas
__________________
Rare - Lead VFX Artist
 
Old 08-25-2004, 12:42 PM   #9
Cthulhu
Piranha No.9
 
Cthulhu's Avatar
André Hotz
Lead Animator
Piranha-Bytes
Germany
 
Join Date: Jun 2002
Posts: 297
Send a message via MSN to Cthulhu
Hey, thanks for the comments!! I updated the script a little, it's a bit faster now (but unfortunatly not that much, i am still working on a faster method for scanning the object, but it needs more testing...)

changes:

- closed the command panel (great tip )
- sceneRedraw is now optional
- Number of Cylinder Segments can be changed
- Added chamfer for the blocks (but it slows down and gives way more polys)
- Blocks are attached to one object (except if you choose random colors)

Andreas, the way i create the blocks is nearly that what you wrote, i first split the source mesh into the segments, then, for each segment, i create a raster and scan each position if the source obj has vertices in this position (i am doing this with a volume select, which might be a big performance killer). The check for vertices is the main performance problem, because, depending on the number of blocks, there are really a lot checks to do. I am currently working on another method where i don't have to check every block, but it's still not working...

Arnage, nice pic although i don't know how many lego teapots i have seen the last days, because i also use these for testing
Attached Files
File Type: zip pb_Legolizer.zip (4.5 KB, 333 views)
__________________
Don't panic!

Piranha-Bytes
Risen 2
3dsmax scripts


 
Old 08-25-2004, 02:06 PM   #10
percydaman
VRay enthusiast
 
percydaman's Avatar
jack thompson
USA
 
Join Date: Aug 2002
Posts: 1,267
ok heres my first test. took nearly an hour to complete...lol





.
 
Old 08-25-2004, 02:31 PM   #11
DangerousCliff
Know-it-Some
 
DangerousCliff's Avatar
portfolio
Cliff Brannon
3D Generalist
San%2BAntonio, United%2BStates
 
Join Date: May 2004
Posts: 739
this is just the coolest script/plugin i've seen in some time! i cant think of a single practical use of it, but it gave me a thrill to just watch my models become a stack of legos. i showed it to my wife, a lego fan, and she also thought it was just the coolest thing her geeky husband has tried to show her in some time

now if it could update frame by frame, and we could make easy work of an effect simmilar to that White Stripes video.
__________________
-cliff
www.LeapOffaCliff.com
 
Old 08-25-2004, 04:45 PM   #12
Taoizm
Forum Monkey
 
Taoizm's Avatar
portfolio
Tony O'Dell
Director of Motion Design
Illumen
Evanston, USA
 
Join Date: Dec 2001
Posts: 1,606
Note to self.... 16hrs and only 2/3 complete on a million+ poly model. LOL Sadly I had to crash it out this morning so that I could work. Good news though.... it hadn't locked up or stalled. It was still crunching.
__________________
I love deadlines. I like the whooshing sound they make as they fly by.
-Douglas Adams

 
Old 08-25-2004, 06:30 PM   #13
f97ao
PolySpeeded!
 
f97ao's Avatar
CGSociety Member
Andreas Oberg
 
Join Date: Aug 2004
Posts: 1,023
Send a message via ICQ to f97ao Send a message via MSN to f97ao
Quote:
Originally Posted by Cthulhu
Andreas, the way i create the blocks is nearly that what you wrote, i first split the source mesh into the segments, then, for each segment, i create a raster and scan each position if the source obj has vertices in this position (i am doing this with a volume select, which might be a big performance killer). The check for vertices is the main performance problem, because, depending on the number of blocks, there are really a lot checks to do. I am currently working on another method where i don't have to check every block, but it's still not working...


ok, that is good, i was a little worried that you actually recreated the objects every time. I will think some on it. But I mean there _has_ has to be a faster way to do this, unfortunately one may have go go into c++ crunching to program a faster way to figure out where the blocks should be, since that is what is taking the most time. I think what may be a real performance killer is probably creating all the modifiers over and over. max is always very much faster if one can trick it into using only one modifier.
Also if you attach the blocks to one object, max may be much faster, it really hates many objects for some silly reason.
Keep it up!
/Andreas
__________________
Rare - Lead VFX Artist
 
Old 08-25-2004, 09:37 PM   #14
Active-boy
New Member
 
Join Date: Aug 2004
Posts: 1
hey

your desings are really cool
 
Old 08-26-2004, 04:13 AM   #15
cg219
Lord of the posts
 
cg219's Avatar
portfolio
Clemente Gomez
Freelancer/Student
Ozone Park, USA
 
Join Date: Aug 2004
Posts: 679
Send a message via AIM to cg219 Send a message via MSN to cg219 Send a message via Yahoo to cg219
Does it work with Max 5?
__________________
Artbycg
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:23 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.