「シーン内のファイルパスを修正する」の編集履歴(バックアップ)一覧はこちら
「シーン内のファイルパスを修正する」(2009/01/20 (火) 12:32:45) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
フルイドキャッシュファイルのパスが、linuxで開くとおかしくなっていたので修正。
プロジェクトディレクトリより上のパスを消してます。
#code(){{
global proc fixFluidCache(){
string $nodes[]=`ls -type "cacheFile"`;
for($i in $nodes){
string $cachePath = getAttr( $i + ".cp");
string $buffer[];
$numTokens = `tokenize $cachePath "//" $buffer`;
if($numTokens==0)continue;
string $newCachePath = $buffer[1];
setAttr ($i+".cp") -type "string" $newCachePath;
}
}
fixFluidCache();
}}
python版。
#code(py){{
import maya.cmds as cmds
for i in cmds.ls(type='cacheFile'):
cachePath = cmds.getAttr( i + '.cp')
a=cachePath.split('//')
if len(a)==1:continue
cachePath = a[1]
cmds.setAttr( i+'.cp', cachePath, type="string")
}}
フルイドキャッシュファイルのパスが、linuxで開くとおかしくなっていたので修正。
プロジェクトディレクトリより上のパスを消してます。
mel版。
#code(){{
global proc fixFluidCache(){
string $nodes[]=`ls -type "cacheFile"`;
for($i in $nodes){
string $cachePath = getAttr( $i + ".cp");
string $buffer[];
$numTokens = `tokenize $cachePath "//" $buffer`;
if($numTokens==0)continue;
string $newCachePath = $buffer[1];
setAttr ($i+".cp") -type "string" $newCachePath;
}
}
fixFluidCache();
}}
python版。
#code(py){{
import maya.cmds as cmds
for i in cmds.ls(type='cacheFile'):
cachePath = cmds.getAttr( i + '.cp')
a=cachePath.split('//')
if len(a)==1:continue
cachePath = a[1]
cmds.setAttr( i+'.cp', cachePath, type="string")
}}