2010年9月27日

EXPO歸來

在上海玩了幾天,感覺EXPO還是蠻值得一去的。
這次是第二次去EXPO,和菜菜一起去的。



英國館裏面的種子

荷蘭館的餅,非常的甜和脆,人民幣10元

2010年9月26日

發現一個很給力的DEMO

像這種純技術DEMO演示真的很少見,pzMAN對PI的研究還真是深入,可以和maya做掛鉤,真不錯...

2010年9月22日

Matte Painting Studio - Interview_Vulkan

 

Matte Painting Studio - Interview_Vulkan
interview_vulkan.jpg


“The Volcano“ describes the scenario of a volcanic eruption in the Eifel and the damages for the people in the disaster area: A drama of a logistical and social emergency situation in the middle of Germany.
Both parts of the film have been a crowd-pleaser for over 10 million spectators.

2010年9月20日

用MEL打造系統時鐘

本篇文章我已上載至http://www.aboutcg.net/
地址為:
http://www.aboutcg.net/showthread.php?t=2203


零、 前言
這是一篇MEL簡單應用的教學文章,並非什麼高深的理論。對於現在互聯網的各種言論現象,有幾點不得不說的。如果能給各位讀者起到拋磚引玉的作用,筆者這裡會比較欣慰。能幫助學習maya及學習MEL的朋友提高技術是作者寫本篇教學的初衷。當然,如果您不喜歡,認為這個太easy了,也請幫忙進行改進批評。如果只是看著不爽,也免開尊口罵人,這樣不好。本篇文章用一個極簡單的模型:“時鐘”來闡釋MEL對動畫、特效方面的一些應用,不需要很高深的MEL功底,當然更不需要高深的模型能力。如果沒有什麼問題我們就開始吧。


MAYA分子打造群組翻浪特效

這個是我在aboutCG發過的一個教學,這裡就不再複製粘貼了,詳情請進:

http://www.aboutcg.net/showthread.php?t=2558

2010年9月19日

粒子顏色分佈控制技巧

看到帖子有網友問,粒子顏色分佈控制的相關問題,這裡發布一篇小教程。希望對問此問題的網友及需要此類問題解答的朋友會有所幫助。下面是結果圖:
在這裡我用的是一個Goal場景,簡單群集。相信大家也都會,這裡就不作贅述。

发几个常用窗口代码,需要的可以取用3

8.下拉选项optionMenu要配合menuItem一起来用,这个和window中menuItem道理是一样的;

global proc nrCreateYaoTestWindow()
{
    string $nrWindowName = "YaoTestWindow";
 
    if(`window -exists $nrWindowName`)
        deleteUI $nrWindowName;
 
    if(`windowPref -exists $nrWindowName`)
        windowPref -remove $nrWindowName;
 
    $nrWindowName = `window -t "YaoTestWindow" 
        -s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0 -tlb 0 -rtf 1
        -mnc ""
        -rc "" 
        $nrWindowName`;
 
        string $newObject1 = `formLayout -en 1 -w 262 -h 354 -nd 100 formLayout91`;
            string $newObject2 = `optionMenu -en 1 -w 107 -h 24 -l "火星时代" optionMenu12`;
                menuItem -l "教学";
                menuItem -l "网站";
                menuItem -l "图书";
            optionMenu -e -sl 2 $newObject2;
            formLayout -e -attachPosition $newObject2 "top" 12 0 -attachPosition $newObject2 "left" 13 0 $newObject1;
        setParent ..;
    showWindow $nrWindowName;
}
nrCreateYaoTestWindow;

9.数据滑条下面脚本中的floatSliderGrp是浮点形式,整数型用indSliderGrp;
global proc nrCreateYaoTestWindow()
{
    string $nrWindowName = "YaoTestWindow";
 
    if(`window -exists $nrWindowName`)
        deleteUI $nrWindowName;
 
    if(`windowPref -exists $nrWindowName`)
        windowPref -remove $nrWindowName;
 
    $nrWindowName = `window -t "YaoTestWindow" 
        -s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0 -tlb 0 -rtf 1
        -mnc ""
        -rc "" 
        $nrWindowName`;
 
        string $newObject1 = `formLayout -en 1 -w 262 -h 354 -nd 100 formLayout91`;
            string $newObject2 = `floatSliderGrp -en 1 -w 240 -h 22 -f 1 -min 0 -max 100 -fmn 0 -fmx 100 -s 1 -fs 0.1 -ss 1 -v 0 -dc "" floatSliderGrp1`;
            formLayout -e -attachPosition $newObject2 "top" 16 0 -attachPosition $newObject2 "left" 18 0 $newObject1;
        setParent ..;
    showWindow $nrWindowName;
}
nrCreateYaoTestWindow;


10.分割线主要是separator语法,菜单中也可以用;
global proc nrCreateYaoTestWindow()
{
    string $nrWindowName = "YaoTestWindow";
 
    if(`window -exists $nrWindowName`)
        deleteUI $nrWindowName;
 
    if(`windowPref -exists $nrWindowName`)
        windowPref -remove $nrWindowName;
 
    $nrWindowName = `window -t "YaoTestWindow" 
        -s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0 -tlb 0 -rtf 1
        -mnc ""
        -rc "" 
        $nrWindowName`;
 
        string $newObject1 = `formLayout -en 1 -w 374 -h 389 -nd 100 formLayout91`;
            string $newObject2 = `text -en 1 -w 32 -h 16 -l "文本1" -al "left" -fn "plainLabelFont" -rs 1 text2`;
            formLayout -e -attachPosition $newObject2 "top" 56 0 -attachPosition $newObject2 "left" 57 0 $newObject1;
            string $newObject3 = `separator -en 1 -w 300 -h 5 -st "out" -hr 1 separator6`;
            formLayout -e -attachPosition $newObject3 "top" 77 0 -attachPosition $newObject3 "left" 40 0 $newObject1;
            string $newObject4 = `text -en 1 -w 32 -h 16 -l "文本2" -al "left" -fn "plainLabelFont" -rs 1 text3`;
            formLayout -e -attachPosition $newObject4 "top" 89 0 -attachPosition $newObject4 "left" 57 0 $newObject1;
        setParent ..;
    showWindow $nrWindowName;
}
nrCreateYaoTestWindow;





发几个常用窗口代码,需要的可以取用2

5.文本text的MEL应用;



global proc nrCreateYaoTestWindow(){ string $nrWindowName
= "YaoTestWindow"; if(`window -exists
$nrWindowName`) deleteUI
$nrWindowName; if(`windowPref -exists
$nrWindowName`) windowPref -remove
$nrWindowName; $nrWindowName = `window -t "YaoTestWindow"
-s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0
-tlb 0 -rtf 1 -mnc
"" -rc ""
$nrWindowName`;
string $newObject1 = `formLayout -en
1 -w 262 -h 354 -nd 100
formLayout91`;
string $newObject2 = `text -en 1 -w 26 -h 16 -l "文本" -al "left" -fn
"plainLabelFont" -rs 1
text2`;
formLayout -e -attachPosition $newObject2 "top" 4 0 -attachPosition $newObject2
"left" 8 0 $newObject1; setParent
..; showWindow $nrWindowName;}nrCreateYaoTestWindow;



6.勾选主要语法及flag可以参见help中checkBox的MEL;

global proc nrCreateYaoTestWindow(){ string $nrWindowName = "YaoTestWindow"; if(`window -exists $nrWindowName`) deleteUI $nrWindowName; if(`windowPref -exists $nrWindowName`) windowPref -remove $nrWindowName; $nrWindowName = `window -t "YaoTestWindow" -s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0 -tlb 0 -rtf 1 -mnc "" -rc "" $nrWindowName`; string $newObject1 = `formLayout -en 1 -w 262 -h 354 -nd 100 formLayout91`; string $newObject2 = `checkBox -en 1 -w 84 -h 16 -l "Yes" -al "left" -v 0 -ed 1 -rs 1 checkBox36`; formLayout -e -attachPosition $newObject2 "top" 6 0 -attachPosition $newObject2 "left" 12 0 $newObject1; string $newObject3 = `checkBox -en 1 -w 84 -h 16 -l "No" -al "left" -v 0 -ed 1 -rs 1 checkBox37`; formLayout -e -attachPosition $newObject3 "top" 6 0 -attachPosition $newObject3 "left" 116 0 $newObject1; setParent ..; showWindow $nrWindowName;}nrCreateYaoTestWindow;






7.文本输入框注意textField的用法,很容易和intSliderGrp中的-field混淆;


global proc nrCreateYaoTestWindow(){ string $nrWindowName = "YaoTestWindow"; if(`window -exists $nrWindowName`) deleteUI $nrWindowName; if(`windowPref -exists $nrWindowName`) windowPref -remove $nrWindowName; $nrWindowName = `window -t "YaoTestWindow" -s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0 -tlb 0 -rtf 1 -mnc "" -rc "" $nrWindowName`; string $newObject1 = `formLayout -en 1 -w 262 -h 354 -nd 100 formLayout91`; string $newObject2 = `textField -en 1 -w 150 -h 22 -tx "" -fn "plainLabelFont" -ed 1 -ec "" -rfc "" textField140`; formLayout -e -attachPosition $newObject2 "top" 3 0 -attachPosition $newObject2 "left" 57 0 $newObject1; setParent ..; showWindow $nrWindowName;}nrCreateYaoTestWindow;









发几个常用窗口代码,需要的可以取用

最近有朋友很头疼写窗口的问题,其实写MEL做一些工具命令并不难,但是要写成窗口其实非常的繁琐费力,所以在解答那位朋友问题的同时,把一些常用的代码给大家,希望对写窗口非常头疼的朋友有帮助。1.单窗口主要语法及flag可以参见help中window的MEL

global proc nrCreateYaoTestWindow(){ string $nrWindowName =
"YaoTestWindow";
if(`window -exists $nrWindowName`) deleteUI
$nrWindowName;
if(`windowPref -exists $nrWindowName`) windowPref -remove
$nrWindowName; $nrWindowName = `window -t "YaoTestWindow" -s 1 -tb 1
-mnb
1 -mxb 1 -mb 0 -mbv 0 -tlb 0 -rtf 1 -mnc "" -rc ""
$nrWindowName`; string $newObject1 = `formLayout -en 1 -w 247 -h 354
-nd
100 formLayout79`; setParent ..; showWindow $nrWindowName;}
nrCreateYaoTestWindow;

2.标准按钮主要语法及flag可以参见help中button的MEL;

global proc nrCreateYaoTestWindow(){ string $nrWindowName
= "YaoTestWindow"; if(`window -exists
$nrWindowName`) deleteUI
$nrWindowName; if(`windowPref -exists
$nrWindowName`) windowPref -remove
$nrWindowName; $nrWindowName = `window -t "YaoTestWindow"
-s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0
-tlb 0 -rtf 1 -mnc
"" -rc ""
$nrWindowName`;
string $newObject1 = `formLayout -en
1 -w 247 -h 354 -nd 100
formLayout91`;
string $newObject2 = `button -en 1 -w 100 -h 22 -l "按钮1" -al "center" -c "" -aop
0 -rs 1
button19`;
formLayout -e -attachPosition $newObject2 "top" 6 0 -attachPosition $newObject2
"left" 9 0 $newObject1; setParent
..; showWindow $nrWindowName;}nrCreateYaoTestWindow;







3.列按钮会用button语法以后依次写就会逐渐向下排列下去;

global proc nrCreateYaoTestWindow(){ string $nrWindowName =
"YaoTestWindow"; if(`window -exists
$nrWindowName`) deleteUI
$nrWindowName; if(`windowPref -exists
$nrWindowName`) windowPref -remove
$nrWindowName; $nrWindowName = `window -t "YaoTestWindow"
-s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0
-tlb 0 -rtf 1 -mnc
"" -rc ""
$nrWindowName`;
string $newObject1 = `formLayout -en
1 -w 247 -h 354 -nd 100
formLayout91`;
string $newObject2 = `button -en 1 -w 100 -h 22 -l "按钮1" -al "center" -c "" -aop
0 -rs 1
button19`;
formLayout -e -attachPosition $newObject2 "top" 6 0 -attachPosition $newObject2
"left" 9 0
$newObject1;
string $newObject3 = `button -en 1 -w 100 -h 22 -l "按钮2" -al "center" -c "" -aop
0 -rs 1
button20`;
formLayout -e -attachPosition $newObject3 "top" 32 0 -attachPosition $newObject3
"left" 9 0
$newObject1;
string $newObject4 = `button -en 1 -w 100 -h 22 -l "按钮3" -al "center" -c "" -aop
0 -rs 1
button21`;
formLayout -e -attachPosition $newObject4 "top" 58 0 -attachPosition $newObject4
"left" 9 0 $newObject1; setParent
..; showWindow $nrWindowName;}nrCreateYaoTestWindow;




4.三排两列MEL没有新的,多主义左侧对齐数值就可以;


global proc nrCreateYaoTestWindow(){ string $nrWindowName = "YaoTestWindow";
if(`window -exists $nrWindowName`) deleteUI $nrWindowName; if(`windowPref
-exists $nrWindowName`) windowPref -remove $nrWindowName; $nrWindowName =
`window -t "YaoTestWindow" -s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0 -tlb 0 -rtf 1
-mnc "" -rc "" $nrWindowName`; string $newObject1 = `formLayout -en 1 -w 262 -h
354 -nd 100 formLayout91`; string $newObject2 = `button -en 1 -w 100 -h 22 -l
"按钮1" -al "center" -c "" -aop 0 -rs 1 button19`; formLayout -e -attachPosition
$newObject2 "top" 6 0 -attachPosition $newObject2 "left" 9 0 $newObject1; string
$newObject3 = `button -en 1 -w 100 -h 22 -l "按钮2" -al "center" -c "" -aop 0 -rs
1 button20`; formLayout -e -attachPosition $newObject3 "top" 32 0
-attachPosition $newObject3 "left" 9 0 $newObject1; string $newObject4 = `button
-en 1 -w 100 -h 22 -l "按钮3" -al "center" -c "" -aop 0 -rs 1 button21`;
formLayout -e -attachPosition $newObject4 "top" 58 0 -attachPosition $newObject4
"left" 9 0 $newObject1; string $newObject5 = `button -en 1 -w 100 -h 22 -l "按钮4"
-al "center" -c "" -aop 0 -rs 1 button22`; formLayout -e -attachPosition
$newObject5 "top" 6 0 -attachPosition $newObject5 "left" 144 0 $newObject1;
string $newObject6 = `button -en 1 -w 100 -h 22 -l "按钮5" -al "center" -c "" -aop
0 -rs 1 button23`; formLayout -e -attachPosition $newObject6 "top" 32 0
-attachPosition $newObject6 "left" 144 0 $newObject1; string $newObject7 =
`button -en 1 -w 100 -h 22 -l "按钮6" -al "center" -c "" -aop 0 -rs 1 button24`;
formLayout -e -attachPosition $newObject7 "top" 58 0 -attachPosition $newObject7
"left" 144 0 $newObject1; setParent ..; showWindow
$nrWindowName;}nrCreateYaoTestWindow;


记得有一朋友问怎么显示多边形顶点坐标,写了一MEL

忘了是哪个帖子问的了,刚想起来,用MEL写了一套,选择模型执行脚本就可以了。原理的就是用粒子position加上goal顶点,很简单,不知道是不是那位朋友需要的结果。string $selpoly1[] =`ls -sl`;int $numss[]=`polyEvaluate -v $selpoly1[0]`;print $numss[0];string $pps[]=`particle -jbp 0 0 0 -nj ($numss[0]) -jr 0 -c 1 `;select -r $pps[0];select -tgl $selpoly1[0] ;goal -w 1 -utr 0 -g $selpoly1[0] $pps[0];playButtonStepForward ;select -r $pps[0];saveInitialState $pps[0] ;playButtonStepBackward;setAttr ($pps[1]+".particleRenderType") 2;addAttr -is true -ln "pointSize" -at long -min 1 -max 60 -dv 2 $pps[1];addAttr -is true -ln "selectedOnly" -at bool -dv false $pps[1];addAttr -is true -dt "string" -ln "attributeName" $pps[1];setAttr -type "string" ($pps[1]+".attributeName") "position";