Copy multiple objects to points + randomly rotate 90° [Solved]

   4675   13   1
User Avatar
Member
78 posts
Joined: June 2019
Offline
Hello, I have found a few ways to randomly copy multiple objects to points on a flat grid, but I can't seem to find any information on also randomly snapping those copied objects to random 90° increments.

Also, should I be using Copy Stamp or Copy to Points?

File attached as to where I'm currently at.
Edited by GlennimusPrime - May 11, 2020 22:04:16

Attachments:
Copy_Multiple_To_Points_v02.hipnc (196.5 KB)

User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
imo, it would be polite to upload your progress when asking for help…or are you just expecting freebies ?

if ppl can see your effort, they're more likely to help.
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
coupla quick suggestions…not necessarily best tho:

- i would have used a flat grid, select different patterns (like a cross or L shape), then extrude up
- in H18, there's a variant attribute that you can randomize…then use that for copying
- random 0/90/180/270 rots can be controlled by “iteration”

you could have a go at these…or someone…or meself…will post something soon.
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
here's a version making use of variant.

i think copystamps is getting old, i haven't used it that many times, tbh.

ps: i think in the transform, rotation, max times is 3 not 4…cos 4 would be 360 which is = 0
Edited by vusta - March 22, 2020 06:11:34

Attachments:
vu_Copy_Multiple_To_Points_v02.hipnc (219.9 KB)

User Avatar
Member
78 posts
Joined: June 2019
Offline
So many handy things here for me, thank you!

As a student with still much to learn inside Houdini, this is great.

I hadn't heard of the Labs Axis Align before, this makes a bunch of my transform presets redundant, and much easier to deal with.

Thanks for the info on variant also, and I think I was having trouble with rounding previously because I was using the ‘round’ instead of rint.

Just one question, why do the objects not copy to the position of the points they're being told to copy to?
i.e. the objects are overlapping / touching each other.

Thanks for all the new tips!
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
seriously the labs align is a bloody gem…I couldn't live without it.
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
GlennimusPrime
So many handy things here for me, thank you!

As a student with still much to learn inside Houdini, this is great.

I hadn't heard of the Labs Axis Align before, this makes a bunch of my transform presets redundant, and much easier to deal with.

Thanks for the info on variant also, and I think I was having trouble with rounding previously because I was using the ‘round’ instead of rint.

Just one question, why do the objects not copy to the position of the points they're being told to copy to?
i.e. the objects are overlapping / touching each other.

Thanks for all the new tips!
hmmm…that overlapping thing is a problem…wonder why I didn't noticed it right away…late last night i guess…i'll have a look.
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
oh of course silly me….if your point is not at the Origin…which 99% of the time it won't be !!! then because of rotation…it goes around origin and therefore end up in no man's land.

haha, rookie mistake.
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
there must be a neater way to move a piece to Origin, do rotation, then move it back but
here's my long winded way.

For the life of me, cannot get 180 or 270 rotations in the rand…it's always 0 or 90…anyone can spot the obviously not so obvious mistake ? I must be going blind.

(you can play with the seed in the transform)

Attachments:
vu_Copy_Multiple_To_Points_v03.hipnc (239.2 KB)

User Avatar
Member
78 posts
Joined: June 2019
Offline
Actually just moving the Transform SOP before it goes into the loop sorts out the origin problem, but you're right, still not rotating to all 90° angles?

Attachments:
Copy_Multiple_To_Points_v04.hipnc (292.8 KB)

User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
ok…don't ask how but now you can get 0/90/180/270 rotations

all I did was moved the 3* to the front.

Bloody computers….why ???

Attachments:
vu_Copy_Multiple_To_Points_v04.hipnc (239.2 KB)

User Avatar
Member
8573 posts
Joined: July 2007
Online
no need for special gymnastics or even for loop
just use p@orient attribute for rotation and i@variant for piece choice

Attachments:
Copy_Multiple_To_Points_v02_fix.hipnc (205.0 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
78 posts
Joined: June 2019
Offline
Amazing, thank you Tamte. A much more simple network!
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
i was looking for THAT way to create the variant !!!

also tried randomizing the orient attribute too but didn't get too far with it.
  • Quick Links