From d57e221e3e0aca63715ef37f099f75e5b87f5037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Pinsard?= Date: Mon, 10 May 2021 23:24:30 +0200 Subject: [PATCH] first pass at generating pyi stubs. --- .gitignore | 4 +- scripts/generate_typing_stubs.py | 17 + src/ForwardDeclarations.inl | 23 + src/MDagPath.inl | 2 +- src/MFn.Types.inl | 1152 +++++++++++++++++++++++++++++- src/MFn.inl | 3 - src/MFnDependencyNode.inl | 2 +- src/MObject.inl | 2 +- src/MPlug.inl | 7 +- src/MSelectionList.inl | 14 +- src/Math.inl | 10 +- src/Types.inl | 8 +- src/main.cpp | 2 + 13 files changed, 1220 insertions(+), 26 deletions(-) create mode 100644 scripts/generate_typing_stubs.py create mode 100644 src/ForwardDeclarations.inl diff --git a/.gitignore b/.gitignore index 0b37fae..7a52f5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.dist-info -*.pyd +*.py[id] build/** tmp/* -*.pyc \ No newline at end of file +*.pyc diff --git a/scripts/generate_typing_stubs.py b/scripts/generate_typing_stubs.py new file mode 100644 index 0000000..2fd873c --- /dev/null +++ b/scripts/generate_typing_stubs.py @@ -0,0 +1,17 @@ +"""Generate stubs for cmdc + +For the script to run it needs the following: +1. `pybind11-stubgen` has been installed in mayapy. + `mayapy -m pip install pybind11-stubgen` +2. All the generated Types and functions to be declared + before any of them are implemented. Or at least before being used as type arguments +3. cmdc to be in the PYTHONPATH +""" +import pybind11_stubgen + +module = pybind11_stubgen.ModuleStubsGenerator("cmdc") + +module.parse() # this throws a bunch of warning and then freezes after some point. + +with open("build/cmdc.pyi", "w") as handle: + handle.write("\n".join(module.to_lines())) diff --git a/src/ForwardDeclarations.inl b/src/ForwardDeclarations.inl new file mode 100644 index 0000000..f88bf50 --- /dev/null +++ b/src/ForwardDeclarations.inl @@ -0,0 +1,23 @@ +py::class_ Angle(m, "Angle"); +py::class_ DAGDrawOverrideInfo(m, "DAGDrawOverrideInfo"); +py::class_ DagPath(m, "DagPath"); +py::class_ DataBlock(m, "DataBlock"); +py::class_ DataHandle(m, "DataHandle"); +py::class_ Distance(m, "Distance"); +py::class_ Fn(m, "Fn"); +py::class_ FnDependencyNode(m, "FnDependencyNode"); +py::class_ Matrix(m, "Matrix"); +py::class_ Object(m, "Object"); +py::class_ ObjectHandle(m, "ObjectHandle"); +py::class_ plug(m, "Plug"); +py::class_ Point(m, "Point"); +py::class_ PxData(m, "PxData"); +py::class_ Quaternion(m, "Quaternion"); +py::class_ SelectionList(m, "SelectionList"); +py::class_ Status(m, "Status"); +py::class_ String(m, "String"); +py::class_ Time(m, "Time"); +py::class_ TypeId(m, "TypeId"); +py::class_ Vector(m, "Vector"); +py::enum_ fn_type(Fn, "Type"); +py::class_ Uuid(m, "Uuid"); \ No newline at end of file diff --git a/src/MDagPath.inl b/src/MDagPath.inl index 551675d..71222fa 100644 --- a/src/MDagPath.inl +++ b/src/MDagPath.inl @@ -1,4 +1,4 @@ -py::class_(m, "DagPath") +DagPath .def(py::init<>()) .def(py::self == MDagPath()) diff --git a/src/MFn.Types.inl b/src/MFn.Types.inl index d8deaa4..e64e800 100644 --- a/src/MFn.Types.inl +++ b/src/MFn.Types.inl @@ -1 +1,1151 @@ -// Auto-generated by /Scripts/mfn.py at build type +std::string type_names[] = { + "kInvalid", + "kBase", + "kNamedObject", + "kModel", + "kDependencyNode", + "kAddDoubleLinear", + "kAffect", + "kAnimCurve", + "kAnimCurveTimeToAngular", + "kAnimCurveTimeToDistance", + "kAnimCurveTimeToTime", + "kAnimCurveTimeToUnitless", + "kAnimCurveUnitlessToAngular", + "kAnimCurveUnitlessToDistance", + "kAnimCurveUnitlessToTime", + "kAnimCurveUnitlessToUnitless", + "kResultCurve", + "kResultCurveTimeToAngular", + "kResultCurveTimeToDistance", + "kResultCurveTimeToTime", + "kResultCurveTimeToUnitless", + "kAngleBetween", + "kAudio", + "kBackground", + "kColorBackground", + "kFileBackground", + "kRampBackground", + "kBlend", + "kBlendTwoAttr", + "kBlendWeighted", + "kBlendDevice", + "kBlendColors", + "kBump", + "kBump3d", + "kCameraView", + "kChainToSpline", + "kChoice", + "kCondition", + "kContrast", + "kClampColor", + "kCreate", + "kAlignCurve", + "kAlignSurface", + "kAttachCurve", + "kAttachSurface", + "kAvgCurves", + "kAvgSurfacePoints", + "kAvgNurbsSurfacePoints", + "kBevel", + "kBirailSrf", + "kDPbirailSrf", + "kMPbirailSrf", + "kSPbirailSrf", + "kBoundary", + "kCircle", + "kCloseCurve", + "kClosestPointOnSurface", + "kCloseSurface", + "kCurveFromSurface", + "kCurveFromSurfaceBnd", + "kCurveFromSurfaceCoS", + "kCurveFromSurfaceIso", + "kCurveInfo", + "kDetachCurve", + "kDetachSurface", + "kExtendCurve", + "kExtendSurface", + "kExtrude", + "kFFblendSrf", + "kFFfilletSrf", + "kFilletCurve", + "kFitBspline", + "kFlow", + "kHardenPointCurve", + "kIllustratorCurve", + "kInsertKnotCrv", + "kInsertKnotSrf", + "kIntersectSurface", + "kNurbsTesselate", + "kNurbsPlane", + "kNurbsCube", + "kOffsetCos", + "kOffsetCurve", + "kPlanarTrimSrf", + "kPointOnCurveInfo", + "kPointOnSurfaceInfo", + "kPrimitive", + "kProjectCurve", + "kProjectTangent", + "kRBFsurface", + "kRebuildCurve", + "kRebuildSurface", + "kReverseCurve", + "kReverseSurface", + "kRevolve", + "kRevolvedPrimitive", + "kCone", + "kRenderCone", + "kCylinder", + "kSphere", + "kSkin", + "kStitchSrf", + "kSubCurve", + "kSurfaceInfo", + "kTextCurves", + "kTrim", + "kUntrim", + "kDagNode", + "kProxy", + "kUnderWorld", + "kTransform", + "kAimConstraint", + "kLookAt", + "kGeometryConstraint", + "kGeometryVarGroup", + "kAnyGeometryVarGroup", + "kCurveVarGroup", + "kMeshVarGroup", + "kSurfaceVarGroup", + "kIkEffector", + "kIkHandle", + "kJoint", + "kManipulator3D", + "kArrowManip", + "kAxesActionManip", + "kBallProjectionManip", + "kCircleManip", + "kScreenAlignedCircleManip", + "kCircleSweepManip", + "kConcentricProjectionManip", + "kCubicProjectionManip", + "kCylindricalProjectionManip", + "kDiscManip", + "kFreePointManip", + "kCenterManip", + "kLimitManip", + "kEnableManip", + "kFreePointTriadManip", + "kPropMoveTriadManip", + "kTowPointManip", + "kPolyCreateToolManip", + "kPolySplitToolManip", + "kGeometryOnLineManip", + "kCameraPlaneManip", + "kToggleOnLineManip", + "kStateManip", + "kIsoparmManip", + "kLineManip", + "kManipContainer", + "kAverageCurveManip", + "kBarnDoorManip", + "kBevelManip", + "kBlendManip", + "kButtonManip", + "kCameraManip", + "kCoiManip", + "kCpManip", + "kCreateCVManip", + "kCreateEPManip", + "kCurveEdManip", + "kCurveSegmentManip", + "kDirectionManip", + "kDofManip", + "kDropoffManip", + "kExtendCurveDistanceManip", + "kExtrudeManip", + "kIkSplineManip", + "kIkRPManip", + "kJointClusterManip", + "kLightManip", + "kMotionPathManip", + "kOffsetCosManip", + "kOffsetCurveManip", + "kProjectionManip", + "kPolyProjectionManip", + "kProjectionUVManip", + "kProjectionMultiManip", + "kProjectTangentManip", + "kPropModManip", + "kQuadPtOnLineManip", + "kRbfSrfManip", + "kReverseCurveManip", + "kReverseCrvManip", + "kReverseSurfaceManip", + "kRevolveManip", + "kRevolvedPrimitiveManip", + "kSpotManip", + "kSpotCylinderManip", + "kTriplanarProjectionManip", + "kTrsManip", + "kDblTrsManip", + "kPivotManip2D", + "kManip2DContainer", + "kPolyMoveUVManip", + "kPolyMappingManip", + "kPolyModifierManip", + "kPolyMoveVertexManip", + "kPolyVertexNormalManip", + "kTexSmudgeUVManip", + "kTexLatticeDeformManip", + "kTexLattice", + "kTexSmoothManip", + "kTrsTransManip", + "kTrsInsertManip", + "kTrsXformManip", + "kManipulator2D", + "kTranslateManip2D", + "kPlanarProjectionManip", + "kPointOnCurveManip", + "kTowPointOnCurveManip", + "kMarkerManip", + "kPointOnLineManip", + "kPointOnSurfaceManip", + "kTranslateUVManip", + "kRotateBoxManip", + "kRotateManip", + "kHandleRotateManip", + "kRotateLimitsManip", + "kScaleLimitsManip", + "kScaleManip", + "kScalingBoxManip", + "kScriptManip", + "kSphericalProjectionManip", + "kTextureManip3D", + "kToggleManip", + "kTranslateBoxManip", + "kTranslateLimitsManip", + "kTranslateManip", + "kTrimManip", + "kJointTranslateManip", + "kManipulator", + "kCirclePointManip", + "kDimensionManip", + "kFixedLineManip", + "kLightProjectionGeometry", + "kLineArrowManip", + "kPointManip", + "kTriadManip", + "kNormalConstraint", + "kOrientConstraint", + "kPointConstraint", + "kSymmetryConstraint", + "kParentConstraint", + "kPoleVectorConstraint", + "kScaleConstraint", + "kTangentConstraint", + "kUnknownTransform", + "kWorld", + "kShape", + "kBaseLattice", + "kCamera", + "kCluster", + "kSoftMod", + "kCollision", + "kDummy", + "kEmitter", + "kField", + "kAir", + "kDrag", + "kGravity", + "kNewton", + "kRadial", + "kTurbulence", + "kUniform", + "kVortex", + "kGeometric", + "kCurve", + "kNurbsCurve", + "kNurbsCurveGeom", + "kDimension", + "kAngle", + "kAnnotation", + "kDistance", + "kArcLength", + "kRadius", + "kParamDimension", + "kDirectedDisc", + "kRenderRect", + "kEnvFogShape", + "kLattice", + "kLatticeGeom", + "kLocator", + "kDropoffLocator", + "kMarker", + "kOrientationMarker", + "kPositionMarker", + "kOrientationLocator", + "kTrimLocator", + "kPlane", + "kSketchPlane", + "kGroundPlane", + "kOrthoGrid", + "kSprite", + "kSurface", + "kNurbsSurface", + "kNurbsSurfaceGeom", + "kMesh", + "kMeshGeom", + "kRenderSphere", + "kFlexor", + "kClusterFlexor", + "kGuideLine", + "kLight", + "kAmbientLight", + "kNonAmbientLight", + "kAreaLight", + "kLinearLight", + "kNonExtendedLight", + "kDirectionalLight", + "kPointLight", + "kSpotLight", + "kParticle", + "kPolyToolFeedbackShape", + "kRigidConstraint", + "kRigid", + "kSpring", + "kUnknownDag", + "kDefaultLightList", + "kDeleteComponent", + "kDispatchCompute", + "kShadingEngine", + "kDisplacementShader", + "kDistanceBetween", + "kDOF", + "kDummyConnectable", + "kDynamicsController", + "kGeoConnectable", + "kExpression", + "kExtract", + "kFilter", + "kFilterClosestSample", + "kFilterEuler", + "kFilterSimplify", + "kGammaCorrect", + "kGeometryFilt", + "kBendLattice", + "kBlendShape", + "kCombinationShape", + "kBulgeLattice", + "kFFD", + "kFfdDualBase", + "kRigidDeform", + "kSculpt", + "kTextureDeformer", + "kTextureDeformerHandle", + "kTweak", + "kWeightGeometryFilt", + "kClusterFilter", + "kSoftModFilter", + "kJointCluster", + "kDeltaMush", + "kTension", + "kMorph", + "kSolidify", + "kProximityWrap", + "kWire", + "kGroupId", + "kGroupParts", + "kGuide", + "kHsvToRgb", + "kHyperGraphInfo", + "kHyperLayout", + "kHyperView", + "kIkSolver", + "kMCsolver", + "kPASolver", + "kSCsolver", + "kRPsolver", + "kSplineSolver", + "kIkSystem", + "kImagePlane", + "kLambert", + "kReflect", + "kBlinn", + "kPhong", + "kPhongExplorer", + "kLayeredShader", + "kStandardSurface", + "kLightInfo", + "kLeastSquares", + "kLightFogMaterial", + "kEnvFogMaterial", + "kLightList", + "kLightSource", + "kLuminance", + "kMakeGroup", + "kMaterial", + "kDiffuseMaterial", + "kLambertMaterial", + "kBlinnMaterial", + "kPhongMaterial", + "kLightSourceMaterial", + "kMaterialInfo", + "kMaterialTemplate", + "kMatrixAdd", + "kMatrixHold", + "kMatrixMult", + "kMatrixPass", + "kMatrixWtAdd", + "kMidModifier", + "kMidModifierWithMatrix", + "kPolyBevel", + "kPolyTweak", + "kPolyAppend", + "kPolyChipOff", + "kPolyCloseBorder", + "kPolyCollapseEdge", + "kPolyCollapseF", + "kPolyCylProj", + "kPolyDelEdge", + "kPolyDelFacet", + "kPolyDelVertex", + "kPolyExtrudeFacet", + "kPolyMapCut", + "kPolyMapDel", + "kPolyMapSew", + "kPolyMergeEdge", + "kPolyMergeFacet", + "kPolyMoveEdge", + "kPolyMoveFacet", + "kPolyMoveFacetUV", + "kPolyMoveUV", + "kPolyMoveVertex", + "kPolyMoveVertexUV", + "kPolyNormal", + "kPolyPlanProj", + "kPolyProj", + "kPolyQuad", + "kPolySmooth", + "kPolySoftEdge", + "kPolySphProj", + "kPolySplit", + "kPolySubdEdge", + "kPolySubdFacet", + "kPolyTriangulate", + "kPolyCreator", + "kPolyPrimitive", + "kPolyCone", + "kPolyCube", + "kPolyCylinder", + "kPolyMesh", + "kPolySphere", + "kPolyTorus", + "kPolyCreateFacet", + "kPolyUnite", + "kMotionPath", + "kPluginMotionPathNode", + "kMultilisterLight", + "kMultiplyDivide", + "kOldGeometryConstraint", + "kOpticalFX", + "kParticleAgeMapper", + "kParticleCloud", + "kParticleColorMapper", + "kParticleIncandecenceMapper", + "kParticleTransparencyMapper", + "kPartition", + "kPlace2dTexture", + "kPlace3dTexture", + "kPluginDependNode", + "kPluginLocatorNode", + "kPlusMinusAverage", + "kPointMatrixMult", + "kPolySeparate", + "kPostProcessList", + "kProjection", + "kRecord", + "kRenderUtilityList", + "kReverse", + "kRgbToHsv", + "kRigidSolver", + "kSet", + "kTextureBakeSet", + "kVertexBakeSet", + "kSetRange", + "kShaderGlow", + "kShaderList", + "kShadingMap", + "kSamplerInfo", + "kShapeFragment", + "kSimpleVolumeShader", + "kSl60", + "kSnapshot", + "kStoryBoard", + "kSummaryObject", + "kSuper", + "kControl", + "kSurfaceLuminance", + "kSurfaceShader", + "kTextureList", + "kTextureEnv", + "kEnvBall", + "kEnvCube", + "kEnvChrome", + "kEnvSky", + "kEnvSphere", + "kTexture2d", + "kBulge", + "kChecker", + "kCloth", + "kFileTexture", + "kFractal", + "kGrid", + "kMountain", + "kRamp", + "kStencil", + "kWater", + "kTexture3d", + "kBrownian", + "kCloud", + "kCrater", + "kGranite", + "kLeather", + "kMarble", + "kRock", + "kSnow", + "kSolidFractal", + "kStucco", + "kTxSl", + "kWood", + "kTime", + "kTimeToUnitConversion", + "kRenderSetup", + "kRenderGlobals", + "kRenderGlobalsList", + "kRenderQuality", + "kResolution", + "kHardwareRenderGlobals", + "kArrayMapper", + "kUnitConversion", + "kUnitToTimeConversion", + "kUseBackground", + "kUnknown", + "kVectorProduct", + "kVolumeShader", + "kComponent", + "kCurveCVComponent", + "kCurveEPComponent", + "kCurveKnotComponent", + "kCurveParamComponent", + "kIsoparmComponent", + "kPivotComponent", + "kSurfaceCVComponent", + "kSurfaceEPComponent", + "kSurfaceKnotComponent", + "kEdgeComponent", + "kLatticeComponent", + "kSurfaceRangeComponent", + "kDecayRegionCapComponent", + "kDecayRegionComponent", + "kMeshComponent", + "kMeshEdgeComponent", + "kMeshPolygonComponent", + "kMeshFrEdgeComponent", + "kMeshVertComponent", + "kMeshFaceVertComponent", + "kOrientationComponent", + "kSubVertexComponent", + "kMultiSubVertexComponent", + "kSetGroupComponent", + "kDynParticleSetComponent", + "kSelectionItem", + "kDagSelectionItem", + "kNonDagSelectionItem", + "kItemList", + "kAttribute", + "kNumericAttribute", + "kDoubleAngleAttribute", + "kFloatAngleAttribute", + "kDoubleLinearAttribute", + "kFloatLinearAttribute", + "kTimeAttribute", + "kEnumAttribute", + "kUnitAttribute", + "kTypedAttribute", + "kCompoundAttribute", + "kGenericAttribute", + "kLightDataAttribute", + "kMatrixAttribute", + "kFloatMatrixAttribute", + "kMessageAttribute", + "kPlugin", + "kData", + "kComponentListData", + "kDoubleArrayData", + "kIntArrayData", + "kUintArrayData", + "kLatticeData", + "kMatrixData", + "kMeshData", + "kNurbsSurfaceData", + "kNurbsCurveData", + "kNumericData", + "kData2Double", + "kData2Float", + "kData2Int", + "kData2Short", + "kData3Double", + "kData3Float", + "kData3Int", + "kData3Short", + "kPluginData", + "kPointArrayData", + "kMatrixArrayData", + "kSphereData", + "kStringData", + "kStringArrayData", + "kVectorArrayData", + "kSelectionList", + "kTransformGeometry", + "kCommEdgePtManip", + "kCommEdgeOperManip", + "kCommEdgeSegmentManip", + "kCommCornerManip", + "kCommCornerOperManip", + "kPluginDeformerNode", + "kTorus", + "kPolyBoolOp", + "kSingleShadingSwitch", + "kDoubleShadingSwitch", + "kTripleShadingSwitch", + "kNurbsSquare", + "kAnisotropy", + "kNonLinear", + "kDeformFunc", + "kDeformBend", + "kDeformTwist", + "kDeformSquash", + "kDeformFlare", + "kDeformSine", + "kDeformWave", + "kDeformBendManip", + "kDeformTwistManip", + "kDeformSquashManip", + "kDeformFlareManip", + "kDeformSineManip", + "kDeformWaveManip", + "kSoftModManip", + "kDistanceManip", + "kScript", + "kCurveFromMeshEdge", + "kCurveCurveIntersect", + "kNurbsCircular3PtArc", + "kNurbsCircular2PtArc", + "kOffsetSurface", + "kRoundConstantRadius", + "kRoundRadiusManip", + "kRoundRadiusCrvManip", + "kRoundConstantRadiusManip", + "kThreePointArcManip", + "kTwoPointArcManip", + "kTextButtonManip", + "kOffsetSurfaceManip", + "kImageData", + "kImageLoad", + "kImageSave", + "kImageNetSrc", + "kImageNetDest", + "kImageRender", + "kImageAdd", + "kImageDiff", + "kImageMultiply", + "kImageOver", + "kImageUnder", + "kImageColorCorrect", + "kImageBlur", + "kImageFilter", + "kImageDepth", + "kImageDisplay", + "kImageView", + "kImageMotionBlur", + "kViewColorManager", + "kMatrixFloatData", + "kSkinShader", + "kComponentManip", + "kSelectionListData", + "kObjectFilter", + "kObjectMultiFilter", + "kObjectNameFilter", + "kObjectTypeFilter", + "kObjectAttrFilter", + "kObjectRenderFilter", + "kObjectScriptFilter", + "kSelectionListOperator", + "kSubdiv", + "kPolyToSubdiv", + "kSkinClusterFilter", + "kKeyingGroup", + "kCharacter", + "kCharacterOffset", + "kDagPose", + "kStitchAsNurbsShell", + "kExplodeNurbsShell", + "kNurbsBoolean", + "kStitchSrfManip", + "kForceUpdateManip", + "kPluginManipContainer", + "kPolySewEdge", + "kPolyMergeVert", + "kPolySmoothFacet", + "kSmoothCurve", + "kGlobalStitch", + "kSubdivCVComponent", + "kSubdivEdgeComponent", + "kSubdivFaceComponent", + "kUVManip2D", + "kTranslateUVManip2D", + "kRotateUVManip2D", + "kScaleUVManip2D", + "kPolyTweakUV", + "kMoveUVShellManip2D", + "kPluginShape", + "kGeometryData", + "kSingleIndexedComponent", + "kDoubleIndexedComponent", + "kTripleIndexedComponent", + "kExtendSurfaceDistanceManip", + "kSquareSrf", + "kSquareSrfManip", + "kSubdivToPoly", + "kDynBase", + "kDynEmitterManip", + "kDynFieldsManip", + "kDynBaseFieldManip", + "kDynAirManip", + "kDynNewtonManip", + "kDynTurbulenceManip", + "kDynSpreadManip", + "kDynAttenuationManip", + "kDynArrayAttrsData", + "kPluginFieldNode", + "kPluginEmitterNode", + "kPluginSpringNode", + "kDisplayLayer", + "kDisplayLayerManager", + "kPolyColorPerVertex", + "kCreateColorSet", + "kDeleteColorSet", + "kCopyColorSet", + "kBlendColorSet", + "kPolyColorMod", + "kPolyColorDel", + "kCharacterMappingData", + "kDynSweptGeometryData", + "kWrapFilter", + "kMeshVtxFaceComponent", + "kBinaryData", + "kAttribute2Double", + "kAttribute2Float", + "kAttribute2Short", + "kAttribute2Int", + "kAttribute3Double", + "kAttribute3Float", + "kAttribute3Short", + "kAttribute3Int", + "kReference", + "kBlindData", + "kBlindDataTemplate", + "kPolyBlindData", + "kPolyNormalPerVertex", + "kNurbsToSubdiv", + "kPluginIkSolver", + "kInstancer", + "kMoveVertexManip", + "kStroke", + "kBrush", + "kStrokeGlobals", + "kPluginGeometryData", + "kLightLink", + "kDynGlobals", + "kPolyReduce", + "kLodThresholds", + "kChooser", + "kLodGroup", + "kMultDoubleLinear", + "kFourByFourMatrix", + "kTowPointOnSurfaceManip", + "kSurfaceEdManip", + "kSurfaceFaceComponent", + "kClipScheduler", + "kClipLibrary", + "kSubSurface", + "kSmoothTangentSrf", + "kRenderPass", + "kRenderPassSet", + "kRenderLayer", + "kRenderLayerManager", + "kPassContributionMap", + "kPrecompExport", + "kRenderTarget", + "kRenderedImageSource", + "kImageSource", + "kPolyFlipEdge", + "kPolyExtrudeEdge", + "kAnimBlend", + "kAnimBlendInOut", + "kPolyAppendVertex", + "kUvChooser", + "kSubdivCompId", + "kVolumeAxis", + "kDeleteUVSet", + "kSubdHierBlind", + "kSubdBlindData", + "kCharacterMap", + "kLayeredTexture", + "kSubdivCollapse", + "kParticleSamplerInfo", + "kCopyUVSet", + "kCreateUVSet", + "kClip", + "kPolySplitVert", + "kSubdivData", + "kSubdivGeom", + "kUInt64ArrayData", + "kInt64ArrayData", + "kPolySplitEdge", + "kSubdivReverseFaces", + "kMeshMapComponent", + "kSectionManip", + "kXsectionSubdivEdit", + "kSubdivToNurbs", + "kEditCurve", + "kEditCurveManip", + "kCrossSectionManager", + "kCreateSectionManip", + "kCrossSectionEditManip", + "kDropOffFunction", + "kSubdBoolean", + "kSubdModifyEdge", + "kModifyEdgeCrvManip", + "kModifyEdgeManip", + "kScalePointManip", + "kTransformBoxManip", + "kSymmetryLocator", + "kSymmetryMapVector", + "kSymmetryMapCurve", + "kCurveFromSubdivEdge", + "kCreateBPManip", + "kModifyEdgeBaseManip", + "kSubdExtrudeFace", + "kSubdivSurfaceVarGroup", + "kSfRevolveManip", + "kCurveFromSubdivFace", + "kUnused1", + "kUnused2", + "kUnused3", + "kUnused4", + "kUnused5", + "kUnused6", + "kPolyTransfer", + "kPolyAverageVertex", + "kPolyAutoProj", + "kPolyLayoutUV", + "kPolyMapSewMove", + "kSubdModifier", + "kSubdMoveVertex", + "kSubdMoveEdge", + "kSubdMoveFace", + "kSubdDelFace", + "kSnapshotShape", + "kSubdivMapComponent", + "kJiggleDeformer", + "kGlobalCacheControls", + "kDiskCache", + "kSubdCloseBorder", + "kSubdMergeVert", + "kBoxData", + "kBox", + "kRenderBox", + "kSubdSplitFace", + "kVolumeFog", + "kSubdTweakUV", + "kSubdMapCut", + "kSubdLayoutUV", + "kSubdMapSewMove", + "kOcean", + "kVolumeNoise", + "kSubdAutoProj", + "kSubdSubdivideFace", + "kNoise", + "kAttribute4Double", + "kData4Double", + "kSubdPlanProj", + "kSubdTweak", + "kSubdProjectionManip", + "kSubdMappingManip", + "kHardwareReflectionMap", + "kPolyNormalizeUV", + "kPolyFlipUV", + "kHwShaderNode", + "kPluginHardwareShader", + "kPluginHwShaderNode", + "kSubdAddTopology", + "kSubdCleanTopology", + "kImplicitCone", + "kImplicitSphere", + "kRampShader", + "kVolumeLight", + "kOceanShader", + "kBevelPlus", + "kStyleCurve", + "kPolyCut", + "kPolyPoke", + "kPolyWedgeFace", + "kPolyCutManipContainer", + "kPolyCutManip", + "kPolyMirrorManipContainer", + "kPolyPokeManip", + "kFluidTexture3D", + "kFluidTexture2D", + "kPolyMergeUV", + "kPolyStraightenUVBorder", + "kAlignManip", + "kPluginTransformNode", + "kFluid", + "kFluidGeom", + "kFluidData", + "kSmear", + "kStringShadingSwitch", + "kStudioClearCoat", + "kFluidEmitter", + "kHeightField", + "kGeoConnector", + "kSnapshotPath", + "kPluginObjectSet", + "kQuadShadingSwitch", + "kPolyExtrudeVertex", + "kPairBlend", + "kTextManip", + "kViewManip", + "kXformManip", + "kMute", + "kConstraint", + "kTrimWithBoundaries", + "kCurveFromMeshCoM", + "kFollicle", + "kHairSystem", + "kRemapValue", + "kRemapColor", + "kRemapHsv", + "kHairConstraint", + "kTimeFunction", + "kMentalRayTexture", + "kObjectBinFilter", + "kPolySmoothProxy", + "kPfxGeometry", + "kPfxHair", + "kHairTubeShader", + "kPsdFileTexture", + "kKeyframeDelta", + "kKeyframeDeltaMove", + "kKeyframeDeltaScale", + "kKeyframeDeltaAddRemove", + "kKeyframeDeltaBlockAddRemove", + "kKeyframeDeltaInfType", + "kKeyframeDeltaTangent", + "kKeyframeDeltaWeighted", + "kKeyframeDeltaBreakdown", + "kPolyMirror", + "kPolyCreaseEdge", + "kPolyPinUV", + "kHikEffector", + "kHikIKEffector", + "kHikFKJoint", + "kHikSolver", + "kHikHandle", + "kProxyManager", + "kPolyAutoProjManip", + "kPolyPrism", + "kPolyPyramid", + "kPolySplitRing", + "kPfxToon", + "kToonLineAttributes", + "kPolyDuplicateEdge", + "kFacade", + "kMaterialFacade", + "kEnvFacade", + "kAISEnvFacade", + "kLineModifier", + "kPolyArrow", + "kPolyPrimitiveMisc", + "kPolyPlatonicSolid", + "kPolyPipe", + "kHikFloorContactMarker", + "kHikGroundPlane", + "kPolyComponentData", + "kPolyHelix", + "kCacheFile", + "kHistorySwitch", + "kClosestPointOnMesh", + "kUVPin", + "kProximityPin", + "kTransferAttributes", + "kDynamicConstraint", + "kNComponent", + "kPolyBridgeEdge", + "kCacheableNode", + "kNucleus", + "kNBase", + "kCacheBase", + "kCacheBlend", + "kCacheTrack", + "kKeyframeRegionManip", + "kCurveNormalizerAngle", + "kCurveNormalizerLinear", + "kHyperLayoutDG", + "kPluginImagePlaneNode", + "kNCloth", + "kNParticle", + "kNRigid", + "kPluginParticleAttributeMapperNode", + "kCameraSet", + "kPluginCameraSet", + "kContainer", + "kFloatVectorArrayData", + "kNObjectData", + "kNObject", + "kPluginConstraintNode", + "kAsset", + "kPolyEdgeToCurve", + "kAnimLayer", + "kBlendNodeBase", + "kBlendNodeBoolean", + "kBlendNodeDouble", + "kBlendNodeDoubleAngle", + "kBlendNodeDoubleLinear", + "kBlendNodeEnum", + "kBlendNodeFloat", + "kBlendNodeFloatAngle", + "kBlendNodeFloatLinear", + "kBlendNodeInt16", + "kBlendNodeInt32", + "kBlendNodeAdditiveScale", + "kBlendNodeAdditiveRotation", + "kPluginManipulatorNode", + "kNIdData", + "kNId", + "kFloatArrayData", + "kMembrane", + "kMergeVertsToolManip", + "kUint64SingleIndexedComponent", + "kPolyToolFeedbackManip", + "kPolySelectEditFeedbackManip", + "kWriteToFrameBuffer", + "kWriteToColorBuffer", + "kWriteToVectorBuffer", + "kWriteToDepthBuffer", + "kWriteToLabelBuffer", + "kStereoCameraMaster", + "kSequenceManager", + "kSequencer", + "kShot", + "kBlendNodeTime", + "kCreateBezierManip", + "kBezierCurve", + "kBezierCurveData", + "kNurbsCurveToBezier", + "kBezierCurveToNurbs", + "kPolySpinEdge", + "kPolyHoleFace", + "kPointOnPolyConstraint", + "kPolyConnectComponents", + "kSkinBinding", + "kVolumeBindManip", + "kVertexWeightSet", + "kNearestPointOnCurve", + "kColorProfile", + "kAdskMaterial", + "kContainerBase", + "kDagContainer", + "kPolyUVRectangle", + "kHardwareRenderingGlobals", + "kPolyProjectCurve", + "kRenderingList", + "kPolyExtrudeManip", + "kPolyExtrudeManipContainer", + "kThreadedDevice", + "kClientDevice", + "kPluginClientDevice", + "kPluginThreadedDevice", + "kTimeWarp", + "kAssembly", + "kClipGhostShape", + "kClipToGhostData", + "kMandelbrot", + "kMandelbrot3D", + "kGreasePlane", + "kGreasePlaneRenderShape", + "kGreasePencilSequence", + "kEditMetadata", + "kCreaseSet", + "kPolyEditEdgeFlow", + "kFosterParent", + "kSnapUVManip2D", + "kToolContext", + "kNLE", + "kShrinkWrapFilter", + "kEditsManager", + "kPolyBevel2", + "kPolyCBoolOp", + "kGeomBind", + "kColorMgtGlobals", + "kPolyBevel3", + "kTimeEditorClipBase", + "kTimeEditorClipEvaluator", + "kTimeEditorClip", + "kTimeEditor", + "kTimeEditorTracks", + "kTimeEditorInterpolator", + "kTimeEditorAnimSource", + "kCaddyManipBase", + "kPolyCaddyManip", + "kPolyModifierManipContainer", + "kPolyRemesh", + "kPolyContourProj", + "kContourProjectionManip", + "kNodeGraphEditorInfo", + "kNodeGraphEditorBookmarks", + "kNodeGraphEditorBookmarkInfo", + "kPluginSkinCluster", + "kPluginGeometryFilter", + "kPluginBlendShape", + "kPolyPassThru", + "kTrackInfoManager", + "kPolyClean", + "kShapeEditorManager", + "kOceanDeformer", + "kPoseInterpolatorManager", + "kControllerTag", + "kReForm", + "kCustomEvaluatorClusterNode", + "kPolyCircularize", + "kArubaTesselate", + "kReorderUVSet", + "kUfeProxyTransform", + "kDecomposeMatrix", + "kComposeMatrix", + "kBlendMatrix", + "kPickMatrix", + "kAimMatrix", + "kPrimitiveFalloff", + "kBlendFalloff", + "kUniformFalloff", + "kTransferFalloff", + "kComponentFalloff", + "kWeightFunctionData", + "kFalloffEval", + "kComponentMatch", + "kLast" +}; diff --git a/src/MFn.inl b/src/MFn.inl index ae9333a..b8c4d06 100644 --- a/src/MFn.inl +++ b/src/MFn.inl @@ -1,8 +1,5 @@ #include "MFn.Types.inl" -py::class_ fn(m, "Fn"); -py::enum_ fn_type(fn, "Type"); - for (int x = MFn::Type::kInvalid; x <= MFn::Type::kLast; x++) { MFn::Type type = static_cast(x); fn_type.value(type_names[x].c_str(), type); diff --git a/src/MFnDependencyNode.inl b/src/MFnDependencyNode.inl index 0b2b974..30d7a0b 100644 --- a/src/MFnDependencyNode.inl +++ b/src/MFnDependencyNode.inl @@ -1,5 +1,5 @@ -py::class_(m, "FnDependencyNode") +FnDependencyNode .def(py::init<>()) .def(py::init()) diff --git a/src/MObject.inl b/src/MObject.inl index 038b874..316a21f 100644 --- a/src/MObject.inl +++ b/src/MObject.inl @@ -1,4 +1,4 @@ -py::class_(m, "Object") +Object .def(py::init<>()) .def(py::init()) diff --git a/src/MPlug.inl b/src/MPlug.inl index 7474a8f..86776c9 100644 --- a/src/MPlug.inl +++ b/src/MPlug.inl @@ -1,4 +1,3 @@ -py::class_ plug(m, "Plug"); py::enum_(plug, "ValueSelector") .value("kAll", MPlug::MValueSelector::kAll) .value("kNonDefault", MPlug::MValueSelector::kNonDefault) @@ -6,6 +5,12 @@ py::enum_(plug, "ValueSelector") .value("kLastAttrSelector", MPlug::MValueSelector::kLastAttrSelector) .export_values(); +py::enum_(plug, "FreeToChangeState") + .value("kFreeToChange ", MPlug::FreeToChangeState::kFreeToChange) + .value("kNotFreeToChange ", MPlug::FreeToChangeState::kNotFreeToChange) + .value("kChildrenNotFreeToChange ", MPlug::FreeToChangeState::kChildrenNotFreeToChange) + .export_values(); + plug.def(py::init<>()) .def(py::self == MPlug()) diff --git a/src/MSelectionList.inl b/src/MSelectionList.inl index ed406c7..94dfce6 100644 --- a/src/MSelectionList.inl +++ b/src/MSelectionList.inl @@ -1,11 +1,11 @@ -py::class_ sel(m, "SelectionList"); -py::enum_(sel, "MergeStrategy") +py::enum_(SelectionList, "MergeStrategy") .value("kMergeNormal", MSelectionList::MergeStrategy::kMergeNormal) .value("kXORWithList", MSelectionList::MergeStrategy::kXORWithList) .value("kRemoveFromList", MSelectionList::MergeStrategy::kRemoveFromList) .export_values(); - sel.def(py::init<>()) +SelectionList + .def(py::init<>()) .def("__len__", [](MSelectionList & self) -> int { return self.length(); @@ -65,7 +65,9 @@ or a component (tuple of (MDagPath, MObject) ).)pbdoc") } return self; - }, R"pbdoc(add(Add the specified object(s) to the selection list.)pbdoc") + }, R"pbdoc(add(pattern) -> self + +Add the specified object(s) to the selection list.)pbdoc") .def("add", [](MSelectionList & self, std::string matchString, bool searchChildNamespacesToo = false) -> MSelectionList { throw std::logic_error{"Function not yet implemented."}; @@ -176,7 +178,7 @@ Raises IndexError if index is out of range.)pbdoc") } return atov::convert(strings); - }, R"pbdoc(getSelectionStrings(index=None) -> (string, string, ...) + }, R"pbdoc(getSelectionStrings(index=None) -> List[string] Returns a tuple containing the string representation of the specified item. For nodes, DAG paths, plugs and contiguous @@ -201,7 +203,7 @@ list are returned. Raises IndexError if index is out of bounds.)pbdoc") } return atov::convert(strings); - }, R"pbdoc(getSelectionStrings(index=None) -> (string, string, ...) + }, R"pbdoc(getSelectionStrings(index=None) -> List[str] Returns a tuple containing the string representation of the specified item. For nodes, DAG paths, plugs and contiguous diff --git a/src/Math.inl b/src/Math.inl index 861c2e6..311d5ab 100644 --- a/src/Math.inl +++ b/src/Math.inl @@ -1,5 +1,5 @@ -py::class_(m, "String") +String .def(py::init<>()) .def(py::init()) .def(py::init()) @@ -16,7 +16,7 @@ py::class_(m, "String") } ); -py::class_(m, "Vector") +Vector .def(py::init<>()) .def(py::init(m, "Vector") } ); -py::class_(m, "Point") +Point .def(py::init<>()) .def(py::init(m, "Point") } ); -py::class_(m, "Matrix") +Matrix .def(py::init<>()) .def(py::init()) @@ -109,7 +109,7 @@ py::class_(m, "Matrix") } ); -py::class_(m, "Quaternion") +Quaternion .def(py::init(m, "Status") +Status .def(py::init<>()) .def(py::init()) @@ -8,7 +7,7 @@ py::class_(m, "Status") } ); -py::class_(m, "TypeId") +TypeId .def(py::init<>()) .def(py::init()) .def(py::init(), @@ -31,8 +30,7 @@ py::class_(m, "TypeId") ); - -py::class_(m, "ObjectHandle") +ObjectHandle .def(py::init<>()) .def(py::init()) diff --git a/src/main.cpp b/src/main.cpp index d4f27fe..107eff1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,6 +58,8 @@ PYBIND11_MODULE(cmdc, m) { )pbdoc"; + #include "ForwardDeclarations.inl" + #include "Math.inl" #include "MDagPath.inl" #include "MFn.inl"