Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1036

script not finding the model in the scene

$
0
0

Hey Fellow Daz entousiast !

i'm following the tutorial here (https://www.deviantart.com/3dstrobist/journal/Transfering-Mixamo-Animations-to-Daz-Genesis-8-1-906594358) to import mixamo animation into Daz and apply it to a G8 model, but when I try to execute the script from this tutorial to fix the messed up rotation, i get this error:

TypeError: Result of expression 't2' [null] is not an object.
Stack Trace: ()@F:/daz2unity/g8mixamo fix.dsa:11
Error executing script on line: 11
Script executed in 0 secs 7 msecs.

it seems that the script is not able to grab t2 (the genesis 2 model)

here is the script if you dont need to go through the tutorial:

<span style="color:inherit"><em>function transferY(a,b){</em></span>

<span style="color:inherit"><em>var t8,t2;</em></span>

<span style="color:inherit"><em>t8=Scene.findNodeByLabel(a);</em></span>

<span style="color:inherit"><em>t2=Scene.findNodeByLabel(b);</em></span>

<span style="color:inherit"><em>var valr=t2.getYRotControl().getValue ();</em></span>

<span style="color:inherit"><em>t8.getYRotControl ().setValue (valr); </em></span>

<span style="color:inherit"><em>}</em></span>

<span style="color:inherit"><em>function transferX(a,b){</em></span>

<span style="color:inherit"><em>var t8,t2;</em></span>

<span style="color:inherit"><em>t8=Scene.findNodeByLabel(a);</em></span>

<span style="color:inherit"><em>t2=Scene.findNodeByLabel(b);</em></span>

<span style="color:inherit"><em>var valr=t2.getXRotControl().getValue ();</em></span>

<span style="color:inherit"><em>print (valr);</em></span>

<span style="color:inherit"><em>t8.getXRotControl ().setValue (valr); </em></span>

<span style="color:inherit"><em>}</em></span>

<span style="color:inherit"><em>var nframes=Scene.getAnimRange().getDuration ().valueOf()/Scene.getTimeStep().valueOf();</em></span>

<span style="color:inherit"><em>for( var fr = 0; fr &lt;= nframes; fr+=1 ){</em></span>

<span style="color:inherit"><em>Scene.setFrame( fr );</em></span>

<span style="color:inherit"><em>transferY(&quot;Left Thigh Twist&quot;,&quot;lThigh&quot;);</em></span>

<span style="color:inherit"><em>transferY(&quot;Right Thigh Twist&quot;,&quot;rThigh&quot;);</em></span>

<span style="color:inherit"><em>transferX(&quot;Right Shoulder Twist&quot;,&quot;rShldr&quot;);</em></span>

<span style="color:inherit"><em>transferX(&quot;Left Shoulder Twist&quot;,&quot;lShldr&quot;);</em></span>

<span style="color:inherit"><em>transferX(&quot;Left Forearm Twist&quot;,&quot;lForeArm&quot;);</em></span>

<span style="color:inherit"><em>transferX(&quot;Right Forearm Twist&quot;,&quot;rForeArm&quot;);</em></span>

<span style="color:inherit"><em>} </em></span>

thank you in advance for your help!


Viewing all articles
Browse latest Browse all 1036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>