===Python API===

Moved .up() and .down() methods from Modifier API to Modifier sequence
API (also renamed them to moveUp() and moveDown() ).  Locating methods
which modify the "parent" structure in objects didn't seem consistent.
This commit is contained in:
Ken Hughes
2006-06-14 04:41:31 +00:00
parent 090678de66
commit da33f51b76
4 changed files with 156 additions and 140 deletions

View File

@@ -19,7 +19,8 @@ Example::
mod[Modifier.Settings.LEVELS] = 3 # set subsurf subdivision levels to 3
@type Type: readonly dictionary
@var Type: Constant Modifier dict used for L{ModSeq.append()} to a modifier sequence and comparing with L{Modifier.type}:
@var Type: Constant Modifier dict used for L{Modifiers.append()} to a
modifier sequence and comparing with L{Modifier.type}:
- ARMATURE - type value for Armature modifiers
- BOOLEAN - type value for Boolean modifiers
- BUILD - type value for Build modifiers
@@ -72,10 +73,10 @@ Example::
- OPERATION - Used for Wave only
"""
class ModSeq:
class Modifiers:
"""
The ModSeq object
=================
The Modifiers object
====================
This object provides access to list of L{modifiers<Modifier.Modifier>} for a particular object.
Only accessed from L{Object.Object.modifiers}.
"""
@@ -111,11 +112,32 @@ class ModSeq:
@note: Accessing attributes of the modifier after removing will raise an error.
"""
def moveUp(modifier):
"""
Moves the modifier up in the object's modifier stack.
@type modifier: a modifier from this sequence to remove.
@rtype: PyNone
@raise RuntimeError: request to move above another modifier requiring
original data
@note: Accessing attributes of the modifier after removing will raise an error.
"""
def moveDown(modifier):
"""
Moves the modifier down in the object's modifier stack.
@type modifier: a modifier from this sequence to remove.
@rtype: PyNone
@raise RuntimeError: request to move modifier beyond a non-deforming
modifier
@note: Accessing attributes of the modifier after removing will raise an error.
"""
class Modifier:
"""
The Modifier object
===================
This object provides access to a modifier for a particular object accessed from L{ModSeq}.
This object provides access to a modifier for a particular object accessed
from L{Modifiers}.
@ivar name: The name of this modifier. 31 chars max.
@type name: string
@ivar type: The type of this modifier. Read-only. The returned value
@@ -139,20 +161,3 @@ class Modifier:
@raise KeyError: the key does not exist for the modifier
"""
def up():
"""
Moves the modifier up in the object's modifier stack.
@rtype: PyNone
@raise RuntimeError: request to move above another modifier requiring
original data
"""
def down():
"""
Moves the modifier down in the object's modifier stack.
@rtype: PyNone
@raise RuntimeError: request to move modifier beyond a non-deforming
modifier
"""