diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-12-11 11:57:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-12-11 11:57:39 +0300 |
commit | 9c3cacd283008c9ac698d8f8f444c733b0fe61ac (patch) | |
tree | d5a634ea73ab974c0030f149c2bff36ebda2e27d /source | |
parent | b42d1fe5447c6789361fd7e85d04180854ea6e1f (diff) |
added the flag group_exclusive to material
added restrictDraw/Select/Render to objects in python
updated group and scene docs for last commit
made 3ds import use new scn.objects rather then Object.New() - (removed import as instance for now)
fixes off import error from this report http://blenderartists.org/forum/showthread.php?t=84182
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/api2_2x/Material.c | 1 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 33 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Group.py | 21 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Material.py | 1 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Object.py | 6 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Scene.py | 4 |
6 files changed, 52 insertions, 14 deletions
diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index cb5beb7180a..91dc6bbb1be 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -359,6 +359,7 @@ static PyObject *Material_ModesDict( void ) PyConstant_Insert(c, "RAYTRANSP", PyInt_FromLong(MA_RAYTRANSP)); PyConstant_Insert(c, "TANGENT_V", PyInt_FromLong(MA_TANGENT_V)); PyConstant_Insert(c, "NMAP_TS", PyInt_FromLong(MA_NORMAP_TANG)); + PyConstant_Insert(c, "GROUP_EXCLUSIVE", PyInt_FromLong(MA_GROUP_NOLAY)); } return Modes; diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 46998dae42d..c7dc4dfa157 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -4100,6 +4100,25 @@ static int setFloat3Attr( BPy_Object *self, PyObject *value, void *type ) /* BPy_Object methods and attribute handlers */ /*****************************************************************************/ +static PyObject *Object_getRestricted( BPy_Object *self, void *type ) +{ + if (self->object->restrictflag & (short)type) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + +static int Object_setRestricted( BPy_Object *self, PyObject *value, + void *type ) +{ + if (PyObject_IsTrue(value) ) + self->object->restrictflag |= (short)type; + else + self->object->restrictflag &= ~(short)type; + + return 0; +} + static PyObject *Object_getDrawModeBits( BPy_Object *self, void *type ) { return EXPP_getBitfield( (void *)&self->object->dtx, (int)type, 'b' ); @@ -5057,6 +5076,20 @@ static PyGetSetDef BPy_Object_getseters[] = { (getter)Object_getType, (setter)NULL, "String describing Object type", NULL}, + + {"restrictDisplay", + (getter)Object_getRestricted, (setter)Object_setRestricted, + "Toggle object restrictions", + (void *)OB_RESTRICT_VIEW}, + {"restrictSelect", + (getter)Object_getRestricted, (setter)Object_setRestricted, + "Toggle object restrictions", + (void *)OB_RESTRICT_SELECT}, + {"restrictRender", + (getter)Object_getRestricted, (setter)Object_setRestricted, + "Toggle object restrictions", + (void *)OB_RESTRICT_RENDER}, + {"properties", (getter)Object_GetProperties, (setter)NULL, "Get the ID properties associated with this object"}, {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ diff --git a/source/blender/python/api2_2x/doc/Group.py b/source/blender/python/api2_2x/doc/Group.py index 22fdf47ef31..695ccb5ac81 100644 --- a/source/blender/python/api2_2x/doc/Group.py +++ b/source/blender/python/api2_2x/doc/Group.py @@ -15,9 +15,9 @@ Example:: from Blender import * scn= Scene.GetCurrent() - for ob in Object.GetSelected(): + for ob in scn.objects: print 'Object Group Settings' - print ob.name, ob.getType() + print ob.name, ob.type print 'enableDupVerts:', ob.enableDupVerts print 'enableDupFrames:', ob.enableDupFrames print 'enableDupGroup:', ob.enableDupGroup @@ -27,9 +27,7 @@ Example:: for dup_ob, dup_matrix in dupe_obs: print '\tDupOb', dup_ob.name - new_ob= Object.New(dup_ob.getType()) - new_ob.shareFrom(dup_ob) - scn.link(new_ob) + scn.objects.new(dup_ob.data) new_ob.setMatrix(dup_matrix) new_ob.sel= 1 # select all real instances. @@ -46,14 +44,13 @@ Example:: scn= Scene.GetCurrent() # New Group - gp= Group.New('mygroup') - gp.objects= Object.GetSelected() + grp= Group.New('mygroup') + grp.objects= scn.objects # Instance the group at an empty using dupligroups - ob= Object.New('Empty') - scn.link(ob) + ob= scn.objects.new(None) ob.enableDupGroup= True - ob.DupGroup= gp + ob.DupGroup= grp Window.RedrawAll() """ @@ -94,8 +91,8 @@ class Group: @ivar users: Number of users this group has (read only) @ivar layers: Layer mask for this group. @ivar objects: Objects that this group uses. - This is an iterator with list like access so use list(gp.objects) if you need to use a list. (where gp is a group object). + This is a sequence with list like access so use list(grp.objects) if you need to use a list. (where grp is a group). The groups objects can be set by assigning a list or iterator of objects to the groups objects. - objects.add() and objects.remove() also work with the the objects iterator just like with lists. + objects.link() and objects.unlink() also work with the the objects iterator just like with lists. """ diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py index 946219f277a..3b8c9ed87df 100644 --- a/source/blender/python/api2_2x/doc/Material.py +++ b/source/blender/python/api2_2x/doc/Material.py @@ -66,6 +66,7 @@ Example:: - FULLOSA - Force rendering of all OSA samples. - TANGENT_V - Use the tangent vector in V direction for shading - NMAP_TS - Tangent space normal mapping. + - GROUP_EXCLUSIVE - Light from this group even if the lights are on a hidden Layer. @type Shaders: readonly dictionary @var Shaders: The available Material Shaders. diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py index a9edc897a7b..b793330bbc9 100644 --- a/source/blender/python/api2_2x/doc/Object.py +++ b/source/blender/python/api2_2x/doc/Object.py @@ -250,6 +250,12 @@ class Object: this object's ID Properties. Note that dict access is available for groups on the parent L{IDProperty<IDProperty>} object, but for everything else you need to get the L{IDGroup<IDGroup>} object from the L{IDProperty<IDProperty>}'s data member. + @ivar restrictDisplay: Dont display this object in the 3d view, disabled by default, use the outliner to toggle. + @type restrictDisplay: bool + @ivar restrictSelect: Dont select this object in the 3d view, disabled by default, use the outliner to toggle. + @type restrictSelect: bool + @ivar restrictRender: Dont render this object, disabled by default, use the outliner to toggle. + @type restrictRender: bool @ivar LocX: The X location coordinate of the object. @type LocX: float @ivar LocY: The Y location coordinate of the object. diff --git a/source/blender/python/api2_2x/doc/Scene.py b/source/blender/python/api2_2x/doc/Scene.py index 97a837517b2..00d0f00189c 100644 --- a/source/blender/python/api2_2x/doc/Scene.py +++ b/source/blender/python/api2_2x/doc/Scene.py @@ -106,8 +106,8 @@ class Scene: scene.layers = [3] # set layer 3 scene.layers = scene.layers.append(1) print scene.layers # will print: [1, 3] - @type objects: list of objects - @ivar objects: An iterator for the scenes objects with set-like functionality. + @type objects: sequence of objects + @ivar objects: An iterator for the scenes objects with with functions .link(ob) .unlink(ob) .new(obdata) """ def getName(): |