ubisoft / mixer

Add-on for real-time collaboration in Blender.
https://ubisoft-mixer.readthedocs.io/
GNU General Public License v3.0
1.32k stars 79 forks source link

Integration with Godot Engine #5

Open fire opened 4 years ago

fire commented 4 years ago

Researching mixer and saw that there was support for baking art so it be used in VR and Unity.

Aside from the fact Godot Engine is MIT license and incompatible with GPL2 (from the game developer perspective), it should be possible to do the same.

Any suggestions?

BluePrintRandom commented 4 years ago

Blender itself has tons of import / export addons shipped with it by default that py or a button click can call.

using the BPY api + a little time I am sure you can set something up that is one click to export and run a project like UPBGE.

basically everything you need already exists within blender I believe, you just need a little addon to call all the pieces that is calibrated correctly for that export pipe*

gltf format, etc.

fire commented 4 years ago

I don't understand.

The synchronisation mechanism was originally developed for our VRtist software that include a Unity VR client. As a consequence, the data that are synchronised for VRtist are selected for their relevance to VRtist and the the synchronization "cooks" Blender data into VRtist related messages.

I was referring to this protocol.

fire commented 4 years ago

As far as I know Unity has horrific support for glTF2. FBX support is painful to implement and Blender doesn't support the full format. Not sure how this is done.

BluePrintRandom commented 4 years ago

fire - you can use blender in VR -> create your assets in VR -> export them in any format to godot -> open them in godots VR tools / engine

you need to wrap this process -

Blender is not near ready yet for all this yet though

they are still at the 'scene inspection stage' - https://developer.blender.org/T68998

fire commented 4 years ago

You are not answering the question. This is a issue for the mixer protocol. I can do your process in any possible way. The question is for mixer's protocol which was noted to exist.

No. I don't care about the blender VR process. Exporting the blender plugin as gltf2 will run into the slow export bug in glTF2. It will take several minutes as noted in https://github.com/KhronosGroup/glTF-Blender-IO/pull/1120 and may use up to several gigabytes of ram.

I'm expecting some sort of walk-through of the mixer protocol in tcp/ip and maybe some insight in Ubisoft's Unity VRtist app.

Celeborn2BeAlive commented 4 years ago

Hi, thanks for your interest and for your idea ! Indeed an integration of Godot could be great (Maya too as mentionned in your other issue, but personally I prefer open source technologies haha).

We started reflections about how we can cleanly mix different client types. For now we only have Blender and VRtist, our internal VR app, and the architecture and the protocol has evolved according to our needs. After only a few months we think it is already a bit bloated, and makes the code hard to read for an external developer. So before trying to add other clients types, we want to rework this. We'll be sure to think about other use case than ours, like Godot and Maya.

If you want to explore by yourself how to connect Godot to a Mixer session, feel free to fork Mixer and experiment things. If you want more details abour the protocol, you can read https://github.com/ubisoft/mixer/blob/master/doc/protocol.md. To know more about how we synchronize data between Blender and VRtist, read this https://github.com/ubisoft/mixer/blob/master/doc/synchronization.md.

For the source code, you can focus on these files for client-server interactions:

fire commented 4 years ago

This response is excellent.

Did you document the way bpy.types.Mesh is serialized?

I am trying to understand how one node's mesh is sent game engine. I was wondering if I need to decode the mesh format into one the Godot Game engine understands.

I would also like to support animations.

Celeborn2BeAlive commented 4 years ago

No we have no documentation for this part right now, but most of the code for meshes sync is in https://github.com/ubisoft/mixer/blob/master/mixer/blender_client/mesh.py

Right now we send two meshes for each Blender mesh (with options to disable one or the other, for dev purpose): one triangulated and one "original". The triangulated is for consumption by VRtist, and I guess Godot might want one triangulated too. The other one is for Blender and also encodes Blender related data such as vertex weights, bevels, vertex groups, etc...

In the future the code for the triangulated one will probably be moved to a VRtist plugin, and the "original" one handling will be replaced by mechanics of our generic sync system (https://github.com/ubisoft/mixer/tree/master/mixer/blender_data). That is to say that right now you can use this code to experiment and test the system, but it will evolve a lot in the next weeks/months so you should expect required changes in your code too.

fire commented 4 years ago

Hi, I was prototyping a python based version of the Mixer client in Godot Python. https://github.com/touilleMan/godot-python

[Uploading Mixer Project.zip…]() You have to extract and copy the python addon into the folder and use a Godot Engine executable with this zip.

The above is the extracted client, but I was hoping to see if the https://github.com/ubisoft/mixer/tree/master/mixer/broadcaster directory aka the protocol is more permissively licensed. This would really help.

This is currently missing the send scene "content" part of the protocol. So it hangs. Here's a screenshot.

image

See https://github.com/ubisoft/mixer/issues/6

Celeborn2BeAlive commented 4 years ago

As mentioned in #6, closing this issue in favor of https://gitlab.com/ubisoft-animation-studio/mixer/-/issues/8.

fire commented 3 years ago

I have a task to write design for integrating Mixer with Godot Engine.

fire commented 3 years ago

Status update: waiting on Blender to be workable on LTS Blender 2.93.