And just for the fun of it, the same test in pure MEL:

// using camera command
string $p = "perspShape";
float $st = `timerX`;
for( $i = 0; $i < 10000; $i++ )
        camera -q -fl $p;
print `timerX -startTime $st`;

I get 0.23 seconds there.


Now using bare python and the default MEL cmds

// bare python maya.cmds
import time
import maya.cmds as cmds
a = time.time()
for i in range( 10000 ):
        cmds.camera( "perspShape", q=1, fl=1 )
b = time.time()
print b-a


give me 0.42 seconds as average



--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to