Trouble with copy to points and my asteroid field scene

   168   2   0
User Avatar
Member
1 posts
Joined: Aug. 2025
Offline
Can someone please look at a file and tell me what is going wrong? Can I not attach my scene file here? I'm a houdini newb and I cant get the scene to work. I'm trying to randomly place 5 asteroid models I made at the points from a scatter node. I've got the meteors at all the points but for some reason, I can't get it to place only one meteor per point. It's placing all my meteor models at all of the scattered points. Here's a picture of what the node tree looks like https://imgur.com/a/kPSlwa6 [imgur.com]

Please help if you can, thanks
Image Not Found
Image Not Found

Attachments:
Asteroid Scene 004 HELP.hipnc (1.2 MB)

User Avatar
Member
2151 posts
Joined: Sept. 2015
Offline
It's because you can't have two attributes of the same name but of a different type; in this case an int and float of variant.

You were trying to caste the attribute f@variant to i@variant with
i@variant = int(@variant);

You can cast an float attribute to an int attribute, it just has to be a different name.

So you could maybe instead of using the name 'variant' in your initial attribute randomize node, use something like 'point_scatters';

Then in that node where you tried casting just do;
i@variant = int(f@point_scatters');

Then you will find the copy to points will work as you expect.


or......

before your attribute randomize node, you could put down an attribute and specify the point name of 'variant' as an integer,
then the attribute randomize will randomize 'variant' as an integer attribute. And you could then remove your point wrangle node and not have to cast it.
Edited by BabaJ - Sept. 2, 2025 13:37:59
User Avatar
Member
368 posts
Joined: Aug. 2018
Offline
Just one other note, in addition to BabaJ's help: Your attribrandomize2 SOP is set to 'orient' - which is fine - but orient is a 4 dimensional attribute - a quaternion - so you need to set the dimension parameter to 4, not 3.

There is also quite a bit you can do to simplify your network - but that is something you can learn later : )
Edited by Mike_A - Sept. 2, 2025 15:53:46
  • Quick Links