Isotropix Forums

adding randomness to manually placed assets, possible?

General Discussion about Isotropix and CG related topics

adding randomness to manually placed assets, possible?

Unread postby jeff_bartzis » Tue May 01, 2018 8:30 am

Hey all,

sorry if this is a really dumb question, but I have a scene where I am placing assets manually(not with scatterers) and need to add some additional randomness - but I am not sure exactly how to do so.

in advance, I am unable to share my scene, as its for work, and unfortunately under NDA; so I will try my best to explain my setup, and what im trying to accomplish, below:

Essentially I am building a ring-city, and have the entire thing split up into quarters(via dynamic groups - so the entire thing is repeated 4 times around the center). Within those 4 quarters, I have broken everything down into individual asset contexts(buildings, street dressings, trees, etc. etc.) those asset groups are then each broken down into ring contexts(ring A, ring B, ring C.. etc. for the layout of the city, from the center to the edge). I did things this way because I thought it would be the easiest way to get granular control over individual portions of the city, without manually building the entire thing. I tried using scatterers, but the setup time for making realistic city blocks took longer than doing it manually. (maybe doing something wrong with setup, or organization?)

Anyway, My main issue is that I have placed a large amount of trees in specific locations and arrangements, manually, and need to adjust them after-the-fact. Specifically the rotation and scale values. In an effort to get a first pass in front of the art director very quickly, I copied and pasted without adjusting rotation and scale values at the time(looking back, I should have taken the extra hour or two to do it... but.. hindsight right?) I'm looking for a more efficient way of adding random y rotations, and xyz constrained scale, without adjusting them one by one.

If anyone has any advice or help with how to solve this problem. Or, in the event that I messed up, even some advice on how to properly set up scenes like this in the future, to avoid such mistakes, I would be greatly appreciative. I consider myself a beginner with Clarisse, love the software, and will take all the help I can get. I've experimented quite a lot, but I don't think I am utilizing the tools to the fullest potential they can provide.

Anyways, thanks in advance.
jeff_bartzis
 
Posts: 25
Joined: Fri May 12, 2017 6:41 pm
Location: Vancouver

Re: adding randomness to manually placed assets, possible?

Unread postby esmith » Tue May 01, 2018 7:00 pm

Hello, I'm not sure how many trees you have to adjust. But my feeling is just to multi select the ones you want to rotate, and do them in groups.

If the pivot point isn't at the base you can move it to the bottom by selecting the trees and in the top menu selecting Animate>Center Pivot to Ground

You could also add an orient constraint to some of the trees, and hook that constraint up to a locator, so when you rotate that locator, just those trees would rotate. You could setup the same thing with a scale constraint. This is all a bit sloppy but might speed up a more manual one at a time process...
Attachments
OrientConstraint.project
(40.88 KiB) Downloaded 98 times
User avatar
esmith
 
Posts: 180
Joined: Mon May 22, 2017 4:11 pm

Re: adding randomness to manually placed assets, possible?

Unread postby jeff_bartzis » Tue May 01, 2018 9:37 pm

Hey esmith,

Thanks very much for the explanation and scene file.
The groups Idea seems like best way to go. I was not aware of the animate>center pivot to ground feature!!!! thanks for that too!

I did forget to mention that there are about 4000ish trees, but I'm only placing about a quarter of them, and placing the rest with a general combiner to take the whole layout and duplicate it around the center pivot 3 more times. I'm immediately seeing an issue on my setup now, as the other 3 quarters will be exactly the same when I make adjustments to the original portion. I might have to rethink the setup for the rest of the rings.

Your solution will definitely work for all my manual bits, and save me quite a lot of time. Much appreciated.
jeff_bartzis
 
Posts: 25
Joined: Fri May 12, 2017 6:41 pm
Location: Vancouver

Re: adding randomness to manually placed assets, possible?

Unread postby dboude » Wed May 02, 2018 10:57 am

Hi,

Another way to add variation to placed objects is to use scripts.

Code: Select all
import random

sel = ix.selection
count = sel.get_count()

rotationRange = 360

for i in range(count):
    rotationRandom = (random.random() * int(rotationRange))
    ix.cmds.SetValues([str(sel[i]) + ".rotate[1]"], [str(rotationRandom)])


This simple script sets a random value between 0 and 360 to the Y-axis of selected objects. Just select the objects you want to randomize and execute the script.

Cheers ;)
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 1509
Joined: Mon Jul 03, 2017 10:51 am

Re: adding randomness to manually placed assets, possible?

Unread postby esmith » Wed May 02, 2018 6:02 pm

jeff_bartzis wrote:Hey esmith,


Your solution will definitely work for all my manual bits, and save me quite a lot of time. Much appreciated.


Dboudes script will be a MUCH nicer solution, hes the script master!!!
User avatar
esmith
 
Posts: 180
Joined: Mon May 22, 2017 4:11 pm

Re: adding randomness to manually placed assets, possible?

Unread postby jeff_bartzis » Wed May 02, 2018 11:29 pm

Awesome, thank you both for taking the time to help me out! I really appreciate it.

dboude, your script works flawlessley. Thank you so much.

Alternatively I was trying to find some nuke-style channel expressions, as that was the second solution that came up in my head, but this script is much more elegant.

Going to look into the python reference right now. Lots of stuff I keep repeating over and over again that would most likely benefit from simple scripting.

*EDIT: btw, is there an "echo all commands" function that spits out usable code? I'm no expert when it comes to scripting, and this might help me figure out exactly what's going on under the hood for simple things.

Cheers!
jeff_bartzis
 
Posts: 25
Joined: Fri May 12, 2017 6:41 pm
Location: Vancouver

Re: adding randomness to manually placed assets, possible?

Unread postby dboude » Thu May 03, 2018 1:18 pm

You're welcome !

To display a list of commands you can use the dir function :

Code: Select all
print dir(ix.cmds)


You will also find some good info in the doc : Reference > Scripting/API

Cheers !
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 1509
Joined: Mon Jul 03, 2017 10:51 am


Return to General Discussion