Referencing prefabs?

Everything about the development of Urho3D.

Referencing prefabs?

PostPosted by TheComet » 11 Oct 2016, 11:45

After quite a long and heated discussion with an artist on our team about workflow, I got to thinking about a feature I'd really like to see (if it's not already possible).

In the editor, when adding a prefab, it gets copied into the scene. This is undesirable if later on you decide to change something in the prefab: Those changes won't update the existing instantiations that are already in the scene.

What would really be cool is for a prefab to be referenced by XML file name when you add it to he scene and reloaded every time said XML is modified. Saving the scene would only serialize those references but not the actual contents of the prefab.

I realise implementing this would require some deep changes. How possible is it to see this in a future version?
I'm a non-binary non-cis sexually fluid cephalopod identifying genderqueer mocha frappé latte
User avatar
TheComet
Active user
Active user
 
Posts: 122
Joined: 29 Jan 2014, 14:07
Location: Germany

Re: Referencing prefabs?

PostPosted by cadaver » 11 Oct 2016, 12:10

There is an issue for this. https://github.com/urho3d/Urho3D/issues/1636

It's indeed a quite deep feature, when you consider also possible nesting, or having non-prefab objects as children of prefabs etc.

A "cheap" implementation with no core engine changes would just work inside the editor, store a prefab reference to a node as a var and watch its reloads, or refresh prefabs at scene load time if necessary.
User avatar
cadaver
Urho3D author
Urho3D author
 
Posts: 1802
Joined: 16 Jan 2014, 14:52
Location: Finland

Re: Referencing prefabs?

PostPosted by magic.lixin » 12 Oct 2016, 00:54

my solution was very simply and ugly, add a prefab tag for the node which was load from a prefab xml file, everytime when loading scene in the editor, recreate the node by the prefab defination.
User avatar
magic.lixin
New user
New user
 
Posts: 18
Joined: 26 Jan 2014, 01:11
Location: United States

Re: Referencing prefabs?

PostPosted by TheComet » 14 Oct 2016, 19:22

Thanks for the suggestions, will try it out
I'm a non-binary non-cis sexually fluid cephalopod identifying genderqueer mocha frappé latte
User avatar
TheComet
Active user
Active user
 
Posts: 122
Joined: 29 Jan 2014, 14:07
Location: Germany


Return to Developer Talk

Who is online

Users browsing this forum: No registered users and 0 guests

cron