camera adjust (マクロスクリプト)


■Install (3dsmax2014にて検証)
C:\Users\s_yoshimoto\AppData\Local\Autodesk\3dsMax\2014 - 64bit\ENU\usermacros



■以下、マクロスクリプト
Monkey_CamFrameAdjust.mcr
--------
--------

/*
----------------------------------------------------------------------------------------
-- Script Name: MonkeyTools------CamFrameAdjust.mcr
-- Version: v1.1
-- Started:       24 May 2011
-- Last Modified: 16 July 2011
-- Code by: Saori Yoshimoto
----------------------------------------------------------------------------------------
Tip: To adjust the camera frame
1.camera select
2.scripts run
*/


macroScript CamFrameAdjust
category:"Monkey_scripts"
toolTip:"CamFrameAdjust"
(
fst = getUserProp $ "camStart"

fen = getUserProp $ "camEnd"



animationRange = interval fst fen
)

directory backup python plan memo


os.path.walk(python2.x, 3.xでは廃止。)

flwのタブルのリストを取得。os.walk 全てスキャんして、ターゲットをソート、しゅとく。  
 
ディレクトリをつくりつつ、ファイルをコピー。

windows os: UNC表記のネットワークドライブでbatchを実行する。


batchの先頭に下記を表記。uncのドライブまで移動してくれる。

pushd %~dp0


■参考HP
http://d.hatena.ne.jp/bontaki/20060722/1153535591

PC_reload (複数選択 point cache reloads)


-------------------------------+---------------------------------------------------------
-- Script Name: MonkeyTools------multi_cache_reload.ms
-- Started:       21 Nov 2014
-- Last Modified:  21 Nov 2014
-- Code by: Saori Yoshimoto
-- reload PC
----------------------------------------------------------------------------------------

out_filePath = "c:/3dsmax/scene/PC/"

obj = #()
count = 1
for selRow in selection do
(
obj[count] = selRow
count += 1
)

print count

for currentObj in  obj do
(
 --//Initialize File Path

select currentObj


out_fileName =  out_filePath + currentObj.name as string + "/" + currentObj.name as string + ".xml"

print out_fileName

 currentObj.modifiers[#Point_Cache].filename = out_fileName

cacheOps.Reload currentObj.modifiers[#Point_Cache]
gc()

)

PC_load (複数選択 point cache loads)


-------------------------------+---------------------------------------------------------
-- Script Name: MonkeyTools------multi_cache_load.ms
-- Started:       29 Jan 2013
-- Last Modified:  29 Jan 2013
-- Code by: Saori Yoshimoto
--?????????1???WPC?????????????
----------------------------------------------------------------------------------------

recStart = 1381
recEnd = 2221
recsampleRate = 1
out_filePath = ""c:/3dsmax/scene/PC/"

for i in selection do
(
 --//Initialize File Path

out_fileName =  out_filePath + i.name as string + "/" + i.name as string + ".xml"
print out_fileName

--//Set PointCache() -- local cordinate --

addModifier i (pointCache()) --before:(i.modifiers.count)
i.modifiers[#Point_Cache].filename = out_fileName
i.modifiers[#Point_Cache].fileCount = 1
i.modifiers[#Point_Cache].recordStart = recStart
i.modifiers[#Point_Cache].recordEnd = recEnd
i.modifiers[#Point_Cache].sampleRate = recsampleRate

)

PC_rec (複数選択 point cache records)


----------------------------------------------------------------------------------------
-- Script Name: MonkeyTools------multi_cache_rec.ms
-- Started:       30 Nov 2014
-- Last Modified:  30 Nov 2014
-- Code by: Saori Yoshimoto
----------------------------------------------------------------------------------------

recStart = 1381
recEnd = 2221
recsampleRate = 1
out_filePath = "c:/3dsmax/scene/PC/"

for i in selection do
(
--//Initialize File Path
 --recNum = execute( substring i.name 14 2 )


out_fileName =  out_filePath + i.name as string + "/" + i.name as string + ".xml"

make_dir = "python.Execute \"os.makedirs('" + out_filePath + i.name as string + "')\""

python.Execute "import os"
execute make_dir

print make_dir
print out_fileName
print i

--//Set PointCacheWSM()
 --deleteModifier i 1
addModifier i (pointCacheWSM())

i.modifiers[#Point_Cache_Binding].filename = out_fileName
i.modifiers[#Point_Cache_Binding].fileCount = 1
i.modifiers[#Point_Cache_Binding].recordStart = recStart
i.modifiers[#Point_Cache_Binding].recordEnd = recEnd
i.modifiers[#Point_Cache_Binding].sampleRate = recsampleRate

cacheOps.RecordCache i.modifiers[#Point_Cache_Binding]
gc()

deleteModifier i 1

)

/* MEMO mkdir by python scripts
--python.Execute "import os"
--python.Execute "os.makedirs('//VIVACE/RenderCache/EV-USJ/s_yoshi/max/PC/EVA01_rev2/test3')"
*/

Animation Collector Copy method(link)


http://www.scriptspot.com/forums/3ds-max/general-scripting/copy-and-past-controller


---
ex.) point cache -> Plaback Type -> Playback Graph を他のpoint cache、同様の項目にインスタンスコピーする。(接続する)

$Sphere002.modifiers[#Point_Cache_Binding].playbackType = 3

$Sphere002.modifiers[[#Point_Cache].playbackFrame.track = $Sphere001.modifiers[#Point_Cache_Binding].playbackFrame.track