please leave your comment

Thursday, December 16, 2010

FootPrint with Maxscript


FootPrint with maxscript from Ishak Suryo L on Vimeo.
This is my latest R&D in 3dsmax with Maxscript. It's still prototype, and that's why i have not release yet this script. I did this for colling down and fun after finishing a few project last month. The idea of this is actually how to make mesh deformed after colliding with other object. The collider can be rigid or even organic object. Initially there are some method i would like to try. But for some reason i choose using animatevertex feature in editable mesh to save the animation and deformation data.

This is the step by step process:
- Define the Collider and ground object
- Save the initial vertex position of the ground (so we can reset later)
- Collecting list of the vertex that hit by the collider (so we don't have to calculate the whole vertex on the ground object)
- Set the maximum depth ( this value will be used as starting point to firing ray on the Z coordinate)
- Run Calculation every frame trough the animation and chek using intersectRay from ground vertex to collider mesh.
- if the ray was hit to the collider then update the vertex Z position using the Hit(ray) Z position.
- set key to the vertex if there are no intersection on it.

After finished we can check the result. if we want apply the result for editable_poly object then we can use the advantages of point_chace modifier. as long the source object is same( has same vertex ID) it won't be a problem at all. Dont forget to add turbosmooth or relax modifier if you get sharp edges. There is another check before doing calculation are to check the animation speed. If the collider object moving too fast sometime it will jump in some area. This is the reason we should adjusting subframe sample for calculation to get nice result.
See the image below for better understanding.
Later we can try to add or combine with some particle or bump effects to enhanced the realism.

Sunday, August 15, 2010

XSI SymMapping_Tools for Max

click here to read more  or click here to download the script
Its been long time since my last post. And now i have time to update my blog. This is script that i made while doing on a commercial project. Basically the project require me to create a lot of morph target. And the problem is Max(2009) doesn't have good way for creating symmetrical modeling.in simple case like when we want to create left eyebrow angry and then we want to achieve the same result for the right side. One of the way that i found out there is by using skinwrap modifier to deform original mesh with mirrored mesh that already have morpher modifier. For me its a bit long way to achieve something that commonly needed by alot of user like me personally. Thats one reason i made this tool. Basically what this tool does is finding the pair of each vertex and then save it as array in to the file.vertex that has no pair will use their own id as a pair data (such as vertex in the middle mesh or in nonsymetrical geometry). After we have the data then we can easily use it for many operation to manipulate the model. as long the mesh is still using the same source we can use the data anytime. I hope this tool will make the user much more focus on tweaking the model and working faster. If you find any bug or maybe suggestion please sent me an email. i will try to fix it immedietly.

Thursday, May 20, 2010

R&D Schooling fish in 3dsmax

After a few days doing some test, finally i found the way to create auto turning animation for the fish. This is still very simple solution using bend modifier driven by script controller, but in my opinion its really effective way for massive object. Because after i satisfy with the result i can collapse the animation and convert to keyframe to reduce the computation. Its not finished yet, i will update in some part to improve the quality.

Thursday, May 6, 2010

Random Sequence without Repetition (Maxscript)

In practical use of scripting sometimes we really often using Random function to generate random numbers. But in some cases usually we also need to get random number in sequence without any repetition. for example how you get 5 sequence number without any same number in your result? By using "random 1 5" you will always have a chance to get the same number. Then how is the solution for this task...? After playing around little bit finally i found this solution:

-- CREATE FUNCTION
fn RandomSequence Num=
(   
    theSequence = for i=1 to Num collect i    -- Create Initial Sequence
    theResult =#() -- Create empty array for the result
   
    -- Loop
    range = theSequence.count+1
    for j=1 to theSequence.count do
    (   
        range -=1
        rand = random 1 range -- Create  random  start with higher range value until empty
        append theResult theSequence[rand]    -- Insert to the Result
        index = finditem theSequence theSequence[rand]    -- Check the index of result in thesequence
        deleteitem theSequence index     -- Then delete item in theSequence with indexed number
    )    -- End Loop
    theResult  -- Output the result
)

RandomSequence 10 -- Call the function


----------------Result---------------------
#(7, 8, 10, 5, 2, 4, 3, 6, 1, 9)


Every time you execute this function it will always generate new random number in sequence without any repetition. You can try use this number to manipulating object properties, transform, etc.

Wednesday, May 5, 2010

Welcome to maxscript

Yeah..!!! Welcome to maxscript. That's right, Since i am using 3dsMax in my current company, i have to start learning maxscript to make my life easier when facing some problem.Although sometimes its take time to develop new things with script, but i realize that bigger things sometime comes with small thing that you get from the experience in the past. So there is nothing wrong with doing some trial and error every time you have problem that need a good solution. Scripting is not the main solution for every problem, sometimes its faster to do manually rather than developing new script when dealing with the deadline. But its also a good way to use script for everyday use(like repetitive task) or for future solution increasing your speed in productivity. For example:  In a simple case we can easily align box to another object like sphere. But how if you have to align 100 box to another 100 sphere? would you do this by hand? By using the script we can ask your computer to do the job which much more efficient in a just a few line of code.
Initially i am not a technical guy (Trust me, i really weak in math), But i really love to do some R&D to know how things work. every time i did, i've got new knowledge when dealing with problems. Sometimes it will push me to find some reference or source, or even i must try to remember some lesson that i've got in high school. Ok, i thinks that's enough for introduction...
For now on, i will share some of my knowledge here about maxscript in my spare time. :)

Wednesday, April 21, 2010