Jump to content


Copy stamp a string value?


  • Please log in to reply
25 replies to this topic

#1 hopbin9

hopbin9

    Houdini Master

  • Members
  • PipPipPipPip
  • 803 posts
  • Joined: 14-March 10
  • Location:Canada
  • Name:Hop Bin

Posted 19 February 2012 - 08:20 AM

Hi,

Is it possible to use the Copy SOP to stamp a string value?

My template points for the Copy SOP have a string attribute for each point, and I want a Font SOP in the copy to be stamped with each string attribute. My problem is the stamp value appears to be numeric only.
Posted Image
Come download the free open source asset library for Houdini.
Help us reach 1,000 fans on facebook!

#2 eetu

eetu

    Illusionist

  • Members
  • PipPipPip
  • 479 posts
  • Joined: 30-May 07
  • Location:Helsinki, Finland
  • Name:eetu m

Posted 19 February 2012 - 08:29 AM

exhelp stamps() ?
A shitty theory is better than no theory at all

#3 hopbin9

hopbin9

    Houdini Master

  • Members
  • PipPipPipPip
  • 803 posts
  • Joined: 14-March 10
  • Location:Canada
  • Name:Hop Bin

Posted 19 February 2012 - 08:47 AM

Thanks, that seems to indicate that it's possible.

How do I assign a string value to a stamp input? When I enter "Hello" it always tries to convert it to a numeric value or gives me an error that it's not a value expression. When I look at val1 in the parameter editor, it's a float parameter.
Posted Image
Come download the free open source asset library for Houdini.
Help us reach 1,000 fans on facebook!

#4 hopbin9

hopbin9

    Houdini Master

  • Members
  • PipPipPipPip
  • 803 posts
  • Joined: 14-March 10
  • Location:Canada
  • Name:Hop Bin

Posted 19 February 2012 - 08:58 AM

ok, i got it working.

Had to create a stamp value of $PT for the point number, and then I could use that to read the string attribute for the reference points going into the Copy SOP.

`points("../ref",stamp("../copy1","point",0),"str")`

Not a very obvious way of doing, but I don't think you can stamp a string value. You can only use a numeric value as a string using stamps.
Posted Image
Come download the free open source asset library for Houdini.
Help us reach 1,000 fans on facebook!

#5 vectorblur

vectorblur

    Illusionist

  • Members
  • PipPipPip
  • 255 posts
  • Joined: 05-November 10
  • Location:India
  • Name:Gaurav Mathur

Posted 19 February 2012 - 10:10 AM

Copy sop never fails to amaze me.

Has it been the part of H since the big bang ?
also could someone explain in simple programming terms how copy stamping is achieved ?

eg. for loop,recursion ?

Thanks,
Eh *munch munch* what sop, doc?

#6 asnowcappedromance

asnowcappedromance

    Initiate

  • Members
  • PipPip
  • 158 posts
  • Joined: 18-October 09
  • Location:Vancouver, B.C.
  • Name:Manuel Tausch

Posted 19 February 2012 - 10:21 AM

actually you can do it with the ftoa() expression, I atttached an example!

cheers,

Manu

Attached Files



Manuel Tausch
senior FX TD - Rhythm & Hues

#7 rdg

rdg

    Houdini Master

  • Members
  • PipPipPipPip
  • 729 posts
  • Joined: 21-August 05
  • Location:weta
  • Name:Georg Duemlein

Posted 19 February 2012 - 12:09 PM

View Posteetu, on 19 February 2012 - 08:29 AM, said:

exhelp stamps() ?

Tricks me all the time, but this one only works in DOPS.

Quote

Examples of string stamping operators include the Apply Relationship
        DOP, and the Copy Data DOP.

Sadly this is the only hint in the documentation that it won't work in SOPs.


@asnowcappedromance
I think they're talking about stamping a 'real' string - like a filename.
In your example a stamp of $PT works just as fine.
The Industrial Parametrization of the World
http://rdg.preset.de/

#8 hopbin9

hopbin9

    Houdini Master

  • Members
  • PipPipPipPip
  • 803 posts
  • Joined: 14-March 10
  • Location:Canada
  • Name:Hop Bin

Posted 19 February 2012 - 12:30 PM

View Postasnowcappedromance, on 19 February 2012 - 10:21 AM, said:

actually you can do it with the ftoa() expression, I atttached an example!

cheers,

Manu

I see what you're doing, but I need to stamp a string value (like a phrase or description).

The attached is how I ended up doing it. Using $PT on the Copy SOP so I could look up the attribute from the point templates.

Attached Files


Posted Image
Come download the free open source asset library for Houdini.
Help us reach 1,000 fans on facebook!

#9 hopbin9

hopbin9

    Houdini Master

  • Members
  • PipPipPipPip
  • 803 posts
  • Joined: 14-March 10
  • Location:Canada
  • Name:Hop Bin

Posted 19 February 2012 - 12:33 PM

View Postvectorblur, on 19 February 2012 - 10:10 AM, said:

also could someone explain in simple programming terms how copy stamping is achieved ?

We connect nodes in Houdini from the top down, but nodes are cooked from the bottom up. So in programming terms, when the Copy SOP is cooked. It then cooks it's inputs X number of times. Each time it does that it changes the value stored in the stamp variables. Allowing each input node to be changed with each copy.
Posted Image
Come download the free open source asset library for Houdini.
Help us reach 1,000 fans on facebook!

#10 Macha

Macha

    Grand Master

  • Members
  • PipPipPipPipPip
  • 1,654 posts
  • Joined: 23-July 08
  • Location:The Small Big P
  • Name:Marc ♥

Posted 19 February 2012 - 01:27 PM

Great, I didn't know the bottom up cooking. Does it not have to cook once the whole way down, or how does it know what data is at the bottom? Is it some kind of recursion thing?
My Vimeo

LinkedIn

improve side effects - use haskell


#11 hopbin9

hopbin9

    Houdini Master

  • Members
  • PipPipPipPip
  • 803 posts
  • Joined: 14-March 10
  • Location:Canada
  • Name:Hop Bin

Posted 19 February 2012 - 02:19 PM

View PostMacha, on 19 February 2012 - 01:27 PM, said:

Great, I didn't know the bottom up cooking. Does it not have to cook once the whole way down, or how does it know what data is at the bottom? Is it some kind of recursion thing?

Houdini ALWAYS cooks from the bottom up. Except for VOP networks they execute more like source code, but you could think of it as LEFT to RIGHT cooking order.

When you mark as SOP node blue, then that becomes the first node cooked at render time. How it works is kind of like this.

First node cooked is the blue marked node, but when it cooks it can't finish cooking. So it asks the node connected to it's input to cook. That node will cook (if it can) and return the result. Often nodes are cooked up the tree until they hit one marked RED or one with no inputs. If you know computer programming, then this type of cooking is called recursive function calls.

I should put together an AF explanation of how this works, because it would really help people to understand concepts like Copy SOP, attributes and the cook order of things. The big problem here, is that we are taught to create Houdini nodes in the reverse order that they will be cooked. So it's very confusing to understand for a beginner.
Posted Image
Come download the free open source asset library for Houdini.
Help us reach 1,000 fans on facebook!

#12 eetu

eetu

    Illusionist

  • Members
  • PipPipPip
  • 479 posts
  • Joined: 30-May 07
  • Location:Helsinki, Finland
  • Name:eetu m

Posted 19 February 2012 - 02:35 PM

View Posthopbin9, on 19 February 2012 - 02:19 PM, said:

When you mark as SOP node blue, then that becomes the first node cooked at render time. How it works is kind of like this.

Then again, it is also the last node to cook, in a way, right? ;)
A shitty theory is better than no theory at all




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users