显示标签为“Maya”的博文。显示所有博文
显示标签为“Maya”的博文。显示所有博文

2009年5月23日星期六

autorig的maya前端

highend3d上的链接
http://highend3d.com/maya/downloads/mel_scripts/character/5753.html

这里是论文,MIT的phd啊
http://www.mit.edu/~ibaran/autorig/

linux和macosx:
highend3d上只提供了win版的,前端是python写的,不过需要autorig的执行文件。autorig的程序叫Pinocchio,源码可以从http://github.com/elrond79/Pinocchio/tree/master下载。makefile有点小问题,需要自己加tab。

2008年12月14日星期日

定制右键标记菜单

在dagMenuProc.mel的dagMenuProc过程定义了各种不同物体的右键标记菜单。
比如,在
if (($object == "CubeCompass"))
{
createViewCubeMenuItems($parent);
return;
}
的下面加入:
if(`attributeExists "extNode" $object`){
print ($object+" RMB menu proc calls!\n");
return;

}

重新加载dagMenuProc.mel,新建一个物体,增加一个属性:extNode,类别任意。
再这个物体上使用右键菜单时,就会输出OBJECT NAME RMB menu proc calls!
如果在$parent上加入菜单,就可以显示菜单了。

技术细节:
dagMenuProc并没有出现在文档中,更详细的信息也没法得到,从网上搜索到的信息表明rmb标记菜单是附加在dag属性上的。
Maya's dagMenuProc script controls Right-Mouse-Button clicking on objects in the model viewports.

2008年5月2日星期五

Duncan提供的几个nCloth的tips

Here are a few points on breakable nCloth:
-If you select verts, edges or faces when making a tearable constraint then it can only tear at those regions, which is more efficient.

-The detach component code internally detachs based on vertices, not edges, so the tearable surface constraint will give "ragged" edges. You can make it more efficient by carefully modelling your own detach edges. Basically initially create your model with all the edges you wish to be breakable being border edges. 

-For large rigid chunks you may wish to use separate objects, each with its own nCloth. Constrain the chunks together with a component to component constraint with glueStrength set and the weld method. Then combine, merge vertex, smooth normals and possibly extrude downstream of the nCloth nodes. This allows you to use rigidity on the nCloth nodes(otherwise you need to use high bend/stretch levels which is less efficient). You can also turn off self collision on the nCloth nodes, because they are internally rigid. If instead you were using one cloth node for all the chunks then you would need self collision so that the chunks could intercollide.

-There is bend stiffness on the constraint node, which can be used for glass shatter sorts of effects. However this requires that you have edge nComponents. If you use standard breakable surface setup with edge components it gets extremely slow to use the constraint bend stiffness for a complex surface. We are currently looking at fixing this problem, as it makes it hard to do rigid shatter effects.

Duncan

2008年4月28日星期一

关于mr framebuffer输出openEXR中的通道

openEXR是ILM设计的一种图像格式,可以比较灵活的存储图像数据,最近的这个demoreel中原始的图像序列都用exr了,唯一的缺点就是体积太大,一张640*360的rgba 4*32bit的图竟然要3.5MB的空间。
这里要说的是exr的另一个问题,在maya中用输出exr格式的图像时,sw渲染器不支持exr,这里说的是mr。如果在mr的framebuffer中设置成输入rgba,那么在生成的exr文件中,rgba通道都会用A B G R的名字表示。但是,如果要单独输出motion或者alpha的话,通道的名字就成了mi_buffer_###,###就是每一帧的序列号,也就是说每一帧的通道名称都是不一样的。
这样,在合成的时候就有点麻烦了。nuke的reader节点可以正常的预览的这种exr序列,创建reader节点之后,它是按通道来读取exr序列的,每都一帧,都会创建一个新的通道,可viewer节点却是按照通道来显示的,还有channel组里的节点也都是如此,这样一来每一帧改变一次通道。
这个问题解决起来也简单,只要该一下exr文件通道的名字即可,以framebuffer输出motion向量为例。

用一个16进制编辑器打开一个exr文件,可以看到从offset:0x1CL开始,就是通道和分量的名字,这里我们只需要修改0x26L开始的帧编号,只要把整个exr序列中的帧编号都替换成一个固定的字符串即可。我写了一个简单的程序来完成这个工作。

#include
#include

int main(int argc, char *argv[]){
char *str="mt0";

FILE *fp;
fp=fopen(argv[1],"rb+");

fseek(fp,0x26L,0);
fwrite(str,sizeof(char),3,fp);

fseek(fp,0x46L,0);
fwrite(str,sizeof(char),3,fp);

fseek(fp,0x66L,0);
fwrite(str,sizeof(char),3,fp);

fclose(fp);
return 0;

}


下面是修改后的exr文件头,我把帧编号都改成了mt0。

2008年2月13日星期三

maya fluid cache笔记1



FOR4 CACH <------------ This exists for all disk cache
. STIM startTime (TanimTime)
. ETIM endTime (TanimTime)
. TYPE isOverSampling (Tboolean)
. RATE samplingRate (TuInt32)
// block #1
FOR4 FLUD
.TIME currentTime (TanimTime)
.WRES widthRes (Tint32)
.HRES heightRes (Tint32)
.DRES depthRes (Tint32)
.NUMD numDensVal (Tint32)
.DENS densities (Tfloats)
.NMVX numVelX (Tint32)
.NMVY numVelY (Tint32)
.NMVZ numVelZ (Tint32)
.VELX xVelocities (Tfloats)
.VELY yVelocities (Tfloats)
.VELZ zVelocities (Tfloats)
.NUMT numTemperature (Tinit32)
.TEMP temperatures (Tfloats)
.NUMR numReaction (Tinit32)
.REAC reactions (Tfloats)
.NUMC numColors (Tint32)
.COLR RedColors (Tfloats)
.COLB BlueColors (Tfloats)
.COLG GreenColors (Tfloats)
.NUMU numTexCoord (Tint32)
.TEXU uCoords (Tfloats)
.TEXV vCoords (Tfloats)
.TEXW wCoords (Tfloats)
// block #2
FOR4 FLUD
........
Note:
TanimTime: an unsigned int, units are 1/6000 second
Tfloats: an array of floats, the count is specified by the
preceding "num" tag.

以上引用自maya文档。

下面是一个4x4的2d流体的cache,只有density部分。


用STIM作为例子来说明,53 54 49 4D 00 00 00 04,是STIM段的标识,而后面的00 00 00 FA才是SITM段的数据。00 00 00 FA是一个无符号整数,作为一个整数读入之后,是FA 00 00 00的顺序,这与本意是相反的(开始我以为是mac才这样,后来发现在linux上也是如此)。在读入之后,需要直接通过内存地址修改数据的顺序。
后面的DENS数据段里的42 C8 00 00,在内存中,应该是(低地址)00 00 C8 42(高地址)的顺序。

2007年12月14日星期五

qWrap包裹变形


http://www.qarl.com/qLab/?p=29



不是很好用,貌似只适合高模。自己试了试,效果不尽人意。

Maya 2008 API Template for Xcode

http://www.thomascraigen.com/tools/index.html
开发maya插件的xcode模板,不多说了。

2007年8月20日星期一

Autodesk area的blog,duncan's corner和mayalicious

流体spec
http://area.autodesk.com/blogs/blog/7/

Mel spec
http://area.autodesk.com/blogs/blog/4/

2007年7月27日星期五

maya笔记 2007-7-27

添加和删除粒子

添加粒子:
emit -o particle1;
emit -object particle1;

删除粒子:
在maya中,已经产生的粒子是无法被删除的,在文档中提到,如果要“删除”一个粒子,只能把生命值设置成0,同时粒子的ID不会被回收。

particle -e -or 2 -at lifespanPP -fv 1.0 particleShape1 ;
particle -edit -order 2 -attribute lifespanPP -floatValue 1.0 particleShape1 ;

per-particle属性都是在数组中保存的,但是却不能通过a[n]的方式直接操作。

2007年5月13日星期日

Maya8.5 linux 32bitbug

Bug多多。
1. q/w/e..marking menu,如果在lmb放开之前把键盘放开的话,crash...
2. 如果选中一个物体,然后打开channel editor,crash...

2007年5月2日星期三

Maya笔记 1

projection贴图的alpha通道问题。
在使用layeredTexture的时候发现的这个问题。projection的image参数只接受图像的RGB参数,然而在输出的时候,却提供alpha的输出,如此,在制作复合贴图的时候,图像的alpha参数就无法正确传递。
workround:把图像的alpha连接到projection节点的alpha offset上,projection的alpha gain设置为0。如果图像没有warp的话,图像的default color和projection的default color都要设置为0,避免“膏药”的效果。

Maya8.5的文档中有一处错误,transferAttribute的sampleSpace参数,文档中说3是component-based,实际上应该是4,3会导致程序崩溃。