How to properly merge geo with different attributes?

   995   2   2
User Avatar
Member
6 posts
Joined: July 2022
Offline
https://gyazo.com/598d823f88baec5a1b48c4d484432e37 [gyazo.com]

as shown in the network(just for demo), in branch A i set point attribute "unreal_instance", in brance B i generate some mesh with polyextrude. so all the point from branch A will have attribute 'unreal_instance' but points in branch B will not. after merging two branch, in the geo sheets, some points will have 'unreal_instance' attribute but some left empty. this will cause problem when used in Unreal. those points with empty 'unreal_instance' will be replaced with a place holder box.
this situations also apply to some other attributes like normal/orient, etc...
so, how can i properly merge these branch in a better way? since it's in a for each loop, i have to merge them first then connect to end block.
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
Hi, it would help if we know what are you trying to do and what should be the end geometry look like?

Also, do you understand why you end up with some points with an empty 'unreal_instance' attribute?
To avoid attribute missmatch after a merge, be sure to merge geometries that have the same attributes, so points in branch B should be already assigned with an 'unreal_instance' attribute before merging.
Edited by Andr - Feb. 9, 2023 09:29:04
User Avatar
Member
393 posts
Joined: Nov. 2016
Offline
Houdini requires that all components have a value for each attribute in a geometry, so when you merge two streams, default values for the attribute are applied to components that don't have any.

That default value can be specified when you first create the attribute, with addattrib() in vex, or with an Attribute Create node.

If you really don't want the points to have any value for this attribute, you can pack your geometry on each side before merging. The attributes will stay inside the packed geometry and won't be shared to the merged branch. However, as soon as you unpack it, the default values will be applied.
  • Quick Links