Jump to content

terminating 'for' loop in a callback script


AdamJ

Recommended Posts

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

Link to comment
Share on other sites

.. 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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...