Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  VETScript    execute mtx code from VETScript
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
rik
Member
Posted
hi,

Is there a way to execute mtx code from VETScript ( like we do from javascript ).

something like;

myMtxCode = '<instance name="" ..........>';

execute( myMtxCode );


or a better way like this

myInstance = new Instance();
myInstance.name = "Rik";
..................

MTSScene.addChild( myInstance );

thank you in advance
 
Posts: 34 | Registered: March 17, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Hi,

You could use the following built in VETScript functions:

- loadMTXStr(‘MTX code’) : function returns 1 if success and returns 0 if invalid XML .The returned error string will be a string describing the error if invalid MTX (like action undefined).

- loadMTXFile(‘filename’) : start streaming the file and parse it when available.

Regards
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
rik
Member
Posted Hide Post
very thank you it works.
 
Posts: 34 | Registered: March 17, 2003Reply With QuoteEdit or Delete MessageReport This Post
rik
Member
Posted Hide Post
hi

This work perfectly
loadMTXStr('<MTSScene Version="330" ><MTSInstance Name="myCube">............</MTSScene>');


This not work

loadMTXFile("myCube.mtx");

I tried to load a file with inside this mtx code:

<MTSScene Version="330" >
<MTSInstance Name="myCube">
<Transform>
<Scale x="1" y="3" z="1" />
</Transform>
<MTSGeometry Name="MTSCube_1" Type="MTSCube" />
</MTSInstance>
</MTSScene>

could you give me an example?
 
Posts: 34 | Registered: March 17, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  VETScript    execute mtx code from VETScript