Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2015
    Posts
    3

    Houdini Technical Rigging 5: Help [Solved]

    Hi folks,

    I'm trying my luck here and hope that someone can help me out.

    I'm stuck at video 017 from the Houdini Technical Rigging 5 series. Steve uses an expression to calculate the traveled distance of a null over a certain number of frames.

    Code:
    tally = 0.0
    for i in range(lvar('I')):
        expression = 'chopci("../dinstanceTravelled", $C,' + str(int(i)) + ')'
        tally += hscriptExpression(expression)
        
    return tally
    However, I am getting this error:

    TypeError: range() integer end argument expected, got float.
    Any help?

    *edit: I've found my solution on the Houdini forum. I am using an Area CHOP instead of an expression now. That seems to work out fantastic!
    Last edited by Tommy Visser; 09-20-2015 at 03:28 PM. Reason: Solved

  2. #2
    Join Date
    Aug 2003
    Posts
    333
    Thanks for answering your own question. I just started the lessons and if I get stuck I'm sure this will help.

  3. #3
    Join Date
    Aug 2003
    Posts
    333
    I made it to this point now. The problem is that range doesn't work with float values. I have no idea why it worked for Steve, but here is the corrected line of code:

    Code:
    for i in range(int(lvar('I'))):

  4. #4
    Join Date
    Jan 2007
    Posts
    640
    It could be a difference in versions. Either Houdini itself or Python.

  5. #5
    Join Date
    Nov 2015
    Posts
    1

  6. #6
    Join Date
    Apr 2017
    Posts
    0

  7. #7
    Join Date
    Jun 2016
    Posts
    16
    Hi bro, help me?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •