Pages

Thursday, December 24, 2009

Happy Holidays!


I wish you happy holidays!

Wednesday, December 23, 2009

Sound Alarm


I recently wrote a script for a friend. The idea was simply count-down counter which to play sound when the time expires. The script required VLC media player. Maybe it's beneficial to someone else so I decided to upload the script to my site. You can find it at the bottom of my scripts page.

Tuesday, December 22, 2009

Neil Blevins lessons


Neil Blevins offer a very nice CG education section on him web site and of course he still update it.

Neil's Quote:
Life is about learning, from your own experiences and from helpful people along the way. Everything from a 3d tip to larger topics such as composition and color theory, this is my area to give back to the graphics community.

While several lessons deal directly with 3ds Max, I've tried to keep discussions as software unspecific as possible, so you won't have to be a Max user to get something from these lessons.

Monday, December 21, 2009

3DKingdom

3DK (3DKingdom) is another tutorials site for omnifarious software (including 3ds Max). Well... immediately makes a bad impression that no tutorials sub-categories (differentiation at least in software would be good) and the site search does not work.

Sunday, December 20, 2009

Translated Bounding Box 2


I recently wrote script named Translated Bounding Box which works fine on 3ds Max 2008 and higher. It's based on nodeGetBoundingBox() function (new in 3ds Max 2008). The function also available for previous Max versions through AVG (Avguard Extensions), but Dave ask me how to do this without AVG in 3ds max 9, so I wrote this cheat procedure snippet code. Maybe is not the best solution but I hope this help :)
for i in selection do (
c = snapshot i
c.transform = matrix3 1
d = dummy boxsize:(c.max - c.min)
delete c
d.transform = i.transform
d.pos = i.center
)

I think the "trick" is clear. I create a temp copy and reset it transform to can assign correct size to the dummy, and finaly align dummy to the original object. Well, maybe is good to optimize the code by turns undo off for temp object :)
for i in selection do (
local c
with undo off ( c = snapshot i )
c.transform = matrix3 1
d = dummy boxsize:(c.max - c.min)
with undo off ( delete c )
d.transform = i.transform
d.pos = i.center
)

P.S. -- Ultimately I decided to update the script and upload new version (0.2) at ScriptSpot.

Friday, December 18, 2009

whether tutorial-index.com is still alive?


Accidentally I stumbled on this site (tutorial-index.com) and I noticed that I can't open any tutorial link there. Hmm, don't like fishing site but more seems to be hacked. Did I missed something or the site is really just an empty shell?

Include/Exclude in FOR loops via WHERE

Here I'll focus on a specific MAXScript usage. It's about WHERE which looks like IF but can be used only in FOR loops and its very handy to filter out items from collections (for example - to exlude objects from selection).

SOME EXAMPLES:

-- collect objects which has "height" property
objs = for o in objects where \
hasProperty o "height" collect o

-- collect Multimaterials from scene
MMats = for m in sceneMaterials where \
classOf m == Multimaterial collect m

-- filter array and collect integer values to a new array
oldArray = #("a", 12, "b", 3.5, 7)
newArray = for i in oldArray where \
classOf i == integer collect i

--> #(12, 7)


Using WHERE in FOR loop is not something hard, its a logic play only, we just need to choose correct expression check suitable for your concrete case.

Into MAXScript Reference search for "TargetObject" and you'll find a good examples for how to filter the TargetObject out using "where".

FOR EXAMPLE:

-- old and bad style coding (SLOW):
for o in Lights do
try(o.rgb = random black white)catch()
-- Optimized code:
for o in Lights where classOf o != TargetObject do
o.rgb = random black white

So, shortly to say, we can filter our collection checking its items by class, categories or property, and this can be done tidiness and faster using WHERE.

MORE EXAMPLES (forum topics):
Basic script example
How to filter out shapes only in selection.

Collecting Photometric lights
Collect in array all photometric lights that are selected.

Remove specific type of object from scene
Delete all PF_Source in the scene.

Select objects with 0 vertices
How to exclude (delete or deselect) objects with 0 vertices (helpers objects).

Wednesday, December 16, 2009

Particle Flow Dispersion Effect


In this tutorial (by anonymous author) is shown dispersion effect made using Particle Flow and Gradient Ramp map.