Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7968307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:03:20+00:00 2026-06-04T07:03:20+00:00

Just wondering if anyone can help me with a little programming math i’m having

  • 0

Just wondering if anyone can help me with a little programming math i’m having trouble with.

What I am trying to create is a submit script (using python and .bat) for Nuke (vfx). The issue I am having is I can’t figure out how to add the remainder of frames to the already calculated stack.

To be more clear…

In Nuke, i have to render 20 frames. I have 16 threads. Nuke only uses 1 thread. I want to write a script that takes the number of frames and divide it by the number of threads and write out a bat file using python. The issue come is when I have a remainder. I want to take the remainder and apply it back in the render stack.

example (first loop)

thread1 = 1 frame
thread2 = 1 frame
thread3 = 1 frame
thread4 = 1 frame
thread5 = 1 frame
thread6 = 1 frame
...
thread16 = 1 frame

Once it has done this…the remainder is 4. I want the remainder to be distributed among the threads.
so…

example (second loops)

thread1 = 2 frame
thread2 = 2 frame
thread3 = 2 frame
thread4 = 2 frame
thread5 = 1 frame
thread6 = 1 frame
...
thread16 = 1 frame

the 4 gets added among the first few threads totalling 20 frames.

I will greatly appreciate any help, tips, comments that anyone has to offer. 🙂

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:03:21+00:00Added an answer on June 4, 2026 at 7:03 am

    frames can be a list of any object, eg dict or “Frame” object. Here I have just used ints

    >>> frames = range(20)
    >>> threads = 16
    >>> [frames[x::threads] for x in range(threads)]
    [[0, 16], [1, 17], [2, 18], [3, 19], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15]]
    

    I think you may be better off putting the frames in a Queue though, since some frames may render faster than others

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wondering if anyone can help me with this slight issue. I'm writing a
I was just wondering if anyone could help me create a mysql function UUID_SHORT()
Just wondering if anyone can help me in andriod app development. I'm new to
Just wondering if anyone can help me with a problem I've come across in
Wondering if anyone can help me with this slight problem i'm having. I am
I was wondering if anyone can help me understand how exactly to create different
Just wondering if anyone has any ideas on how we can style templates... Like
Just wondering if anyone has some good resources for learning how to create new
I'm just wondering if anyone has had any problems having too many subscribers for
I'm just learning jQuery, and I'm trying to write a little script. To sum

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.