Simple Python script to shuffle textures in the scene

Hey,

I am doing a set of lottery ball animations (39 of them) in Blender 2.69 and need a utility python-script to speed up my workflow.

** My budget for the job is 50 USD **

Rough description of the functionality, it doesn’t need a pretty UI, just something I can run…

  • User selects a lottery ball, for example “LOTTERYBALL.012”
  • User runs the script
  • Script prompts for a number between 1…39
  • Script changes the image texture of the selected ball to a given number (“NumberTexture_30.png” for instance)
  • Script iterates through the remaining 38 ball-objects in the scene (name prefix “LOTTERYBALL.”) and assigns a random number texture between “NumberTexture_01.png” and “NumberTexture_39.png”.

Please note, there are 39 balls in the scene and each should have a unique texture (numbers 1 through 39) in them, no duplicates. Another note: the ball naming (LOTTERYBALL.##) and texture names (NumberTexture_##.png) should be easy to change, so please use variables for those.

Simple, eh? :slight_smile:

I think an experienced bpy-scripter can pull this off in about 20 minutes… If you are interested, please let me know. Payment preferably via Paypal.

Simplified scene for development with embedded textures can be downloaded from:

(This is my first post on BA, so if I am doing this wrong, just let me know)

Thanks for reading.

I’m up for it.

Wouldn’t it be better if the material was changed instead? Or you still insist on changing texture?

Hey iPLEOMAX,

sure material change is sufficient. There are all the required materials already in the scene, so no problem at all.

I started to tinker around with Python myself already and I have it almost working, but if you can help me out with this one, would be very cool, so I can work on my animations/simulations instead.

Solved.

iPLEOMAX helped me with my script and did a great job with it.