I don’t know that it makes sense for Armory to have a resource viewer because it has to use Blender to identify and export resources. If Blender had this feature that would be another story, but it depends on being implement that in Blender itself.
I think that Armory should work with Blender and like Blender. If linked proxy objects are not working in Armory, then that is probably just something that needs to be fixed in Armory. Linked proxies work how you are imagining in all other respects right? Where is the failure point for them?
There are add ons out there that actually can do this. In the new kitops add on you create an asset in it’s own blend file complete with children and even animation and the add on shows those pieces in thumbnails. When you insert it into your file it brings in all the parts and even has a predetermined method for Boolean operations on the specific mesh you are working on.
So if we could get a system that you create “prefabs” in a blend file and then in the master file be able to add them,. either in normal append like fashion or dynamically though code or nodes, it would solve a ton of issues. I think the 2 main ones are
the prefab needs to bring in the parent object, all of its children and all of it code (node or haxe)
multiple prefabs with the same name (at least as far as the code is concerned) need to be able to used mostly at run time.
for #2 would a tag like system fix this - where you are looking for a certain property of the object instead of the object itself. multiple objects can have the same property name (say destructible) set to a Boolean at the same time. So you would search from that property on all the objects in consideration instead of the name. therefore the name itself doesn’t matter much.
You might be able to do that with Blender groups. All that would be required, if it isn’t already implemented, would be adding the list of groups that an object is in to the Armory export. That would satisfy any type of “tagging” requirements I think.
If there are addons for this then we should be able to learn from them and how they do it or just integrate Armory with them. That would be great to satisfy a little bit more of the “Game Engine like” UI.
I already tested proxy, they don’t work
1 ) you can only Link or Unlink one child object
2) Blender hierarchy see proxy content, so again Blender won’t accept proxy or prefabs with child object having the same name.
Groups have other use i think, i don’t know if it can used as tags with a name.
Not necessary. In Unreal 4 or Unity, each prefab you drop on the 3D scene is a new instance of the prefab, in the hierarchy these prefabs copy can’t have the same name.
Because each object root node on the hierarchy has a unique name.
Armory need one like those resource explorer
About prefab Armory is stuck until it gets it’s own solution.
OK, if linked proxies don’t work, have you tried group instances? They don’t have visible children and you might be able to link the group from another blend and create a unique instance of that group in the blend that you are importing it to.
Nothing in blender is going to grab nodes or Haxe from other projects without some customization. The closest thing that exists that does that, that I know of, is the modding setup I was working on, but that isn’t quite right in this instance because you have to compile mods separate from the game, and the point is that we want to be able include the contents of the other blend and compile it once in the blend that we are including it into.
This is a pretty difficult one to solve with the differences between the Blender and the “Game Engine” approach. I’m going to do some experimenting for a structure for a moddable game ( just because that is what I’m working on ) and I might find out a little bit of how we might be able to manage imports and other blends. There might be a different way that we are not thinking of that is different that the typical way to do it, but that can still satisfy our needs.
When you append an object from another scene it pulls the material node in. Shouldn’t we be able to pull in at least the nodes. Right now when I append a item with a node tree on it, it shows up as having the trait it just doesn’t pull the actual nodetree with it and you have to reattached it. But it seems like it is within blenders structure to do so.
As discussed before, proxy and groups does not work for prefabs.
Will Blender 2.8 allow child objects with same name and some sort of prefab ?
Otherwise most game dev possible in other 3D engines won’t be possible in Armory.
For example duplicate characters with child object named “mount pivot”, this child object retrieved used in code or logic nodes.
If nothing else works, something that does work is to separate any objects that need to be duplicated into different scenes and spawn those scenes at runtime. That is how I am handling my player at the moment. The player is in a scene all by itself and is spawned by a spawn point object ( an empty ) that just uses a Spawn Scene node triggered On Init.
Hierarchy does not allow two objects with the same name, whatever they are in the hierarchy. (I already tried scenes)
I’m the only one requesting prefabs, i understand it’s too early, but i test Armory as i would be making a real game.
Only solution will be to make a request for Blender 2.8.
Yes, you can’t name two objects the same thing, but in a lot of circumstances you should be able to get away with that. If you have two different kinds of enemies, even if they are in different scenes, you will not be able to name both of their guns “Gun”, but you could name them “SoldierGun” and “BossGun”. Or you could leave the names “Gun.000” and “Gun.001” and use the Get Child node and get the child that starts with “Gun” in your logic nodes. That is one approach.
When it comes to having multiple instances of enemies or other objects and you don’t want to do the whole “starts with” thing, Armory has absolutely no problem if you spawn any number of instances of a scene regardless of the fact that you end up with multiple objects with the same name in the scene. If you take your “Soldier” scene, you can spawn any number of soldiers using spawn points or anything else, and those soldiers will function just fine if they are using logic like Get Child instead of Get Object to make sure that they are selecting the objects out of their own hierarchy.
I just tested this with my own game. I can spawn two player scenes, each containing objects like CameraPivot and Gun, and in my logic nodes I can do this in a scene where I spawn two of my players and both of them work just fine:
Using scenes actually does represent the overhead of parsing the scene file when it is first loaded, but now that I think about it, there isn’t any reason you shouldn’t be able to just use an object in the scene you are already using and spawn an instance of the object ( or just preload the scene; there is a way to do that in Haxe ).
My particular example is dependent on some non-merged changes, but I should be able to make a quick example for you.
I’ve been around the code quite a bit and I’ve seen that it parses the scene when you request loading it and it caches the scene in memory after the first load. Any subsequent attempts to load the scene retrieve the scene from memory.
That is what I’ve seen, but there could still be more to it.
It just has a “Player” scene that is a ball with a hammer and node logic to swing the hammer when you press spacebar. The “Game” scene has to spawn points “PlayerSpawn.000” and “PlayerSpawn.001” that each just spawn the “Player” scene in their current location on Init. On update, both players will get their own “Hammer” child object and set it’s rotation based on whether or not you are pressing the spacebar.
Lubos actually did mention something about Blender collections maybe being able to help us not need to parse scenes for spawning objects:
I hope there will be something to not need to spawn or use “name start with”, but a real prefab system like Unity for example.
You create the prefab and can directly drag and drop and duplicate on the scene, child objects can keep the same name.