Hi
I try to use the Armature module, but I get stuck.
Is there any documentation?
I am certain there was a way to print out all possible attributes (LocX LocY RotZ and so on) of a module/object, whatever. What's the syntax for that?
print dir () seems to only do functions.
thanks in advance
Haunt_House
exploring armature module
Moderators: jesterKing, stiv
well, you can always try creating an armature and using:
Of course, if you don't know how Get work:
Martin
Code: Select all
import Blender
armature = Blender.Armature.Get()[0]
print dir(armature)
Code: Select all
import Blender
print Blender.Armature.Get.__doc__
Life is what happens to you when you're busy making other plans.
- John Lennon
- John Lennon
-
- Posts: 24
- Joined: Tue Oct 22, 2002 9:03 am
well, that gives me some functions. But the attributes stay hidden.
you see, I just want to change the root of a bone, for example.
Is it just me, or are the new modules totally useless without documentation? Sorry, but I don't want to search the source code, just because I want to use a python module. This searching costs a damn amount of time. And until now it was futile.
sigh
Haunt_House
you see, I just want to change the root of a bone, for example.
Is it just me, or are the new modules totally useless without documentation? Sorry, but I don't want to search the source code, just because I want to use a python module. This searching costs a damn amount of time. And until now it was futile.
sigh
Haunt_House
not to sound rude or anything, but it took me a whole 2 min to do what you want to do, knowing nothing of the Armature module to start with.
Creating a random armature beforehand.
Martin
Creating a random armature beforehand.
Code: Select all
import Blender
print dir(Blender.Armature)
['Bone', 'Get', 'New', '__doc__', '__name__', 'get']
Code: Select all
import Blender
print Blender.Armature.Get.__doc__
(name) - return the armature with the name 'name', returns None if not found.
If 'name' is not specified, it returns a list of all armatures in the
current scene.
Code: Select all
import Blender
arm = Blender.Armature.Get("Armature")
print dir(arm)
['bones', 'getBones', 'getName', 'name', 'setName']
Code: Select all
import Blender
import Blender
arm = Blender.Armature.Get("Armature")
print arm.getBones.__doc__
() - return Armature root bones
Code: Select all
import Blender
arm = Blender.Armature.Get("Armature")
bone = arm.getBones()
print bone
[[Bone "Bone"]]
Code: Select all
import Blender
arm = Blender.Armature.Get("Armature")
bone = arm.getBones()[0]
print dir(bone)
['children', 'getChildren', 'getHead', 'getLoc', 'getName', 'getParent', 'getQua
t', 'getRoll', 'getSize', 'getTail', 'hasParent', 'head', 'loc', 'name', 'parent
', 'quat', 'roll', 'setHead', 'setLoc', 'setName', 'setQuat', 'setRoll', 'setSiz
e', 'setTail', 'size', 'tail']
Code: Select all
import Blender
arm = Blender.Armature.Get("Armature")
bone = arm.getBones()[0]
d = dir(bone)
for f in d:
exec("print \"" + f + ": \"" + " + str(bone." + f + ".__doc__)")
without being a full standalone doc, I think what is already avalaible is helpful enough to get everyone started.children: list() -> new list
list(sequence) -> new list initialized from sequence's items
getChildren: () - return Bone children list
getHead: () - return Bone head
getLoc: () - return Bone loc
getName: () - return Bone name
getParent: () - return the parent bone of this one if it exists. Otherwise raise
an error. Check this condition with the hasParent() method.
getQuat: () - return Bone quat
getRoll: () - return Bone roll
getSize: () - return Bone size
getTail: () - return Bone tail
hasParent: () - return true if bone has a parent
head: list() -> new list
list(sequence) -> new list initialized from sequence's items
loc: list() -> new list
list(sequence) -> new list initialized from sequence's items
name: str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
parent: None
quat: list() -> new list
list(sequence) -> new list initialized from sequence's items
roll: float(x) -> floating point number
Convert a string or number to a floating point number, if possible.
setHead: (float,float,float) - set Bone head pos
setLoc: (float,float,float) - set Bone loc
setName: (str) - rename Bone
setQuat: (float,float,float,float) - set Bone quat
setRoll: (float) - set Bone roll
setSize: (float,float,float) - set Bone size
setTail: (float,float,float) - set Bone tail pos
size: list() -> new list
list(sequence) -> new list initialized from sequence's items
tail: list() -> new list
list(sequence) -> new list initialized from sequence's items
Martin
Life is what happens to you when you're busy making other plans.
- John Lennon
- John Lennon
-
- Posts: 24
- Joined: Tue Oct 22, 2002 9:03 am