[Bf-committers] Proposing a unique ID for Blender objects system, for use with game engines.

Fergal Gribben fgribben at gmail.com
Thu Nov 12 22:36:26 CET 2020

Hi Juan,

Recently I've been experimenting with such a system, and the code I have
works fine for what I need. I'm sure there are bugs in my code, and there
are probably a few glaring omissions too, but in summary, the code can:

- Generate a new UUID and assign it to a new object added to a scene
- Generate a new UUID and assign it to a duplicated object
- Remove the UUID from the list of known UUIDs when an object is deleted

It also works across multiple scenes. I'm not sure if we're allowed to send
zip files on this mailing list but if not I could send you the code
directly? I've ripped it out of my addon so it works in isolation, and the
best way to test it is to run Blender from the command line so you can see
the list of UUIDs being printed as you add/delete objects.

On Thu, 12 Nov 2020 at 17:20, Scott Wilson via Bf-committers <
bf-committers at blender.org> wrote:

> Depending on how it is implemented, the unique IDs may be problematic. I
> know that some other 3d packages do have support for unique IDs, but if you
> reference in an asset multiple times, then you have duplicate IDs. If this
> is something that the developers are interested in doing, then I'd like to
> flag this as a possible issue.
> On Thu., Nov. 12, 2020, 8:24 a.m. Juan Linietsky via Bf-committers, <
> bf-committers at blender.org> wrote:
> > Hi guys, lead Godot dev here.
> >
> > I wanted to discuss with you a problem we are often having that I am not
> > certain how it can be solved entirely from our side, I add a proposal for
> > this, but if you guys have a better recommendation, I'm very open to any
> > ideas.
> >
> > Basically, Godot will import scenes (GLTF/FBX/DAE/etc) as they come from
> > blender, and it generates the same object names, resource names, etc. as
> > they come from Blender and the resource file.
> >
> > We use the same names so we can keep track of changes in the Blend file.
> If
> > an object is moved, a material is changed, etc. we detect on re-import
> and
> > everything is updated in Godot.
> >
> > This is especially more annoying in Godot than in other game engines,
> > because Godot can read the whole Blender scene and keep it more or less
> > intact, so users love using this for level design workflow (so they can
> > design levels in Blender).
> >
> > So, the problem is that it often happens that for some reason, artists
> want
> > to rename the objects in Blender. Be it because they didn't care at the
> > beginning and they want to become more organized later, or because the
> > scene became bigger and they need to make their naming of things more
> > precise to navigate it around. In this situation, when something is
> renamed
> > on the Blender side and re-exported, the game engines have no idea where
> > this object went, so we need to either remove it (resulting in loss data)
> > it or orphan it (resulting in duplicated data).
> >
> > While I do think that good practices solve this and this is probably not
> > such an issue in a professional environment, truth is that game
> development
> > has become a huge hobbyist activity, and our users find this situation
> > constantly and are annoyed with it, and there is nothing we can do from
> our
> > side.
> >
> > The obvious proposal to solve this would be to ask Blender whether it's
> > possible to generate a unique object ID (UUID?) and make sure it does not
> > change over time even if objects are renamed, then changing the
> exporters a
> > bit to (optionally if selected in the export settings) add this
> information
> > as extensions in the existing format (on GLTF it should be rather easy).
> >
> > If you guys think this is possible, it would be very helpful for us, if
> you
> > have other ideas on how we could solve this, we are very open to
> > discussion.
> >
> > Best
> >
> > Juan
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > https://lists.blender.org/mailman/listinfo/bf-committers
> >
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> https://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list