Use a for loop hscript in a button

   2271   3   0
User Avatar
Member
948 posts
Joined: April 2008
Offline
Is there a way to use a for loop in a button?

I want to duplicate an object N number of times with hscript, and I don't want to have to create a HDA just for that so I am trying in the callback script for the button:

for i=1 to 10 opcp ./myNode_1 ./myNode_$i end

This works in the texport but not in the callback, any tips?

Thanks.
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
948 posts
Joined: April 2008
Offline
Is there another way to execute a multi line script with a button besides in a HDA session?
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
7723 posts
Joined: July 2005
Offline
Use python?
User Avatar
Member
948 posts
Joined: April 2008
Offline
Maybe if I can use a for loop in a single line which I don't know since I don't know phyton and just use hscript for everything, hscript was able to give me what I needed so far.

The way I got around the issue using hscript was to write the script into a file and run it through a callback script which worked.

Even thou it would be nice to know if there's a way to do this for loop in a single line inside a callback script.
https://vimeo.com/user2163076 [vimeo.com]
  • Quick Links