Importing Models with SimpleWorld & registering events

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Importing Models with SimpleWorld & registering events

Holz, Marc
Importing Models with SimpleWorld & registering events

Hi,

I have some problems with importing some *.ase files with the SimpleWorld demo.
I'm using the option "Import object" from the tools menu  and the import code from the  Menui-Tweak Package "CroquetMenuProject>menu-actions>actionImport"

is failing sometimes. I seems the be depended on the filesize
I'm basically encountering problems with larges *.ase files, e.g. with a file size like 20 mb or similar.

Here'a a snippet of the code thats failing (taken from actionImport):

        " Add to the current space. "
        replica := hand world ownerMorph harness avatar replica.
        root := replica future root.           
        root future addChild: eventFrame.

The object "root" in the second line (defined as TFarRef) is actually nil and I don't know why. Afterwards the call of "addChild" is faillng.

I have to admit that I'm not very fluent in Smalltalk but I seems to me that rendering of my import takes longer than
the TFarRef can get initialized.

I'll appreciate any suggestions very much since I would love to have some registered events on my imported object.

I added some screendumps of the debugger output.


Best Regards,

Marc Holz

<<debugger.JPG>> <<debugger2.JPG>> <<debugger3.JPG>>


debugger.JPG (88K) Download Attachment
debugger2.JPG (81K) Download Attachment
debugger3.JPG (141K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Importing Models with SimpleWorld & registering events

Howard Stearns
Could this be because of the self-destruction of avatar replicas?

Each avatar replica in the collaboration (including yours) will remove itself
from the scene if hasn't been told recently by it's non-replicated half that it
is still alive.  This is what makes bunnies disappear a little while after
someone leaves.

If the file load (executed in an off-island harness process) is delaying the
keep alive message, then the replica will still exist, but it's root will be nil.

If my guess is right, I'm not sure what to do about it:

   - Make sure keep alive is in a separate process that we make sure is given a
chance to run by putting pauses in stuff that could take a while?  How do we
know if we've done it right?

   - Accept that we might self destruct sometimes (for whatever reason), and be
ready to re-add ourself to the space if necessary?  That feels like a better
approach to me, but I'd have to stare at the code for a while, which I can't do
right now. [Maybe make #replica ensure that it is rooted and re add if
necessary? Check out installModelData and addToNewSpace. Also, I'll bet there
are a lot of references to the replica instance variable that would have to be
changed to go through a #replica send.]

Holz, Marc wrote:

> Hi,
>
> I have some problems with importing some *.ase files with the
> SimpleWorld demo.
> I'm using the option "Import object" from the tools menu  and the import
> code from the  Menui-Tweak Package
> "CroquetMenuProject>menu-actions>actionImport"
>
> is failing sometimes. I seems the be depended on the filesize
> I'm basically encountering problems with larges *.ase files, e.g. with a
> file size like 20 mb or similar.
>
> Here'a a snippet of the code thats failing (taken from actionImport):
>
>         " Add to the current space. "
>         replica := hand world ownerMorph harness avatar replica.
>         root := replica future root.          
>         root future addChild: eventFrame.
>
> The object "root" in the second line (defined as TFarRef) is actually
> nil and I don't know why. Afterwards the call of "addChild" is faillng.
>
> I have to admit that I'm not very fluent in Smalltalk but I seems to me
> that rendering of my import takes longer than
> the TFarRef can get initialized.
>
> I'll appreciate any suggestions very much since I would love to have
> some registered events on my imported object.
>
> I added some screendumps of the debugger output.
>
>
> Best Regards,
>
> Marc Holz
>
> <<debugger.JPG>> <<debugger2.JPG>> <<debugger3.JPG>>
>
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>

--
Howard Stearns
University of Wisconsin - Madison
Division of Information Technology
mailto:[hidden email]
jabber:[hidden email]
voice:+1-608-262-3724
Reply | Threaded
Open this post in threaded view
|

RE: Importing Models with SimpleWorld & registering events

Holz, Marc
Hi Howard,

I'm not sure what I could do but I always wondered that my bunny just disappared after my imports.

I think I'll try that re adding solution. What are installModelData and addToNewSpace ?
Where could I find these scripts ?

Thank you for your help so far.

Greetings,

Marc

-----Original Message-----
From: Howard Stearns [mailto:[hidden email]]
Sent: 15 März 2007 14:58
To: [hidden email]; Holz, Marc
Subject: Re: [croquet-dev] Importing Models with SimpleWorld & registering events

Could this be because of the self-destruction of avatar replicas?

Each avatar replica in the collaboration (including yours) will remove itself from the scene if hasn't been told recently by it's non-replicated half that it is still alive.  This is what makes bunnies disappear a little while after someone leaves.

If the file load (executed in an off-island harness process) is delaying the keep alive message, then the replica will still exist, but it's root will be nil.

If my guess is right, I'm not sure what to do about it:

   - Make sure keep alive is in a separate process that we make sure is given a chance to run by putting pauses in stuff that could take a while?  How do we know if we've done it right?

   - Accept that we might self destruct sometimes (for whatever reason), and be ready to re-add ourself to the space if necessary?  That feels like a better approach to me, but I'd have to stare at the code for a while, which I can't do right now. [Maybe make #replica ensure that it is rooted and re add if necessary? Check out installModelData and addToNewSpace. Also, I'll bet there are a lot of references to the replica instance variable that would have to be changed to go through a #replica send.]

Holz, Marc wrote:

> Hi,
>
> I have some problems with importing some *.ase files with the
> SimpleWorld demo.
> I'm using the option "Import object" from the tools menu  and the
> import code from the  Menui-Tweak Package
> "CroquetMenuProject>menu-actions>actionImport"
>
> is failing sometimes. I seems the be depended on the filesize I'm
> basically encountering problems with larges *.ase files, e.g. with a
> file size like 20 mb or similar.
>
> Here'a a snippet of the code thats failing (taken from actionImport):
>
>         " Add to the current space. "
>         replica := hand world ownerMorph harness avatar replica.
>         root := replica future root.          
>         root future addChild: eventFrame.
>
> The object "root" in the second line (defined as TFarRef) is actually
> nil and I don't know why. Afterwards the call of "addChild" is faillng.
>
> I have to admit that I'm not very fluent in Smalltalk but I seems to
> me that rendering of my import takes longer than the TFarRef can get
> initialized.
>
> I'll appreciate any suggestions very much since I would love to have
> some registered events on my imported object.
>
> I added some screendumps of the debugger output.
>
>
> Best Regards,
>
> Marc Holz
>
> <<debugger.JPG>> <<debugger2.JPG>> <<debugger3.JPG>>
>
>
> ----------------------------------------------------------------------
> --
>
>
> ----------------------------------------------------------------------
> --
>
>
> ----------------------------------------------------------------------
> --
>

--
Howard Stearns
University of Wisconsin - Madison
Division of Information Technology
mailto:[hidden email]
jabber:[hidden email]
voice:+1-608-262-3724
Reply | Threaded
Open this post in threaded view
|

Re: Importing Models with SimpleWorld & registering events

Howard Stearns
Holz, Marc wrote:
> ...What are installModelData and addToNewSpace ?
> Where could I find these scripts ? ...

Learning how to fish answer:

http://opencroquet.org/index.php/Tutorials#Learning_Squeak

"What you should expect to learn" there mentions (as tersely as possible) how to
find implementors and senders of a method. These are your two most powerful
tools for deciphering the jargon on the croquet-dev list.

A trick: "implementors of it" and "senders of it" work just fine for
installModelData, but do nothing for addToNewSpace?  Why? Because I was sloppy
in specifying the name. It actually takes a parameter, and so is named
"addToNewSpace:" with a colon. But if you didn't know that, you would do
"selectors containing it" and it would give you a nice list to choose from.