Showing posts with label bpy25. Show all posts
Showing posts with label bpy25. Show all posts

Blend the body electric



e=bpy.data.objects["Cube"] print(e.color) print(e.location) print(e.matrix) print("ctrl space for command completion") print(bpy.app.version) from bpy import context f=open("/home/motey/dirbpy.txt","w") for x in dir(bpy): f.write(x+"\n") f.close print("script complete")

This is a script that I am using with blender. Because I am lazy and creative and the interface is subject to change, I am doing what I would do to "discover" the interface and then perform functions against it. It is one or two steps back from actually programming as I define the connection between information and methods and use cases.

By associating a complete description with each shorthand object it is easier to identify and differentiate changes. So long as it is simply a name change then it is as simple click connect in the game controller frame.

Discovery of the interface python commands, search of the source, web sites, code libraries or actually any source. The discovered data is then organized and identified by its type. The use of the information is through meta code and the meta code simply needs to connect with the object that it needs to operate upon. If there is a conflict or missing part then I would be required to determine a new decision algorithm. If I choose simple methods which are not likely to go away, but may have new access methods, I can avoid work later. It is not likely that a vertex could ever be defined without a location and so I am safe in modifying that property. Certainly the names could change from "Cube" or object.location[1], but it would no longer be blender if certain constraints did not exist. If I am also proactive for new features then it can be automatically skipped if it does not exist. It only requires that any method I apply be aware of its absolute dependencies and as such a method cannot be initiated if it does not have its dependency met.

He who laughs last

Is slow witted.


class ObjectButtonsPanel(bpy.types.Panel):
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"
    bl_context = "object"

class OBJECT_PT_pingpong(ObjectButtonsPanel):
    bl_label = "Ping Pong"

Ira Krakow has been making new videos for Blender 2.5 with Python 3 and the code above is part of an example script. He talks pretty fast and that is fine as I have enough understanding of Python flavors and a grasp of the blender interface, but if you want to learn blender from scratch, don't start here as you will have a stroke trying to keep up. Ira seems to have a very good grasp of the interface, Python and the concepts involved. The tuts are much appreciated.

I had some frustration the first time I decided to do a little object to demonstrate something with an image. It is different enough that it has taken me about 30 minutes to find all the things that I used to use and learn the new associations and relationships.

The interface is smoother and functionality is much greater so that comes with more complexity , which can't be avoided. They are doing a good job and translation of scripts that I use is under way. I did not see a makehuman conversion to python 3, so I will put those on the blender site if nobody else does it before me.

This link is to the Blender 2.5x Python 3.x API and as of 3-18-2010 it is still unstable. This is a great opportunity to integrate all of my tools to a higher level. By designing meta code script that generates the Python it makes it possible to easily convert old scripts and create new scripts to an interface that may change.

Contributors

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen