0

我试图在 Maya 中的特定属性上设置的以下表达式有什么问题。所有只是不同的方法。

表达式 1:

directionalLightShape1.intensity = sqrt(noise(time));

错误:

expression -s "directionalLightShape1.intensity = sqrt(noise(time));"  -o directionalLightShape1 -ae 1 -uc all ;
// Error: line 0: Invalid argument(s) for sqrt. // 
// Error: line 0: An execution error occured in the expression expression1. // 
// Result: expression1 // 
// Error: line 0: Invalid argument(s) for sqrt. // 
// Error: An execution error occured in the expression expression1. // 

表达式 2:

float $n = noise(time);
directionalLightShape1.intensity = sqrt($n);

错误:

expression -e -s "float $n = noise(time);\ndirectionalLightShape1.intensity = sqrt($n);"  -o directionalLightShape1 -ae 1 -uc all  expression1;
// Error: line 1: Invalid argument(s) for sqrt. // 
// Error: line 0: An execution error occured in the expression expression1. // 
// Result: expression1 // 
// Error: line 1: Invalid argument(s) for sqrt. // 
// Error: An execution error occured in the expression expression1. // 

表达式 3:

float $n = sqrt(`noise time`);
directionalLightShape1.intensity = $n;

错误:

expression -e -s "float $n = sqrt(`noise time`);\ndirectionalLightShape1.intensity = $n;"  -o directionalLightShape1 -ae 1 -uc all  expression1;
// Error: line 0: Invalid call to "noise".  Check number and types of arguments expected by the procedure. // 
// Error: line 0: An execution error occured in the expression expression1. // 
// Result: expression1 // 
// Error: line 0: Invalid call to "noise".  Check number and types of arguments expected by the procedure. // 
// Error: An execution error occured in the expression expression1. // 

表达式 4:

float $n = noise(time);
directionalLightShape1.intensity = `sqrt $n`;

错误:

expression -e -s "float $n = noise(time);\ndirectionalLightShape1.intensity = `sqrt $n`;"  -o directionalLightShape1 -ae 1 -uc all  expression1;
// Error: line 1: Invalid argument(s) for sqrt. // 
// Error: line 0: An execution error occured in the expression expression1. // 
// Result: expression1 // 
// Error: line 1: Invalid argument(s) for sqrt. // 
// Error: An execution error occured in the expression expression1. // 
4

2 回答 2

1

如果您(noise(time) + 1)/2看到使用abs.

根据应用程序,范围的截断可能是一个问题。

于 2013-09-14T22:54:58.630 回答
0

所有所述表达式的问题在于noise返回负值。当喂给它时,sqrt自然应该抛出一个起初并不明显的错误。

更换noise(time)解决abs(noise(time))了问题。

于 2013-09-14T11:49:03.857 回答