September 5th, 2008
Here's a quick tip on how to initialize a struct in maxscript, when an instance of the struct is created:
(
-- This is just a sample of a struct that will be initialized
-- when an instance of it will be created.
-- For this demo, we'll populate the someArray variable with
-- some random numbers.
struct s_InitializableStruct (
someArray = #(), -- The default value is an empty array.
-- The init function is the function that determines what will
-- be initilized.
fn init =
(
someArray = for i = 1 to 10 collect (random 0 1000)
),
-- And this is the trick: use another variable, and assign to it
-- the "result" of the init function.
_init = init()
)
-- Create an instance of the struct
local structInstance = s_InitializableStruct()
-- Print the value of someArray
format "%\n" structInstance.someArray
-- As you can see, the someArray variable has been initialized with 10 random numbers
)
August 31st, 2008
This tip describes how to create multiple masks with Renderman. This technique comes to expand the simple RGBA as masks technique.
The problem with masks is usually anti-aliasing. If you use an object channel, it can only have a discreet value for each pixel, meaning the each pixel can hold only one object id value (as demonstrated in the image below,) and this means no anti-aliasing.
August 25th, 2008
In a recent job, I needed to create a dynamic user interface in Maya. I don't really like MEL, so I decided to go with Python. This was the first time I really used Python for anything.
One of the reasons I don't like MEL, is it kind of forces you to use global variables (using local ones becomes a pain if not impossible at some point.)
So, on I went and wrote something like this:
August 23rd, 2008
My shiny new blog
Published on August 23rd, 2008 @ 06:47:14 pm , using 126 words, 228 views
OK, so I finally got me a blog.
I have to admit I didn't really see the point in me having a blog until now, and I hope I'll find time to update it on a regular basis. What caused the change of heart was a recommendation on this thread on tech-artists.org.
In addition to that, recently, while researching stuff for a couple of jobs, I found some information that I thought others might find useful, but I was too lazy to start formatting a web page, uploading it and linking to it from my main site.
So I decided to blogging might be the way to go. We'll see how it goes.
I hope you'll find some useful stuff in here. Enjoy your stay.