Blender Python Console helpful definitions

Hey everyone! I recognize that not all of us are uber-1337 programmer types, so I’ve made some definitions for you to shove into the console to help you out with a few things.

Please keep in mind when using these that they are not perfect, and that if you don’t like how they work, you can make them better. For example, setting them up with Try and Except!

And then provide them to the rest of us since I’m providing these and nobody likes code-hoggers when they’re using freely distributed code and then keeping it to themselves after.

This code is for those of you who find a hexcode for a color you like and wish to apply it to your object more easily. Note that your object requires a material. Edit: I tried to make it neater, but I’m not sure if it’ll work because I’m not with my Blender-running computer at the moment.

This code is for creating a list of object names, so you can see what objects are present if you don’t want to look at the properties window.

This code, which can be used in tandem with creating a list of object names and needs the listObjs() code to work [the code just above this!], is for creating object variables more easily. If you’re referencing a string in someway that exists within listObjs(), you can be sure it’ll work.

I might be willing to help with any errors in this base code. Any errors you manage to procure by changing the code I’m less likely to help with. But I might. Asking won’t hurt. Anyway, enjoy.

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

2 Responses to Blender Python Console helpful definitions

  1. ianhdesigns says:

    Thank you gabby this also helps me with my mobile apps class.

    • Gabby B. says:

      No problem, just remember that in Blender’s python, print statements require parentheses.

      Normal Python
      print “Hello world!”

      Blender Python
      print(“Hello world!”)

Comments are closed.