Latest Comments

In response to: Initializing a struct in maxscript

Comment from: o.z [Member]
o.z

Actually, since 3ds Max 2010, it is also possible to use the on create event handler:
on create do [expression]

10/15/10 @ 05:30 am

In response to: Initializing a struct in maxscript

Comment from: rotem [Visitor]
rotem

great trick, I was just wondering how I could do that the other day :)

10/15/10 @ 12:06 am

In response to: Dynamic UI in Maya using Python

Comment from: o.z [Member]
o.z

Thanks for sharing this Matt!
I’ll have to test it sometime.

11/10/09 @ 03:41 pm

In response to: Dynamic UI in Maya using Python

Comment from: matt [Visitor]
matt

the python-in-maya group has an elegant solution i stumbled across today; use partial. lets you skip all sorts of class trickery (insert indents where appropiate, can’t html format comments…):

import maya.cmds as cmds
from functools import partial

def myFunc(set,*args):
print ‘you chose ‘, set

occSets = [’A',’B',’C',’D']
for i in occSets():
cmds.menuItem(l=i, c=partial(myFunc,i))

11/09/09 @ 10:37 pm

In response to: Creating multiple masks with Renderman

Comment from: Moritz Moeller [Visitor]
Moritz Moeller

What’s wrong with using TIF? Perfect for mattes, supports 16bit int and 32bit float precision, if needed. And any number of AOVs.

PSD support in 3Delight was meant for look dev, not use on actual shots.

.mm

10/04/09 @ 03:34 am

In response to: Creating multiple masks with Renderman

Comment from: chrysl666 [Visitor]
chrysl666
5 stars

Thank you very much .!! I never gonna got this by my self . thanks for sharing , this ideia gonna help me a lot .. cos render masks requests to comps is a big pain in the a** when you first have made this shader , did you have realize this from scratch ? or is a kind of regular method for mask used in CG studios ? .cos is the first time I have seen mask renders like this , one objs in each layer of OpenExr or Psd.. cheers !

09/12/09 @ 06:59 pm

In response to: Creating multiple masks with Renderman

Comment from: o.z [Member]
o.z

After quite a lot of testing with 3Delight, here are my conclusions:
1. 3Delight does not support multiple OpenExr layers at this point, so you have to use PSD instead (which is a bit disappointing, since their PSD implementation only supports 8bit images).
2. You have to make sure the size of the arrays is the same in both the SL and the RIB. This means you can’t just put a high value in the SL to avoid re-compiling (unless you also put a high number in the RIB, but that would be a waste for 2 reasons: memory usage and the number of wasted layers in the PSD file.)
3. 3Delight doesn’t seem to support the SL short writing: color “hsv” Os; so it needs to be changed to ctransform("hsv", Oi).

So, once we realize these issues, here are the changes that would make it work with 3Delight:

The shader should now look like this:

surface multiMatte (
uniform float id=0;
output varying float ids[4]=0;
){
Oi = Os;
Ci = Cs * Oi;
if (id != 0) {
ids[0] = id / (arraylength(ids) - 1);
ids[id] = comp(ctransform("hsv", Oi), 2);
}
}

In the RIB, the only change needed is to the additional display line. The output is now set to PSD, and note the quantize values to convert the float to 8bit values.
Display "+output_multi_layer.psd" "psd" "ids" "int[4] quantize" [0 255 0 255] "float dither" [0]

One more thing to note about the RIB, the number in this line:
DisplayChannel "varying float[4] ids"
_MUST_ be the same as the number in ids array declaration in the SL (in the line: output varying float ids[4]=0; )
If they are not the same, all layers will be rendered black.

Cheers,
o

09/12/09 @ 04:55 pm

In response to: Creating multiple masks with Renderman

Comment from: chrysl666 [Visitor]  
chrysl666
5 stars

very nice ideia for multimatte .. I`m trying to test it using 3delight , but with no sucess yet , seems that 3delight do not works with float[200] array type , any tip of it ? tnx for sharing !

09/03/09 @ 01:57 am

In response to: Dynamic UI in Maya using Python

Comment from: Kiaran Ritchie [Visitor]
Kiaran Ritchie
5 stars

Hey Ofer!!

I went Googling to see if anyone else had hit this little snag before. Low and behold my old friend has already solved it. Thanks a lot for putting this together!

Hope you’re still liking IM Digital. Jas and I are freezing up here in Canada-duh ;) Keep up the good work.

-Kiaran

03/01/09 @ 02:55 pm

In response to: Dynamic UI in Maya using Python

Comment from: o.z [Member]
o.z

Thank you for your comment.
The UIElements variable is a class variable (I had some formatting issues in this post, hope now it’s clearer.) However, it is not necessary to use the UIElements var, I only like to use in case I need to manipulate those UI elements later.
As for storing the event functions in an array (UIEventHandlers), this is necessary, because, as I explain in the post, if you don’t those functions will be garbage collected as soon as the creation function is done, and the event commands won’t work.

o

12/11/08 @ 06:03 am

In response to: Dynamic UI in Maya using Python

Comment from: Bård [Visitor]
Bård
5 stars

This helped me a lot.

I think that you really don’t need to store the func in an array. It’s better to let the UIElements be a class variable instead of a static (add self. prefix and put on top in __init__). Then you can pass func directly to the command parameter when creating buttons.

Thanks for sharing!

12/11/08 @ 12:58 am