Login | Register 
Products Applications Downloads Features Wiki forum Store
 

Copy Stamp syntax question

Still a little green? Ask your beginner's questions here

Copy Stamp syntax question

Postby rurik » Sat Jul 14, 2012 1:40 pm

Hello
Coming from Houdini, trying to implement the stamp() expression, which I understand does not exist in Touch.

I'm trying to use "param" instead, but am getting odd results. I can see param() takes the path to the value and then a float

So my copy has a simple rand($PT)*float expression associated to value "randomscale"
In my copied sphere, in the radius field, I'm using param("pathtovalue",float)
However this is not producing an error, not producing a result, and not even showing a dependency between the SOP nodes.

What is the correct syntax for this?

Thanks
Alex
---
Touch Designer Pro 077
Windows 7 - 8 Core- 8 gigs RAM - Nvidia GTX 560
rurik
 
Posts: 139
Joined: Thu Dec 29, 2011 12:04 am

Re: Copy Stamp syntax question

Postby selina » Mon Jul 16, 2012 11:15 am

you use param in the same SOP, so there shouldn't be a dependency anywhere. I think this is what you want to do:

in Copy SOP Stamp tab, Param 1 is "randomscale", with value1 = "rand($PT)". in the Copy Tab, set Uniform Scale to "param("randomscale", 1).

hope this helps.
Selina
User avatar
selina
Staff
 
Posts: 368
Joined: Tue Nov 13, 2007 12:15 am

Re: Copy Stamp syntax question

Postby rurik » Mon Jul 16, 2012 2:35 pm

Thanks Selina

So you are essentially limited to stamping the parameters that are exposed in the Copy tab of the Copy SOP correct? Great to have, but would be great to extend to other parameters...

I'm also not able to get this to work properly...
I have a grid, with a group created in the center using a bounding box. I copy a series of spheres to the grid.
See attached for the parameters in my Copy SOP..
I'm not getting any errors, but not any results either.
My assumption is that my numbers are off?

What is strange is that if I change the values in my "fit" expression (for example fitting 0-1 to 1-10), I can see my spheres growing in size uniformally, but the values are still stuck at 1, per my third screenshot

Thanks

Alex
Attachments
CopySOP_CopyTab_values.PNG
CopySOP_CopyTab_values.PNG (20.09 KiB) Viewed 175 times
CopySOP_CopyTab.PNG
CopySOP_CopyTab.PNG (20.67 KiB) Viewed 175 times
CopySOP_StampTab.PNG
CopySOP_StampTab.PNG (15.27 KiB) Viewed 175 times
---
Touch Designer Pro 077
Windows 7 - 8 Core- 8 gigs RAM - Nvidia GTX 560
rurik
 
Posts: 139
Joined: Thu Dec 29, 2011 12:04 am

Re: Copy Stamp syntax question

Postby selina » Tue Jul 17, 2012 12:58 pm

it is showing the default value, which is 1 as per your param expression. if you put a different default, it'll show the new default value. reason being that the displayed parameter value is evaluated when there are no valid points, i.e. $PT is not defined. $PT is only valid when the node is cooked.
User avatar
selina
Staff
 
Posts: 368
Joined: Tue Nov 13, 2007 12:15 am

Re: Copy Stamp syntax question

Postby rurik » Tue Jul 17, 2012 1:26 pm

Sorry, not sure I understand, isn't $PT just giving out point numbers? Why would the node need to cook?
All I'm trying to achieve is to have the circles have a random scale, based on the point numbers on the grid they are being copied to, inside of a range of 1-5....
Maybe I'm approaching this the wrong way?

Thanks
Alex
---
Touch Designer Pro 077
Windows 7 - 8 Core- 8 gigs RAM - Nvidia GTX 560
rurik
 
Posts: 139
Joined: Thu Dec 29, 2011 12:04 am

Re: Copy Stamp syntax question

Postby selina » Wed Jul 18, 2012 1:30 pm

just looked at the Copy SOP and realized $PT is the template point number. you probably want to use $CY, which is the node variable for the copy number. if you replace $PT with $PY your example should work.

http://www.derivative.ca/wiki088/index.php?title=Copy_SOP

some node variables only become available when the node is cooking. in the Copy SOP, $CY changes as the node process each piece of copied geometry. so when the node is not cooking $CY is undefined.
User avatar
selina
Staff
 
Posts: 368
Joined: Tue Nov 13, 2007 12:15 am

Re: Copy Stamp syntax question

Postby rurik » Wed Jul 18, 2012 2:26 pm

Hmm, thanks for that, but $CY does not seem to work either...It returns 0 in the scale values, even though my spheres remain visible.
(I'm assuming $PY was a typo in your message? I typed that in anyways, but to no avail)
I tried to force the node to cook to see if that could be the cause, but no luck.

In my case the template point numbers is fine, because I'm copying the spheres to a template, so the point numbers should be the same, or at least there would be the same amount of points on my template as there are copies.
So in theory, all I'm doing is telling the stamp to take the number of points as its seed per copy correct?

For the sake of the exercise I went into my scale parameter and typed in rand($CY).
This does indeed create a random value, but the same one for each copy...

Sorry to beat on this, the solution might be right under my nose, but isn't that where it is the hardest to find?

Thanks
Alex
---
Touch Designer Pro 077
Windows 7 - 8 Core- 8 gigs RAM - Nvidia GTX 560
rurik
 
Posts: 139
Joined: Thu Dec 29, 2011 12:04 am

Re: Copy Stamp syntax question

Postby selina » Wed Jul 18, 2012 3:32 pm

can you post your example?
User avatar
selina
Staff
 
Posts: 368
Joined: Tue Nov 13, 2007 12:15 am

Re: Copy Stamp syntax question

Postby rurik » Wed Jul 18, 2012 4:49 pm

Here it is
Attachments
CopySOP_Exercise.toe
(6.44 KiB) Downloaded 12 times
---
Touch Designer Pro 077
Windows 7 - 8 Core- 8 gigs RAM - Nvidia GTX 560
rurik
 
Posts: 139
Joined: Thu Dec 29, 2011 12:04 am

Re: Copy Stamp syntax question

Postby selina » Thu Jul 19, 2012 11:37 am

my bad about the stamping (didn't remember how it worked), if you are stamping, the stamp input is upstream of the node. so in the attached file, stamp in stamp_copy2, param expression in radius of sphere1. however, for what you are doing you should just use node variables. so see nodevar_copy3 where the uniform scale operation is modified with your rand expression.

hope this clears it up!
Attachments
CopySOP_Exercise_mod.toe
(6.63 KiB) Downloaded 19 times
User avatar
selina
Staff
 
Posts: 368
Joined: Tue Nov 13, 2007 12:15 am

Next

Return to Beginners

Who is online

Users browsing this forum: No registered users and 2 guests

cron