2011年9月1日 星期四

[Lua] 筆記 to 28

-- Example 18   -- if elseif else statement

c=3
if c==1 then
    print("c is 1")
elseif c==2 then
    print("c is 2")
else
    print("c isn't 1 or 2, c is "..tostring(c))
end


-- Example 19   -- Conditional assignment.
-- value = test and x or y

a=1
b=(a==1) and "one" or "not one"
print(b)

-- is equivalent to
a=1
if a==1 then
    b = "one"
else
    b = "not one"
end
print(b)


-------- Output ------

one
one


-------- Output ------

c isn't 1 or 2, c is 3



-- Example 20   -- while statement.

a=1
while a~=5 do -- Lua uses ~= to mean not equal
    a=a+1
    io.write(a.." ")
end


-------- Output ------

2 3 4 5
Press 'Enter' key for next example


-- Example 20   -- while statement.

a=1
while a~=5 do -- Lua uses ~= to mean not equal
    a=a+1
    io.write(a.." ")
end


-------- Output ------

2 3 4 5


-- Example 22   -- for statement.
-- Numeric iteration form.

-- Count from 1 to 4 by 1.
for a=1,4 do io.write(a) end

print()

-- Count from 1 to 6 by 3.
for a=1,6,3 do io.write(a) end


-------- Output ------

1234
14


-- Example 23   -- More for statement.
-- Sequential iteration form.

for key,value in pairs({1,2,3,4}) do print(key, value) end


-------- Output ------

1       1
2       2
3       3
4       4


-- Example 24   -- Printing tables.
-- Simple way to print tables.

a={1,2,3,4,"five","elephant", "mouse"}

for i,v in pairs(a) do print(i,v) end


-------- Output ------

1       1
2       2
3       3
4       4
5       five
6       elephant
7       mouse




2011年8月29日 星期一

Cry - Flow Graph 筆記

Done與Succeed/Fail的差別:Done是不管Succeed/Fail都會送出

在system.cfg中加速g_tpview_force_goc=1可防止攝影機穿越物件

2011年7月22日 星期五

Bodypaint : 直接把圖貼到模型上

假設模型上已有一部分貼圖是可以移植到另一個部位上,或者有圖片想直接貼到模型貼圖上
可先將設些部份Ctrl+C至剪貼簿,開啟Bodypaint後,切到你要的角度Ctrl+V,
就會把剪貼簿裏面的圖像直接貼到模型上,此時Bodypaint會進入投影模式,
要繼續繪製時記得取消,否則接縫處會有縫隙。

2011年7月19日 星期二

3ds Max : Skin Warp

當有類似的模型已經skin,可以利用skin warp modifier把權重copy到還沒skin的模型上

2011年7月18日 星期一

Maxscript : 把Rollout顯示出來, script加入介面中

把Rollout顯示出來
rf = newRolloutFloater "Title" 500 520
addRollout rolloutname rf

script加入介面中
macroScript name category:"category" toolTip:"tooltip"
(on Execute do
  fileIn "$Scripts\script.ms"
)

2011年7月17日 星期日

Maxscript : Select All Children by Janus

fn selhi =
(
if $ != undefined do
(

Maxscript : re Skin by Janus

skinOps.SaveEnvelope $.modifiers[#Skin] exportPath -- Save envelope
maxOps.CollapseNode $ off -- Collapse all
modPanel.addModToSelection (XForm ()) -- Add modifier

2011年7月14日 星期四

Maxscipt : 自動置換貼圖 by Janus

nameStr = $.name as string
modelName = substring nameStr 1 4
texturePath = "D:/....../"+modelName+"/"+modelName+"a....._1.dds"

2011年7月4日 星期一

3dsMax Biped Animating Tutorial

Part 1/3 of full live recorded animation video tutorial with polish comment. Duration 23 min.
animator: Lukasz Kubinski
Dash Dot Creations

3dsMax註冊畫面無法顯示的解決方法

最乾脆的方法如下
將所有註冊時會用到的RT?.html都加上<!-- saved from url=(0016)http://localhost -->,成為被信任的網頁即可

2011年7月1日 星期五

縮放物件所造成的問題和Xform的用途

當直接對物體進行非等比的縮放時,會造成物件的vertices在不同軸向上承受不同的縮放比例,因此當旋轉pivot的時候,就會影響到物件形狀的正確性。