On ke, 2010-06-30 at 01:39 -0700, Matti wrote:
> Yep, common library would be good, if you could get caps working
> from blender,.. i think antont was earlier talking something about
> having blender using naali to upload scene or something..

The local scene loading in Naali experiment started after I observed
(Mikko P. showed) that the bottleneck in loading big scenes was at the
server. It can take minutes for modrex to create all the db objects for
the assets etc. As we currently don't have an Ogre view in Blender, we
typically must use a reX client to check if the materials etc. are
right. For this kind of previewing, often done in a pretty tight
authoring loop, seemed that going via the server can be too slow -- even
when it's on localhost so that the networking is fast.

Naali can load a big scene from local files directly in seconds, like
Ogre normally. When the meshes and materials are already loaded, and you
only move/scale/rotate the objects in Blender/Max/Maya and get a
new .scene file, the py code in Naali can update it in a fraction of a
second. And we got this almost for free, 'cause python-ogre examples
already had a dotscene loader which was easy to adapt to the Naali EC
system which provides the py api there.

The experiment / workflow I suggest is this: 

- Have both Blender and Naali running locally on the same computer.
That's what artists usually have anyway, when model etc. in Blender and
use Naali to view the result. 

- Add a button to blender2rex to sync the scene to local Naali directly,
as an alternative option in addition to the sending it to server for
ModRex to handle.

- Have Naali show automatically the new scene after it was exported from
Blender. When moving/scaling/rotating objects could even sync it after
every editing op to have it update almost in realtime. Can test the
scale by moving around in it by flying with the avatar etc (collisions
don't work with local scenes now 'cause we don't have client side
physics in Naali yet, but that doesn't matter for the visuals).

- Then can use either the Naali server upload capability or the Blender
one to publish the scene on the server after have seen that it looks
right in Rex.

Of course this leaves also the option to just go via the server when the
slower cycle is not a problem, and when you want to more directly collab
with others. But for local previewing when building this seems useful.

Naali already comes with a http listener, a demo seems to be still up at
http://www.playsign.fi:28008/render (that Naali has been running nonstop
>2weeks now :) . It is easy to add a rest/xmlrpc/whatever http handler
there that understands commands like:
loadscene /home/artist/scenes/myworld.scene .. so after the export
Blender can just send such a command over http so Naali knows to sync.
The source for the http handler is at
http://github.com/realXtend/naali/blob/develop/bin/pymodules/webserver/webcontroller.py
 .. you can just add a 'def loadscene(self, filepath)' to implement a url 
handler for http://localhost:28008/loadscene?filepath=myworld.scene

The py modules in Naali use the circuits event library, where the idea
is to use events to make decoupled components when building your app, so
to make the webserver tell the localscene component to load a scene it
can be a good idea to use circuits events .. you can also just import
the localscene module and call functions there like in normal py, but I
think the decoupling that events give is nice (also keeps the live
reloading of the components working). We don't use circuits events to
communicate between different py modules in Naali yet, it is now just
used to forward the Naali events from the c++ side to py modules, but I
think this webserver+sceneloader interaction is a good place to test
that.
http://bytebucket.org/prologic/circuits/wiki/html/tutorial.html#events

Otherwise I looked into synching also the selection state between
Blender<->Naali, in that case there'd be a http handler for setting
selection and a circuits event that's handled in the object editing
module in Naali .. I or perhaps Nathan who works on obedit can try that
one, if you take care of this scene contents biz :)

And like planned we should meet and talk about the big pic, how we want
Blender and reX to play together, do we target Collada, perhaps use
Verse too etc. Let's plan something soon, so get it implemented in time
before the Blender conference so can have nice demos there and get
feedback from that community too etc. And please, anyone on this list,
do post your views and wishes for the workflow.

I know some fancy the idea that Blender would be just a normal Opensim
client, what I tested a year ago in
http://www.playsign.net/engine/BlenderOMV . That's where I've been
hoping that Naali network modules would be libs reusable in other apps
too, so would not need .net for libomv in Blender. But this dotscene
shortcut is 1000 times less work to complete to a useful state, and
performs better to sync a full scene, so I think better to do first.

~Toni

-- 
http://groups.google.com/group/realxtend
http://www.realxtend.org

Reply via email to