Naming of instanced objects

   4430   7   2
User Avatar
Member
17 posts
Joined: Jan. 2013
Offline
By default instancer in unity take names from output node in instancer in Houdini. Do we have any solution to name every instance object the same name as prefab?
User Avatar
Member
571 posts
Joined: May 2017
Offline
Not really sure what you mean by “name every instance object the same name as prefab”? Do you mean that when baking it out to a prefab, to have a way to change the name of the instances?

The name of the instances are made by combining the name of the output node in the instancer with “Instance_” and an integer to uniquely identify the instance. An example would be “object_merge_Instance1” for the first instance.

If you do want to change the names, you can either change the name of the output node in the instancer, or in Unity, have an Event callback when Cooking or Baking to change the name of the generated gameobjects (see https://www.sidefx.com/docs/unity/_assets.html#Assets_AssetInspectorUI_Events)
Edited by seelan - July 9, 2018 14:28:04
User Avatar
Member
217 posts
Joined: March 2006
Offline
Hi,
interesting!
I have the same problem. A Sop tree with some instances:

Instance-Sops
- attribcreateMetal
- attribcreateBrick
- and so on…
- attribcreateStand

in Unity
- attribcreateStand_0_Instance0
- attribcreateStand_0_Instance1
- and so on…
- attribcreateStand_0_Instance60

.. but how can I get the name of the instance to identify the object?
I replace the instances in Unity with fbx animations - works fine!

The instance and the “TRANSFORM NODE” have no parameter to identify, only the pieces (DOP result) have the material from the fbx.


Thanks
Detlef
User Avatar
Member
571 posts
Joined: May 2017
Offline
Are you asking how to label your instance outputs with the material name? Not really sure what you're asking for exactly. Perhaps an HDA or an expected output diagram would help.
User Avatar
Member
217 posts
Joined: March 2006
Offline
Sorry,
yes. Houdinis instance name is the latest sop name and I have some instance-Sops with different names after each other in a chain.. I need the names inside circles in Unity…
Edited by winkel - Aug. 21, 2018 12:27:35

Attachments:
names.jpg (62.9 KB)

User Avatar
Member
571 posts
Joined: May 2017
Offline
The output name is based on the display node's name + “Instance”. The one way to work around it for now would be to use multiple instancers with each one having an object merge and set name that you'd want on the display node inside the instancer.

I've created an RFE to investigate how to allow for more control over this. One way would be to add a field in Unity instancer section to specify output name.
Another option is to add support for another attribute to specify output name (e.g. unity_output_name=“name to use”)
Edited by seelan - Aug. 22, 2018 15:41:29
User Avatar
Member
217 posts
Joined: March 2006
Offline
Hi seelan,
thanks this will be a good idea. For now I use “child-material name” and “parent.parent-name” in Unity to get what I need.

Detlef
User Avatar
Member
571 posts
Joined: May 2017
Offline
In Houdini 16.5.592 and newer, you can now specify the instance name's prefix via a detail or point attribute with name “instance_prefix”. See docs for further info: https://www.sidefx.com/docs/unity/_instancing.html#Instancing_Names [www.sidefx.com]
  • Quick Links