Jump to content


terminating 'for' loop in a callback script


  • Please log in to reply
5 replies to this topic

#1 AdamJ

AdamJ

    Initiate

  • Members
  • PipPip
  • 108 posts
  • Joined: 15-April 03
  • Location:Toronto, Canada

Posted 27 January 2005 - 11:34 AM

Hi all,

I'm having trouble getting the callback script to run properly.  It's
suppouse to duplicate a few nodes when the user presses the button.
Problem is that the callback script doesn't seem to finish unless
I type in the texport 'end'.  What I'm after is

for i = 1 to 4
opcp node_0 node $i;
end

but when trying to run this from callback the 'end' has no effect.
Is there another way I should be doing this?  Any tips and
suggestions are appreciated.

Adam

#2 AdamJ

AdamJ

    Initiate

  • Members
  • PipPip
  • 108 posts
  • Joined: 15-April 03
  • Location:Toronto, Canada

Posted 27 January 2005 - 01:36 PM

.. in case anyone is interested.. I got it working by including the scripts
in the HDA and then opdef them in the callback line.  Seems Houdini
had a problem with having the entire script as one line in the callback
field.

#3 old school

old school

    Houdini Master

  • Members
  • PipPipPipPip
  • 897 posts
  • Joined: 21-March 03
  • Location:The Great White North

Posted 28 January 2005 - 09:31 AM

Tip and suggestion? How about trying the help in the textport for proper if useage.

Here it is for you:

/ -> help if
if
        Usage:  if (condition) [then]

        The if construct.  If the condition is met, then the contents
        of the if statement will be executed.  An endif statement is
        required to terminte the if clause.  For example:
            if ( $F == 1 ) then
                echo Frame One
            else
                echo Another frame
            endif
        Note:  In the current implementation, the statements for the
        if clause must occur on separate lines.  That is, statements
        like "if ($F == 1) echo Frame One" will not work.


As you can see, endif is the terminator for the if statement in hscript.
There's at least one school like the old school!

#4 AdamJ

AdamJ

    Initiate

  • Members
  • PipPip
  • 108 posts
  • Joined: 15-April 03
  • Location:Toronto, Canada

Posted 28 January 2005 - 11:21 AM

yep that was the problem .. the if/for/end statements have to be on
seperate lines.. read the 'for' help, didn't read 'if' help ...doh!   :rolleyes:

#5 michael

michael

    The Deaf Stamp!

  • Administrators
  • 3,769 posts
  • Joined: 25-June 02
  • Location:Toronto, Canada
  • Name:Michael Goldfarb

Posted 28 January 2005 - 12:02 PM

Quote

...in the HDA and then opdef them in the callback line

are the nodes duplicated in the hda?...or just in the houdini session?
Michael Goldfarb | CG Supervisor | Mr. X

#6 AdamJ

AdamJ

    Initiate

  • Members
  • PipPip
  • 108 posts
  • Joined: 15-April 03
  • Location:Toronto, Canada

Posted 28 January 2005 - 12:46 PM

They are getting copied in the houdini session.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users