replaceReference using Python?

replaceReference using Python?

Anonymous
Not applicable
745 Views
1 Reply
Message 1 of 2

replaceReference using Python?

Anonymous
Not applicable
Hi,

does anyone know How to replaceReference using python code?
It seems to use file command loadReference option,
but I can't figure out How to give a file name to replace.

here is the destination of the flag;
----------------------------------------
loadReference(lr) string
This flag loads a file and associates it with the passed reference node. If the reference node does not exist, the command will fail. If the file is already loaded, then this flag will reload the same file.
If a file is not given, the command will load (or reload) the last used reference file.
---------------------------------------

リプレイスリファレンスするスクリプトをpythonで
書くやり方をご存知の方、教えてください。

cmds.file( loadReference='refRN' )

これだと、リプレイスされないのですが、リプレイスするファイルを指定するには
どういう風に記述すればいいのでしょうか・・・???

宜しくお願いします。

thank you
0 Likes
746 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Hi!
I found the solution.
This is a example.
cmds.file( r'C:/maya/projects/default/scenes/example.ma', loadReference=refRN)
Give a file Path to replace first,then place loadReference flag.
In MEL,file path comes after loadReference flag,so I was stuck with This for a few days..

thank you.


解決策がみつかりました。
ファイルパスをまず最初に指定する必要があったようです。

例
cmds.file( r'C:/maya/projects/default/scenes/example.ma', loadReference=refRN)

これでリプレイスリファレンスすることができました。
0 Likes