Thread: [cgkit-commits] SF.net SVN: cgkit: [40] maya/trunk/maya_wrapper/maya/api
Brought to you by:
mbaas
From: <mb...@us...> - 2006-09-20 14:21:30
|
Revision: 40 http://svn.sourceforge.net/cgkit/?rev=40&view=rev Author: mbaas Date: 2006-09-20 07:21:22 -0700 (Wed, 20 Sep 2006) Log Message: ----------- Added Python wrappers for MObjectArray and MPointArray to be able to provide a custom constructor. Modified Paths: -------------- maya/trunk/maya_wrapper/maya/api/__init__.py Added Paths: ----------- maya/trunk/maya_wrapper/maya/api/mobjectarray.py maya/trunk/maya_wrapper/maya/api/mpointarray.py Modified: maya/trunk/maya_wrapper/maya/api/__init__.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/__init__.py 2006-08-18 14:18:36 UTC (rev 39) +++ maya/trunk/maya_wrapper/maya/api/__init__.py 2006-09-20 14:21:22 UTC (rev 40) @@ -27,6 +27,7 @@ # Replace some objects by Python wrappers... +from mfnplugin import MFnPlugin +from mobjectarray import MObjectArray +from mpointarray import MPointArray from mvector import MVector - -from mfnplugin import MFnPlugin Added: maya/trunk/maya_wrapper/maya/api/mobjectarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mobjectarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mobjectarray.py 2006-09-20 14:21:22 UTC (rev 40) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MObjectArray wrapper +###################################################################### + +from maya import _api + +class MObjectArray(_api.MObjectArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MObjectArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MObjectArray.__init__(self, size) + for i,obj in enumerate(args[0]): + self[i] = obj + except: + _api.MObjectArray.__init__(self, *args) + else: + _api.MObjectArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mobjectarray.py ___________________________________________________________________ Name: svn:eol-style + native Added: maya/trunk/maya_wrapper/maya/api/mpointarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mpointarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mpointarray.py 2006-09-20 14:21:22 UTC (rev 40) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MPointArray wrapper +###################################################################### + +from maya import _api + +class MPointArray(_api.MPointArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MPointArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MPointArray.__init__(self, size) + for i,pnt in enumerate(args[0]): + self[i] = pnt + except: + _api.MPointArray.__init__(self, *args) + else: + _api.MPointArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mpointarray.py ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mb...@us...> - 2006-09-26 16:44:15
|
Revision: 61 http://svn.sourceforge.net/cgkit/?rev=61&view=rev Author: mbaas Date: 2006-09-26 09:44:04 -0700 (Tue, 26 Sep 2006) Log Message: ----------- Added Python wrappers for MMatrix and MFloatMatrix so that the constructors can be customized. Modified Paths: -------------- maya/trunk/maya_wrapper/maya/api/__init__.py Added Paths: ----------- maya/trunk/maya_wrapper/maya/api/mfloatmatrix.py maya/trunk/maya_wrapper/maya/api/mmatrix.py Modified: maya/trunk/maya_wrapper/maya/api/__init__.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/__init__.py 2006-09-26 16:42:53 UTC (rev 60) +++ maya/trunk/maya_wrapper/maya/api/__init__.py 2006-09-26 16:44:04 UTC (rev 61) @@ -27,7 +27,9 @@ # Replace some objects by Python wrappers... +from mfloatmatrix import MFloatMatrix from mfnplugin import MFnPlugin +from mmatrix import MMatrix from mobjectarray import MObjectArray from mpointarray import MPointArray from mvector import MVector Added: maya/trunk/maya_wrapper/maya/api/mfloatmatrix.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mfloatmatrix.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mfloatmatrix.py 2006-09-26 16:44:04 UTC (rev 61) @@ -0,0 +1,51 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MFloatMatrix wrapper +###################################################################### + +from maya import _api + +class MFloatMatrix(_api.MFloatMatrix): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1: + # Check if it is a sequence... + try: + size = len(args[0]) + seq = args[0] + if size==4: + _api.MFloatMatrix.__init__(self) + self[0] = seq[0] + self[1] = seq[1] + self[2] = seq[2] + self[3] = seq[3] + else: + # This will raise an error because args is invalid + _api.MFloatMatrix.__init__(self, *args) + except: + _api.MFloatMatrix.__init__(self, *args) + else: + _api.MFloatMatrix.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mfloatmatrix.py ___________________________________________________________________ Name: svn:eol-style + native Added: maya/trunk/maya_wrapper/maya/api/mmatrix.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mmatrix.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mmatrix.py 2006-09-26 16:44:04 UTC (rev 61) @@ -0,0 +1,51 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MMatrix wrapper +###################################################################### + +from maya import _api + +class MMatrix(_api.MMatrix): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1: + # Check if it is a sequence... + try: + size = len(args[0]) + seq = args[0] + if size==4: + _api.MMatrix.__init__(self) + self[0] = seq[0] + self[1] = seq[1] + self[2] = seq[2] + self[3] = seq[3] + else: + # This will raise an error because args is invalid + _api.MMatrix.__init__(self, *args) + except: + _api.MMatrix.__init__(self, *args) + else: + _api.MMatrix.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mmatrix.py ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mb...@us...> - 2006-09-29 16:58:30
|
Revision: 64 http://svn.sourceforge.net/cgkit/?rev=64&view=rev Author: mbaas Date: 2006-09-29 09:58:20 -0700 (Fri, 29 Sep 2006) Log Message: ----------- Removed the MVector wrapper and added the MVectorArray wrapper. Modified Paths: -------------- maya/trunk/maya_wrapper/maya/api/__init__.py Added Paths: ----------- maya/trunk/maya_wrapper/maya/api/mvectorarray.py Removed Paths: ------------- maya/trunk/maya_wrapper/maya/api/mvector.py Modified: maya/trunk/maya_wrapper/maya/api/__init__.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/__init__.py 2006-09-28 12:17:10 UTC (rev 63) +++ maya/trunk/maya_wrapper/maya/api/__init__.py 2006-09-29 16:58:20 UTC (rev 64) @@ -32,4 +32,5 @@ from mmatrix import MMatrix from mobjectarray import MObjectArray from mpointarray import MPointArray -from mvector import MVector +from mvectorarray import MVectorArray +#from mvector import MVector Deleted: maya/trunk/maya_wrapper/maya/api/mvector.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mvector.py 2006-09-28 12:17:10 UTC (rev 63) +++ maya/trunk/maya_wrapper/maya/api/mvector.py 2006-09-29 16:58:20 UTC (rev 64) @@ -1,42 +0,0 @@ -# ***** BEGIN LICENSE BLOCK ***** -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Python Computer Graphics Kit. -# -# The Initial Developer of the Original Code is Matthias Baas. -# Portions created by the Initial Developer are Copyright (C) 2005 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# ***** END LICENSE BLOCK ***** - -###################################################################### -# MVector wrapper -###################################################################### - -from maya import _api - -class MVector(_api.MVector): - - def __init__(self, *args): - # Is there only one argument? - if len(args)==1: - # Check if it is a sequence... - try: - size = len(args[0]) - _api.MVector.__init__(self, *args[0]) - except: - _api.MVector.__init__(self, *args) - else: - _api.MVector.__init__(self, *args) - Added: maya/trunk/maya_wrapper/maya/api/mvectorarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mvectorarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mvectorarray.py 2006-09-29 16:58:20 UTC (rev 64) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MVectorArray wrapper +###################################################################### + +from maya import _api + +class MVectorArray(_api.MVectorArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MVectorArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MVectorArray.__init__(self, size) + for i,v in enumerate(args[0]): + self[i] = v + except: + _api.MVectorArray.__init__(self, *args) + else: + _api.MVectorArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mvectorarray.py ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mb...@us...> - 2006-09-30 11:55:49
|
Revision: 66 http://svn.sourceforge.net/cgkit/?rev=66&view=rev Author: mbaas Date: 2006-09-30 04:55:39 -0700 (Sat, 30 Sep 2006) Log Message: ----------- Added Python wrappers for MFloatPointArray and MFloatVectorArray Modified Paths: -------------- maya/trunk/maya_wrapper/maya/api/__init__.py Added Paths: ----------- maya/trunk/maya_wrapper/maya/api/mfloatpointarray.py maya/trunk/maya_wrapper/maya/api/mfloatvectorarray.py Modified: maya/trunk/maya_wrapper/maya/api/__init__.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/__init__.py 2006-09-29 16:59:06 UTC (rev 65) +++ maya/trunk/maya_wrapper/maya/api/__init__.py 2006-09-30 11:55:39 UTC (rev 66) @@ -28,6 +28,8 @@ # Replace some objects by Python wrappers... from mfloatmatrix import MFloatMatrix +from mfloatpointarray import MFloatPointArray +from mfloatvectorarray import MFloatVectorArray from mfnplugin import MFnPlugin from mmatrix import MMatrix from mobjectarray import MObjectArray Added: maya/trunk/maya_wrapper/maya/api/mfloatpointarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mfloatpointarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mfloatpointarray.py 2006-09-30 11:55:39 UTC (rev 66) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MFloatPointArray wrapper +###################################################################### + +from maya import _api + +class MFloatPointArray(_api.MFloatPointArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MFloatPointArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MFloatPointArray.__init__(self, size) + for i,pnt in enumerate(args[0]): + self[i] = pnt + except: + _api.MFloatPointArray.__init__(self, *args) + else: + _api.MFloatPointArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mfloatpointarray.py ___________________________________________________________________ Name: svn:eol-style + native Added: maya/trunk/maya_wrapper/maya/api/mfloatvectorarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mfloatvectorarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mfloatvectorarray.py 2006-09-30 11:55:39 UTC (rev 66) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MFloatVectorArray wrapper +###################################################################### + +from maya import _api + +class MFloatVectorArray(_api.MFloatVectorArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MFloatVectorArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MFloatVectorArray.__init__(self, size) + for i,v in enumerate(args[0]): + self[i] = v + except: + _api.MFloatVectorArray.__init__(self, *args) + else: + _api.MFloatVectorArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mfloatvectorarray.py ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mb...@us...> - 2006-10-01 16:36:08
|
Revision: 69 http://svn.sourceforge.net/cgkit/?rev=69&view=rev Author: mbaas Date: 2006-10-01 09:35:54 -0700 (Sun, 01 Oct 2006) Log Message: ----------- Added more wrappers Modified Paths: -------------- maya/trunk/maya_wrapper/maya/api/__init__.py Added Paths: ----------- maya/trunk/maya_wrapper/maya/api/mcolorarray.py maya/trunk/maya_wrapper/maya/api/mdoublearray.py maya/trunk/maya_wrapper/maya/api/mfloatarray.py Modified: maya/trunk/maya_wrapper/maya/api/__init__.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/__init__.py 2006-09-30 11:58:38 UTC (rev 68) +++ maya/trunk/maya_wrapper/maya/api/__init__.py 2006-10-01 16:35:54 UTC (rev 69) @@ -27,6 +27,9 @@ # Replace some objects by Python wrappers... +from mcolorarray import MColorArray +from mdoublearray import MDoubleArray +from mfloatarray import MFloatArray from mfloatmatrix import MFloatMatrix from mfloatpointarray import MFloatPointArray from mfloatvectorarray import MFloatVectorArray Added: maya/trunk/maya_wrapper/maya/api/mcolorarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mcolorarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mcolorarray.py 2006-10-01 16:35:54 UTC (rev 69) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MColorArray wrapper +###################################################################### + +from maya import _api + +class MColorArray(_api.MColorArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MColorArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MColorArray.__init__(self, size) + for i,col in enumerate(args[0]): + self[i] = col + except: + _api.MColorArray.__init__(self, *args) + else: + _api.MColorArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mcolorarray.py ___________________________________________________________________ Name: svn:eol-style + native Added: maya/trunk/maya_wrapper/maya/api/mdoublearray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mdoublearray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mdoublearray.py 2006-10-01 16:35:54 UTC (rev 69) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MDoubleArray wrapper +###################################################################### + +from maya import _api + +class MDoubleArray(_api.MDoubleArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MDoubleArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MDoubleArray.__init__(self, size) + for i,val in enumerate(args[0]): + self[i] = val + except: + _api.MDoubleArray.__init__(self, *args) + else: + _api.MDoubleArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mdoublearray.py ___________________________________________________________________ Name: svn:eol-style + native Added: maya/trunk/maya_wrapper/maya/api/mfloatarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mfloatarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mfloatarray.py 2006-10-01 16:35:54 UTC (rev 69) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MFloatArray wrapper +###################################################################### + +from maya import _api + +class MFloatArray(_api.MFloatArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MFloatArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MFloatArray.__init__(self, size) + for i,val in enumerate(args[0]): + self[i] = val + except: + _api.MFloatArray.__init__(self, *args) + else: + _api.MFloatArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mfloatarray.py ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mb...@us...> - 2006-10-03 09:04:22
|
Revision: 81 http://svn.sourceforge.net/cgkit/?rev=81&view=rev Author: mbaas Date: 2006-10-03 02:04:04 -0700 (Tue, 03 Oct 2006) Log Message: ----------- Added manual wrappers and used the set() method instead of the index operator inside the array constructors. Modified Paths: -------------- maya/trunk/maya_wrapper/maya/api/__init__.py maya/trunk/maya_wrapper/maya/api/mcolorarray.py maya/trunk/maya_wrapper/maya/api/mdoublearray.py maya/trunk/maya_wrapper/maya/api/mfloatarray.py maya/trunk/maya_wrapper/maya/api/mfloatpointarray.py maya/trunk/maya_wrapper/maya/api/mfloatvectorarray.py maya/trunk/maya_wrapper/maya/api/mobjectarray.py maya/trunk/maya_wrapper/maya/api/mpointarray.py maya/trunk/maya_wrapper/maya/api/mvectorarray.py Added Paths: ----------- maya/trunk/maya_wrapper/maya/api/mintarray.py maya/trunk/maya_wrapper/maya/api/mstringarray.py maya/trunk/maya_wrapper/maya/api/muintarray.py Modified: maya/trunk/maya_wrapper/maya/api/__init__.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/__init__.py 2006-10-03 09:02:24 UTC (rev 80) +++ maya/trunk/maya_wrapper/maya/api/__init__.py 2006-10-03 09:04:04 UTC (rev 81) @@ -34,8 +34,11 @@ from mfloatpointarray import MFloatPointArray from mfloatvectorarray import MFloatVectorArray from mfnplugin import MFnPlugin +from mintarray import MIntArray from mmatrix import MMatrix from mobjectarray import MObjectArray from mpointarray import MPointArray +from mstringarray import MStringArray +from muintarray import MUintArray from mvectorarray import MVectorArray #from mvector import MVector Modified: maya/trunk/maya_wrapper/maya/api/mcolorarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mcolorarray.py 2006-10-03 09:02:24 UTC (rev 80) +++ maya/trunk/maya_wrapper/maya/api/mcolorarray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -34,9 +34,9 @@ # Check if it is a sequence... try: size = len(args[0]) - _api.MColorArray.__init__(self, size) + _api.MColorArray.__init__(self, size, _api.MColor()) for i,col in enumerate(args[0]): - self[i] = col + self.set(col,i) except: _api.MColorArray.__init__(self, *args) else: Modified: maya/trunk/maya_wrapper/maya/api/mdoublearray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mdoublearray.py 2006-10-03 09:02:24 UTC (rev 80) +++ maya/trunk/maya_wrapper/maya/api/mdoublearray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -36,7 +36,7 @@ size = len(args[0]) _api.MDoubleArray.__init__(self, size) for i,val in enumerate(args[0]): - self[i] = val + self.set(val,i) except: _api.MDoubleArray.__init__(self, *args) else: Modified: maya/trunk/maya_wrapper/maya/api/mfloatarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mfloatarray.py 2006-10-03 09:02:24 UTC (rev 80) +++ maya/trunk/maya_wrapper/maya/api/mfloatarray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -36,7 +36,7 @@ size = len(args[0]) _api.MFloatArray.__init__(self, size) for i,val in enumerate(args[0]): - self[i] = val + self.set(val,i) except: _api.MFloatArray.__init__(self, *args) else: Modified: maya/trunk/maya_wrapper/maya/api/mfloatpointarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mfloatpointarray.py 2006-10-03 09:02:24 UTC (rev 80) +++ maya/trunk/maya_wrapper/maya/api/mfloatpointarray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -36,7 +36,7 @@ size = len(args[0]) _api.MFloatPointArray.__init__(self, size) for i,pnt in enumerate(args[0]): - self[i] = pnt + self.set(pnt,i) except: _api.MFloatPointArray.__init__(self, *args) else: Modified: maya/trunk/maya_wrapper/maya/api/mfloatvectorarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mfloatvectorarray.py 2006-10-03 09:02:24 UTC (rev 80) +++ maya/trunk/maya_wrapper/maya/api/mfloatvectorarray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -36,7 +36,7 @@ size = len(args[0]) _api.MFloatVectorArray.__init__(self, size) for i,v in enumerate(args[0]): - self[i] = v + self.set(v,i) except: _api.MFloatVectorArray.__init__(self, *args) else: Added: maya/trunk/maya_wrapper/maya/api/mintarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mintarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mintarray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MIntArray wrapper +###################################################################### + +from maya import _api + +class MIntArray(_api.MIntArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MIntArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MIntArray.__init__(self, size) + for i,val in enumerate(args[0]): + self.set(val,i) + except: + _api.MIntArray.__init__(self, *args) + else: + _api.MIntArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mintarray.py ___________________________________________________________________ Name: svn:eol-style + native Modified: maya/trunk/maya_wrapper/maya/api/mobjectarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mobjectarray.py 2006-10-03 09:02:24 UTC (rev 80) +++ maya/trunk/maya_wrapper/maya/api/mobjectarray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -36,7 +36,7 @@ size = len(args[0]) _api.MObjectArray.__init__(self, size) for i,obj in enumerate(args[0]): - self[i] = obj + self.set(obj,i) except: _api.MObjectArray.__init__(self, *args) else: Modified: maya/trunk/maya_wrapper/maya/api/mpointarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mpointarray.py 2006-10-03 09:02:24 UTC (rev 80) +++ maya/trunk/maya_wrapper/maya/api/mpointarray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -36,7 +36,7 @@ size = len(args[0]) _api.MPointArray.__init__(self, size) for i,pnt in enumerate(args[0]): - self[i] = pnt + self.set(pnt, i) except: _api.MPointArray.__init__(self, *args) else: Added: maya/trunk/maya_wrapper/maya/api/mstringarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mstringarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mstringarray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MStringArray wrapper +###################################################################### + +from maya import _api + +class MStringArray(_api.MStringArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MStringArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MStringArray.__init__(self, size, _api.MString()) + for i,pnt in enumerate(args[0]): + self.set(pnt, i) + except: + _api.MStringArray.__init__(self, *args) + else: + _api.MStringArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mstringarray.py ___________________________________________________________________ Name: svn:eol-style + native Added: maya/trunk/maya_wrapper/maya/api/muintarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/muintarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/muintarray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MUintArray wrapper +###################################################################### + +from maya import _api + +class MUintArray(_api.MUintArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MUintArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MUintArray.__init__(self, size) + for i,val in enumerate(args[0]): + self.set(val,i) + except: + _api.MUintArray.__init__(self, *args) + else: + _api.MUintArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/muintarray.py ___________________________________________________________________ Name: svn:eol-style + native Modified: maya/trunk/maya_wrapper/maya/api/mvectorarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mvectorarray.py 2006-10-03 09:02:24 UTC (rev 80) +++ maya/trunk/maya_wrapper/maya/api/mvectorarray.py 2006-10-03 09:04:04 UTC (rev 81) @@ -36,7 +36,7 @@ size = len(args[0]) _api.MVectorArray.__init__(self, size) for i,v in enumerate(args[0]): - self[i] = v + self.set(v,i) except: _api.MVectorArray.__init__(self, *args) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mb...@us...> - 2006-10-03 10:12:21
|
Revision: 87 http://svn.sourceforge.net/cgkit/?rev=87&view=rev Author: mbaas Date: 2006-10-03 03:12:08 -0700 (Tue, 03 Oct 2006) Log Message: ----------- Added wrappers. Modified Paths: -------------- maya/trunk/maya_wrapper/maya/api/__init__.py Added Paths: ----------- maya/trunk/maya_wrapper/maya/api/mplugarray.py maya/trunk/maya_wrapper/maya/api/mtimearray.py Modified: maya/trunk/maya_wrapper/maya/api/__init__.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/__init__.py 2006-10-03 10:11:27 UTC (rev 86) +++ maya/trunk/maya_wrapper/maya/api/__init__.py 2006-10-03 10:12:08 UTC (rev 87) @@ -37,8 +37,10 @@ from mintarray import MIntArray from mmatrix import MMatrix from mobjectarray import MObjectArray +from mplugarray import MPlugArray from mpointarray import MPointArray from mstringarray import MStringArray +from mtimearray import MTimeArray from muintarray import MUintArray from mvectorarray import MVectorArray #from mvector import MVector Added: maya/trunk/maya_wrapper/maya/api/mplugarray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mplugarray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mplugarray.py 2006-10-03 10:12:08 UTC (rev 87) @@ -0,0 +1,45 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MPlugArray wrapper +###################################################################### + +from maya import _api + +class MPlugArray(_api.MPlugArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MPlugArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MPlugArray.__init__(self) + self.setLength(size) + for i,val in enumerate(args[0]): + self.set(val, i) + except: + _api.MPlugArray.__init__(self, *args) + else: + _api.MPlugArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mplugarray.py ___________________________________________________________________ Name: svn:eol-style + native Added: maya/trunk/maya_wrapper/maya/api/mtimearray.py =================================================================== --- maya/trunk/maya_wrapper/maya/api/mtimearray.py (rev 0) +++ maya/trunk/maya_wrapper/maya/api/mtimearray.py 2006-10-03 10:12:08 UTC (rev 87) @@ -0,0 +1,44 @@ +# ***** BEGIN LICENSE BLOCK ***** +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Python Computer Graphics Kit. +# +# The Initial Developer of the Original Code is Matthias Baas. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# ***** END LICENSE BLOCK ***** + +###################################################################### +# MTimeArray wrapper +###################################################################### + +from maya import _api + +class MTimeArray(_api.MTimeArray): + + def __init__(self, *args): + # Is there only one argument? + if len(args)==1 and type(args[0])!=_api.MTimeArray: + # Check if it is a sequence... + try: + size = len(args[0]) + _api.MTimeArray.__init__(self, size, _api.MTime()) + for i,time in enumerate(args[0]): + self.set(time, i) + except: + _api.MTimeArray.__init__(self, *args) + else: + _api.MTimeArray.__init__(self, *args) + Property changes on: maya/trunk/maya_wrapper/maya/api/mtimearray.py ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |