Issue Resolved (WAS Re: Questions on COM Objects scripting)

Maan Hamze mmhamze at pleiades.net
Tue Sep 4 22:06:42 EDT 2001


Mark
You are not going to believe this.
Print Scene was yielding name Scene is undefined from as an error message in
a graphical window from within Breeze.
Then it occured to me :)
To run VBScript macros inside Breeze Designer we MUST run everything within
the body of Sub Main().  This means that somewhere within the program the
Main() procedure is hardwired.  So,

$VBScript
sub Main()
Code goes here
end sub

So, by mere luck I tried and ran this macro:

$Python
import win32traceutil
def main():    #just a dummy procedure
 return
print Scene
Sphere=13
Scene.CreateDefaultObject(Sphere)

And Voila! :)  The Trace collector printed:  <COMObject Scene>
And the whole thing is WORKING :) along with a nice sphere in the OpenGL
window.
Python scripting inside a povray modeller......  yeeeehaaaaaaaaa!
Apparently Neville Richards (the developer of Breeze Designer) in addition
to stating that the object name is scene (which is not correct since it is
Scene), had the main() function hardwired in the code (apparently he
believes that everything runs like VBScript).
I am going to let him know of this so that he can fix it since some people
were wondering in povray.programming how to get Python running inside Breeze
Designer.
Thanks for you help Mark.  It takes more than person sometimes to get
something running.
Maan

"Mark Hammond" <MarkH at ActiveState.com> wrote in message
news:3B95625C.8090701 at ActiveState.com...
> Maan M. Hamze wrote:
>
> > Now I have the complete picture.  Of course globals() is reporting the
> > object Scene before anything else is dispatched etc.....  So it is
already
> > there.
> > The problem is that I have tried every combination in the book including
the
> > direct use of scene, and Scene then Dispatch("Breeze.Scene") etc...
etc.....
> > scene, and Scene alike (without using any Dispatch) are causing Python
to
> > report that Scene (or scene for this matter) are undefined names.  This
is
> > strange since Scene IS there.  I may have an idea for what is happening!

> > Ok!  That is what I wanted to make sure of that PythonWin is not the
culprit
> > here.  So time to give the developer a call and let him know about this
:)
>
>
> What does "print Scene" yield?
>
> Mark.
>





More information about the Python-list mailing list