QUESTION: Blender Python Bare Basics?

I’m going to do some more Python study and see if I can’t learn some more to better my self in this stuff.

If you have any resources that could help me, I’d really appreciate it.

I already tried codecademy.com, it taught me the stuff I needed to begin, but not in the context of Blender.
I’ve followed tutorials on CGCookie, but that’s kind of limited.
I’m currently looking through a blog on BPY.

I just need something that will give me a lot of good solid knowledge that I won’t lose immediately and I can use it on many topices, not such specific ones.

I really need the bare basics.

Where to begin, not just how to do something. I want something that will teach me how to build a code with a solid structure so I can have a sense of what I’m doing, rather than taking snippets of code, gluing them together and hoping that they work and having no idea what to do when they don’t.

Sorry for rambling. I just have this itch to learn this stuff and nothing seems to scratch it.

Thanks to all who reply.

-Blake

How I learnt:

taking snippets of code, gluing them together and hoping that they work

I of course knew what it would do (or at least what I expected it should do) and just changed it until it worked. Do this enough and you’ll one day realize you’re not a noob anymore.

Learn to walk before you try to run :wink:

http://www.blender.org/documentation/blender_python_api_2_69_7/
EDIT:
Python related
official documentation for looking up things
http://docs.python.org/3/tutorial/index.html
http://docs.python.org/3/library/index.html

https://wiki.python.org/moin/BeginnersGuide
https://wiki.python.org/moin/BeginnersGuide/NonProgrammers

I have made a book for people with zero experience with coding

http://wiki.blender.org/index.php/User:Kilon/Python_book_of_magic

IMO it’s good to learn python in general, specially object oriented principles. Then the bpy module will start to make a lot of sense. I recommend “Think Python” (free ebook) and Python 3 Object Oriented Programming from packt publishing.

The python API is huge, but at some point you’ll see is just a matter of reading the API docs a lot to do something you don’t know how to do. Adding functionality to the API is another story.

It would be helpful for us trying to help you if we had an idea of your current abilities:

  • have you worked with any other programming languages? if so, which ones?

  • do you understand what Object Oriented Programming is?

  • have you worked in a command line environment before? For learning blender python, autocomplete is going to be your very best friend.

  • What are you trying to do with blender from the python API? You’re asking for a “widget”, and I hope that instead you want a specific result. If you don’t have one, i’d suggest picking a result and working towards it. This will help to give you a focused foundation to build on and around and a goal to work towards.

Thank you to everyone for the links and advice!

@AlphaNow: 1. I have worked with HTML/CSS, but I cut that short when I first began Python. I went through a small amount of Microsoft Small Basic, but I didn’t find it useful for my future.

  1. I may have, and just never heard it called that. More than likely not.

  2. Well, I’m not sure what that means exactly, but my basic setup for Blender when scripting is Windows for the Text Editor, 3D Viewport, Python Console, Command History (In the Info Panel), and sometimes the Logic Editor. If any of that was relevant to the question.

  3. Well, my main goal is to be able to understand what I’m writing a bit more clearly. I plan to use it in game development for things such as: GLSL Shader writing, simple/ complex animations, light and camera effects.

That’s really great kilon, wish I’d seen that when I started

Thank you. I feel great when I hear that people find my book helpful and easy to follow.

The book is linked here http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts which is the main page for learning how to make addons. I have also edited the page to add additional resources for learning how to code blender addons. I am always open to suggestions.

http://www.diveintopython3.net/

Don’t bother learning 2.5 (imo). If you are just starting, start with the latest and greatest. Big changes were made to help development.

Thanks again guys! I really appreciate it!