thinkinmonkey Posted February 6, 2010 Share Posted February 6, 2010 Hi all, I'm using Houdini for my project/portfolio and the main scene is a big beach filled with containers randomly created as the attached scene can show you: actually there are just simple boxes that will be replaced with the hires container, the red is for simple hatchs, while the green are are for windowed hatchs. The scene works fine for me, but I'm trying to squeeze Houdini for a better learning! The containers are distributed by a copy/stamp mechanism, but I want to make a step over. There are some user controlled parameters, the one I'm getting trouble is called "rotator": it's a float parameter (0.0<->1.0) that should indicate the total number of copied containers and it'll works like a 180° distributor, i.e. where 0.0 means no container is turned on 180°, 1.0 means all containers are turned on 180°, and in between means that percentage of randomly choosen containers will be rotated. I'd like to know if there's a way to put a complex expression or a little script in a parameter and where I can find informations about it, because I suppose there are no nodes to do that. I thought to use a code like this (pseudo code): i = 0 while (i < $NCY * rotator) if (rand($PT), 180 AND i++, 0) dispenser_006.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted February 7, 2010 Share Posted February 7, 2010 what about this? if(ch("../masterControl/rotator") >= ($PT/($NPT-1)), 180, 0) just bypass your switch1 for a while to ignore window variable and try above expression as turner variable to randomize rotating of containers append sort SOP after point1 and set it's mode to random for multiline expressions you can use python expressions, i can recall that hscript has multiline expressions too but i forgot the syntax you can even use Vop Sops to do your complex math on per point basis and add attribute to points then just use that attribute's variable for copy stamping Quote Link to comment Share on other sites More sharing options...
thinkinmonkey Posted February 7, 2010 Author Share Posted February 7, 2010 Hi, anim, thanks for the answer and thanks for your solution: it's really simple and it works flawlessly! The formula is simple, but the use of Sort SOP (ehehe! a new node in the magazine!) gives me what I wanted. for multiline expressions you can use python expressions, i can recall that hscript has multiline expressions too but i forgot the syntax you can even use Vop Sops to do your complex math on per point basis and add attribute to points then just use that attribute's variable for copy stamping For both solution, I think I'll postpone them after achieving a solid SOP base: Houdini is a great and beautiful beast in the end! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.