forked from sideeffects/HoudiniEngineForMaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhoudiniEngineAssetSync.mel
56 lines (46 loc) · 1.01 KB
/
houdiniEngineAssetSync.mel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
global proc
houdiniEngine_syncSelectedAsset()
{
string $assetNodes[] = houdiniEngine_getSelectedAssetNodes();
if(size($assetNodes) < 1)
{
error("Please select at least one houdiniAsset node to sync.");
}
for($assetNode in $assetNodes)
{
houdiniEngine_syncAsset($assetNode);
}
}
proc
syncAsset(string $assetNode, int $syncAttributes, int $syncOutputs)
{
string $cmd = "houdiniAsset ";
if($syncAttributes)
{
$cmd += "-syncAttributes ";
}
if($syncOutputs)
{
$cmd += "-syncOutputs ";
}
if(`getAttr ($assetNode + ".outputHiddenObjects")`)
{
$cmd += "-syncHidden ";
}
if(`getAttr ($assetNode + ".outputTemplateObjects")`)
{
$cmd += "-syncTemplatedGeos ";
}
$cmd += "-sync " + $assetNode;
eval($cmd);
}
global proc
houdiniEngine_syncAssetOutput(string $assetNode)
{
syncAsset($assetNode, 0, 1);
}
global proc
houdiniEngine_syncAsset(string $assetNode)
{
syncAsset($assetNode, 0, 0);
}