Well, rubyMEL is now a reality for the past couple of days. I have to admit I
was blown away at how well it blends with maya and how easy it was to get a
first prototype going.
Also some of ruby’s unique features (like the ability to re-define Kernel::` is
now helping to make blending the two languages even more seamlessly). It’s
also working really nicely with FOX (albeit Tk has proven not doable so far).
This will help bring Ruby into the radar of the film/vfx and 3d community in
general.
http://www.highend3d.com/maya/plugins/?section=utilities#2838
···
Anyway, I’m doing minor cleanups in the code and building up now a library of
Ruby code to OO mel window’s toolkit.
I have some code like:
def rowLayout(w = nil, *args)
rowLayout
if ! block_given?
raise "layout needs a block"
end
if ( w )
yield w
else
yield
setParent ..
end
end
which repeats on several places, and I would like to move the whole section
dealing with the block and yield into a separate function. However, I am
unsure if it is possible to have ruby propagate the block from one function to
another and to have it yield not to the previous call but two functions down.
That is, I want:
def layout(w = nil, *args)
if ! block_given?
raise "layout needs a block"
end
if ( w )
yield w
else
yield
setParent ..
end
end
def rowLayout(w = nil, *args)
rowLayout
layout(w,args)
end