From 481398323027aac38a4233716cebb26e5494b6bd Mon Sep 17 00:00:00 2001 From: Shea Richardson <7100563+munkybutt@users.noreply.github.com> Date: Sat, 30 Mar 2024 08:39:23 +0000 Subject: [PATCH] Delete SDKProjects directory from main --- SDKProjects/3DsMax/3dsmaxsdk_preinclude.h | 21 - SDKProjects/3DsMax/DllEntry.cpp | 99 --- SDKProjects/3DsMax/LICENSE | 21 - SDKProjects/3DsMax/README.md | 111 --- SDKProjects/3DsMax/SkinPlusPlus.cpp | 651 ------------------ SDKProjects/3DsMax/SkinPlusPlus.def | 10 - SDKProjects/3DsMax/SkinPlusPlus.h | 107 --- SDKProjects/3DsMax/SkinPlusPlus.rc | 95 --- SDKProjects/3DsMax/SkinPlusPlus.sln | 37 - SDKProjects/3DsMax/SkinPlusPlus.vcxproj | 109 --- .../3DsMax/SkinPlusPlus.vcxproj.filters | 49 -- SDKProjects/3DsMax/SkinPlusPlusPy.cpp | 61 -- SDKProjects/3DsMax/SkinPlusPlusPy.h | 20 - SDKProjects/3DsMax/pyproject.toml | 3 - SDKProjects/3DsMax/resource.h | 23 - SDKProjects/3DsMax/setup.py | 19 - 16 files changed, 1436 deletions(-) delete mode 100644 SDKProjects/3DsMax/3dsmaxsdk_preinclude.h delete mode 100644 SDKProjects/3DsMax/DllEntry.cpp delete mode 100644 SDKProjects/3DsMax/LICENSE delete mode 100644 SDKProjects/3DsMax/README.md delete mode 100644 SDKProjects/3DsMax/SkinPlusPlus.cpp delete mode 100644 SDKProjects/3DsMax/SkinPlusPlus.def delete mode 100644 SDKProjects/3DsMax/SkinPlusPlus.h delete mode 100644 SDKProjects/3DsMax/SkinPlusPlus.rc delete mode 100644 SDKProjects/3DsMax/SkinPlusPlus.sln delete mode 100644 SDKProjects/3DsMax/SkinPlusPlus.vcxproj delete mode 100644 SDKProjects/3DsMax/SkinPlusPlus.vcxproj.filters delete mode 100644 SDKProjects/3DsMax/SkinPlusPlusPy.cpp delete mode 100644 SDKProjects/3DsMax/SkinPlusPlusPy.h delete mode 100644 SDKProjects/3DsMax/pyproject.toml delete mode 100644 SDKProjects/3DsMax/resource.h delete mode 100644 SDKProjects/3DsMax/setup.py diff --git a/SDKProjects/3DsMax/3dsmaxsdk_preinclude.h b/SDKProjects/3DsMax/3dsmaxsdk_preinclude.h deleted file mode 100644 index 65b9248..0000000 --- a/SDKProjects/3DsMax/3dsmaxsdk_preinclude.h +++ /dev/null @@ -1,21 +0,0 @@ -//**************************************************************************/ -// Copyright (c) 1998-2018 Autodesk, Inc. -// All rights reserved. -// -// Use of this software is subject to the terms of the Autodesk license -// agreement provided at the time of installation or download, or which -// otherwise accompanies this software in either electronic or hard copy form. -//**************************************************************************/ -// DESCRIPTION: Include this file before including any 3ds Max SDK files. It -// define the macros required to add linkable todo compile-time -// messages. Therefore if you use this TODO macro, it will emit -// a message that you can click on, and visual studio will open -// the file and line where the message is. -// AUTHOR: Jean-Francois Yelle - created Mar.20.2007 -//***************************************************************************/ - -// useful for #pragma message -#define STRING2(x) #x -#define STRING(x) STRING2(x) -#define TODO(x) __FILE__ "(" STRING(__LINE__) "): TODO: "x - diff --git a/SDKProjects/3DsMax/DllEntry.cpp b/SDKProjects/3DsMax/DllEntry.cpp deleted file mode 100644 index eac783e..0000000 --- a/SDKProjects/3DsMax/DllEntry.cpp +++ /dev/null @@ -1,99 +0,0 @@ -//**************************************************************************/ -// Copyright (c) 1998-2018 Autodesk, Inc. -// All rights reserved. -// -// Use of this software is subject to the terms of the Autodesk license -// agreement provided at the time of installation or download, or which -// otherwise accompanies this software in either electronic or hard copy form. -//**************************************************************************/ -// DESCRIPTION: Appwizard generated plugin -// AUTHOR: -//***************************************************************************/ - -#include "SkinPlusPlus.h" - -extern ClassDesc2* GetSkinPlusPlusDesc(); - -HINSTANCE hInstance; -int controlsInit = FALSE; - -// This function is called by Windows when the DLL is loaded. This -// function may also be called many times during time critical operations -// like rendering. Therefore developers need to be careful what they -// do inside this function. In the code below, note how after the DLL is -// loaded the first time only a few statements are executed. - -BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID /*lpvReserved*/) -{ - if (fdwReason == DLL_PROCESS_ATTACH) - { - // Hang on to this DLL's instance handle. - hInstance = hinstDLL; - DisableThreadLibraryCalls(hInstance); - // DO NOT do any initialization here. Use LibInitialize() instead. - } - return(TRUE); -} - -// This function returns a string that describes the DLL and where the user -// could purchase the DLL if they don't have it. -__declspec( dllexport ) const TCHAR* LibDescription() -{ - return GetString(IDS_LIBDESCRIPTION); -} - -// This function returns the number of plug-in classes this DLL -//TODO: Must change this number when adding a new class -__declspec( dllexport ) int LibNumberClasses() -{ - return 1; -} - -// This function returns the number of plug-in classes this DLL -__declspec( dllexport ) ClassDesc* LibClassDesc(int i) -{ - switch(i) - { - case 0: return GetSkinPlusPlusDesc(); - default: return 0; - } -} - -// This function returns a pre-defined constant indicating the version of -// the system under which it was compiled. It is used to allow the system -// to catch obsolete DLLs. -__declspec( dllexport ) ULONG LibVersion() -{ - return VERSION_3DSMAX; -} - -// This function is called once, right after your plugin has been loaded by 3ds Max. -// Perform one-time plugin initialization in this method. -// Return TRUE if you deem your plugin successfully loaded, or FALSE otherwise. If -// the function returns FALSE, the system will NOT load the plugin, it will then call FreeLibrary -// on your DLL, and send you a message. -__declspec( dllexport ) int LibInitialize(void) -{ - return TRUE; -} - -// This function is called once, just before the plugin is unloaded. -// Perform one-time plugin un-initialization in this method." -// The system doesn't pay attention to a return value. -__declspec( dllexport ) int LibShutdown(void) -{ - return TRUE; -} - -TCHAR *GetString(int id) -{ - static TCHAR buf[256]; - - if (hInstance) - { - return LoadString(hInstance, id, buf, _countof(buf)) ? buf : NULL; - } - - return NULL; -} - diff --git a/SDKProjects/3DsMax/LICENSE b/SDKProjects/3DsMax/LICENSE deleted file mode 100644 index 32c9381..0000000 --- a/SDKProjects/3DsMax/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 munkybutt - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/SDKProjects/3DsMax/README.md b/SDKProjects/3DsMax/README.md deleted file mode 100644 index 7515ebd..0000000 --- a/SDKProjects/3DsMax/README.md +++ /dev/null @@ -1,111 +0,0 @@ -

- - SkinPlusPlus -
-

- -

Python bindings written in c++, for working with skin data in DCC's.

- -

- - - - - - - - - - - - -

- -

- Key Features • - Performance • - Roadmap -

- - -## Key Features -* Save and load skin data with speed - - Logic is written in c++ but exposed with python bindings - -* Work directly with numpy ndarrays - - Pybind11 is used to generate the python bindings, so the API uses numpy ndarrays for optimal performance - -* Currently supported DCCs: - - 3DsMax: - - Provided bindings are for 2022, but the backend should be compatible with any version of 3DsMax that has python - -## Performance -Performance tests are done on a mesh with 507,906 vertices, each with 6 influences. - -### 3DsMax 2022 -#### Get Skin Data - -| Method | Time-secs | x Faster | % Faster | -|:--------------------------------------------|-----------|----------|----------| -| pymxs -> list | 20.347 | base | base | -| maxscript -> numpy array | 15.518 | 01.311x | 0131.12% | -| maxscript -> list | 14.423 | 01.410x | 0141.07% | -| SDK primative -> list | 07.435 | 02.736x | 0273.65% | -| SDK function publish -> list | 06.338 | 03.209x | 0320.99% | -| SDK struct primative -> list | 05.982 | 03.401x | 0340.11% | -| pybind11 automatic -> numpy array | 01.268 | 16.045x | 1604.54% | -| pybind11 move -> numpy array | 01.097 | 18.533x | 1853.30% | -| pybind11 copy -> numpy array | 00.986 | 20.627x | 2062.70% | -| pybind11 -> list | 00.902 | 22.537x | 2253.74% | -| pybind11 reference_internal -> numpy array | 00.424 | 47.954x | 4795.46% | -| pybind11 automatic_reference -> numpy array | 00.423 | 48.033x | 4803.31% | -| pybind11 take_ownership -> numpy array | 00.417 | 48.732x | 4873.29% | -| pybind11 reference -> numpy array | 00.417 | 48.747x | 4874.78% | - -#### Set Skin Data - -| Function | Time-secs | x Faster | % Faster | -|:----------------------------------|-----------|----------|----------| -| pymxs <- mxs.Array | 10.008 | base | base | -| maxscript <- mxs.Array | 08.258 | 01.211x | 0121.18% | -| SDK function publish <- mxs.Array | 07.368 | 01.358x | 0135.82% | -| SDK struct primative <- mxs.Array | 05.838 | 01.714x | 0171.43% | -| SDK primative <- mxs.Array | 05.694 | 01.757x | 0175.76% | -| pybind11 <- np.ndarray | 00.184 | 54.345x | 5434.57% | - -## Roadmap -* Include Vertex Positions - - This will enable features for applying skin data to different topologies - -* Support multiple DCCs - - Maya - - Blender - - MotionBuilder - - Houdini - -* Send data between DCCs - - Serialise skin data and pass between DCC using local servers - - This will provide a foundation for a DCC agnostic skinning pipeline - -* Expand toolkit to include functions other than get and set. - - - -## Personal Info -> Webbie [techanimdad.com](https://techanimdad.com)  ·  -> GitHub [@munkybutt](https://github.com/munkybutt) diff --git a/SDKProjects/3DsMax/SkinPlusPlus.cpp b/SDKProjects/3DsMax/SkinPlusPlus.cpp deleted file mode 100644 index 5396faf..0000000 --- a/SDKProjects/3DsMax/SkinPlusPlus.cpp +++ /dev/null @@ -1,651 +0,0 @@ -//**************************************************************************/ -// Copyright (c) 1998-2021 Autodesk, Inc. -// All rights reserved. -// -// Use of this software is subject to the terms of the Autodesk license -// agreement provided at the time of installation or download, or which -// otherwise accompanies this software in either electronic or hard copy form. -//**************************************************************************/ -// DESCRIPTION: Appwizard generated plugin -// AUTHOR: -//***************************************************************************/ - -#include "SkinPlusPlus.h" - -#define SkinPlusPlus_CLASS_ID Class_ID(0x5b374d7b, 0x68620ce) - - -class SkinPlusPlus : public GUP -{ -public: - //Constructor/Destructor - SkinPlusPlus(); - virtual ~SkinPlusPlus(); - - // GUP Methods - virtual DWORD Start(); - virtual void Stop(); - virtual DWORD_PTR Control(DWORD parameter); - virtual void DeleteThis(); - - // Loading/Saving - virtual IOResult Save(ISave* isave); - virtual IOResult Load(ILoad* iload); -}; - -class SkinPlusPlusClassDesc : public ClassDesc2 -{ -public: - virtual int IsPublic() override { return TRUE; } - virtual void* Create(BOOL /*loading = FALSE*/) override { return new SkinPlusPlus(); } - virtual const TCHAR * ClassName() override { return GetString(IDS_CLASS_NAME); } - virtual const MCHAR* NonLocalizedClassName() override { return GetString(IDS_CLASS_NAME); } - - virtual SClass_ID SuperClassID() override { return GUP_CLASS_ID; } - virtual Class_ID ClassID() override { return SkinPlusPlus_CLASS_ID; } - virtual const TCHAR* Category() override { return GetString(IDS_CATEGORY); } - - virtual const TCHAR* InternalName() override { return _T("SkinPlusPlus"); } // Returns fixed parsable name (scripter-visible name) - virtual HINSTANCE HInstance() override { return hInstance; } // Returns owning module handle - - -}; - -ClassDesc2* GetSkinPlusPlusDesc() -{ - static SkinPlusPlusClassDesc SkinPlusPlusDesc; - return &SkinPlusPlusDesc; -} - -SkinPlusPlus::SkinPlusPlus() -{ - -} - -SkinPlusPlus::~SkinPlusPlus() -{ - -} - -void SkinPlusPlus::DeleteThis() -{ - delete this; -} - -// Activate and Stay Resident -DWORD SkinPlusPlus::Start() -{ - return GUPRESULT_KEEP; -} - -void SkinPlusPlus::Stop() -{ -} - -DWORD_PTR SkinPlusPlus::Control( DWORD /*parameter*/ ) -{ - return 0; -} - -IOResult SkinPlusPlus::Save(ISave* /*isave*/) -{ - return IO_OK; -} - -IOResult SkinPlusPlus::Load(ILoad* /*iload*/) -{ - return IO_OK; -} - - -// VertexData Methods: - -VertexData::VertexData(int vertexID, Array* boneIDs, Array* weights, Tab skinBones) -{ - if (!(boneIDs->size == weights->size)) - throw RuntimeError(_T("ids count does not match weights count"), Integer::intern(vertexID)); - - this->initialiseVariables(boneIDs->size); - float weightCap = 1.0f; - for (int vertexBoneIndex = 0; vertexBoneIndex < boneIDs->size; vertexBoneIndex++) - { - float weight = weights->data[vertexBoneIndex]->to_float(); - const int vertexBoneID = boneIDs->data[vertexBoneIndex]->to_int(); - INode* vertexBoneIDNode = skinBones[vertexBoneID - 1]; - if (weight < 0.0f) continue; - this->bones.Append(1, &vertexBoneIDNode); - if (weight > 1.0f) this->weights.Append(1, &weightCap); else this->weights.Append(1, &weight); - } -}; - -void VertexData::initialiseVariables(int size) -{ - this->bones = Tab(); - this->weights = Tab(); - this->bones.Resize(size); - this->weights.Resize(size); - -} - -void VertexData::appendVariables(INode* bone, float weight) -{ - this->bones.Append(1, &bone); - this->weights.Append(1, &weight); -} - - -PolyObject* getPolyObjectFromNode(INode* inNode, TimeValue inTime, bool& deleteIt) -{ - Object* object = inNode->GetObjectRef(); - Object* nodeObjectBase = object->FindBaseObject(); - auto classID = Class_ID(POLYOBJ_CLASS_ID, 0); - if (nodeObjectBase->CanConvertToType(classID)) - { - PolyObject* polyObject = (PolyObject*)object->ConvertToType(inTime, classID); - // Note that the polyObject should only be deleted - // if the pointer to it is not equal to the object - - // pointer that called ConvertToType() - if (object != polyObject) deleteIt = true; - return polyObject; - } - else - { - return NULL; - } -} - - - //SkinData Methods: -bool SkinData::initialise(INode* skinnedNode) -{ - this->allVertexData = Tab(); - this->node = skinnedNode; - Object* object = this->node->GetObjectRef(); - if (!object || (object->SuperClassID() != GEN_DERIVOB_CLASS_ID)) - { - return false; - } - this->iDerivedObject = (IDerivedObject*)(object); - if (!this->iDerivedObject) return false; - - for (int modifierIndex = 0; modifierIndex < this->iDerivedObject->NumModifiers(); modifierIndex++) - { - this->skinModifier = this->iDerivedObject->GetModifier(modifierIndex); - if (this->skinModifier->ClassID() != SKIN_CLASSID) continue; - - this->iSkin = (ISkin*)this->skinModifier->GetInterface(I_SKIN); - if (!this->iSkin) continue; - - this->iSkinContextData = this->iSkin->GetContextInterface(skinnedNode); - if (!this->iSkinContextData) continue; - - this->iSkinImportData = (ISkinImportData*)this->skinModifier->GetInterface(I_SKINIMPORTDATA); - if (!this->iSkinImportData) continue; - - return true; - } - return false; -} - - -void SkinData::getSkinWeights(Array& ioSkinData) -{ - int vertexCount = this->iSkinContextData->GetNumPoints(); - ScopedMaxScriptEvaluationContext scopedMaxScriptEvaluationContext; - MAXScript_TLS* _tls = scopedMaxScriptEvaluationContext.Get_TLS(); - seven_typed_value_locals_tls( - Array* skinData, - Array* weights, - Array* positions, - Array* boneIDs, - Array* influenceWeights, - Array* influenceBoneIDs, - Array* position - ); - vl.weights = new Array(vertexCount); - vl.boneIDs = new Array(vertexCount); - vl.positions = new Array(vertexCount); - vl.weights->size = vertexCount; - vl.boneIDs->size = vertexCount; - vl.positions->size = vertexCount; - Matrix3 nodeTransform = this->node->GetObjectTM(0); - Object* nodeBaseObject = this->node->GetObjectRef()->FindBaseObject(); - - //if (nodeBaseObject->CanConvertToType(Class_ID(POLYOBJ_CLASS_ID, 0))) - EPoly* ePolyInterface = (EPoly*)(nodeBaseObject->GetInterface(EPOLY_INTERFACE)); - MNMesh* mnMesh = ePolyInterface->GetMeshPtr(); - for (int vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) - { - int influenceCount = this->iSkinContextData->GetNumAssignedBones(vertexIndex); - vl.influenceWeights = new Array(influenceCount); - vl.influenceBoneIDs = new Array(influenceCount); - vl.influenceWeights->size = influenceCount; - vl.influenceBoneIDs->size = influenceCount; - for (int influenceIndex = 0; influenceIndex < influenceCount; influenceIndex++) - { - float infuenceWeight = this->iSkinContextData->GetBoneWeight(vertexIndex, influenceIndex); - int influenceBoneID = this->iSkinContextData->GetAssignedBone(vertexIndex, influenceIndex) + 1; - vl.influenceWeights->data[influenceIndex] = Float::intern(infuenceWeight); - vl.influenceBoneIDs->data[influenceIndex] = Integer::intern(influenceBoneID); - } - MNVert vertex = mnMesh->v[vertexIndex]; - Point3 vertexPosition = vertex.p; - Point3 worldPosition = nodeTransform.PointTransform(vertexPosition); - - vl.position = new Array(3); - vl.position->size = 3; - vl.position->data[0] = Float::intern(worldPosition.x); - vl.position->data[1] = Float::intern(worldPosition.y); - vl.position->data[2] = Float::intern(worldPosition.z); - - vl.weights->data[vertexIndex] = vl.influenceWeights; - vl.boneIDs->data[vertexIndex] = vl.influenceBoneIDs; - vl.positions->data[vertexIndex] = vl.position; - }; - ioSkinData.data[0] = vl.weights; - ioSkinData.data[1] = vl.boneIDs; - ioSkinData.data[2] = vl.positions; -} - - -Array* SkinData::getSkinWeights() -{ - int vertexCount = this->iSkinContextData->GetNumPoints(); - ScopedMaxScriptEvaluationContext scopedMaxScriptEvaluationContext; - MAXScript_TLS* _tls = scopedMaxScriptEvaluationContext.Get_TLS(); - seven_typed_value_locals_tls( - Array* skinData, - Array* weights, - Array* positions, - Array* boneIDs, - Array* influenceWeights, - Array* influenceBoneIDs, - Array* position - ); - vl.weights = new Array(vertexCount); - vl.boneIDs = new Array(vertexCount); - vl.positions = new Array(vertexCount); - vl.weights->size = vertexCount; - vl.boneIDs->size = vertexCount; - vl.positions->size = vertexCount; - - Matrix3 nodeTransform = this->node->GetObjectTM(0); - bool deleteIt; - PolyObject* polyObject = getPolyObjectFromNode(this->node, GetCOREInterface()->GetTime(), deleteIt); - MNMesh& mnMesh = polyObject->GetMesh(); - - for (int vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) - { - the_listener->edit_stream->printf(_T("vertexIndex: %d"), vertexIndex); - Point3 worldPosition = nodeTransform.PointTransform(mnMesh.V(vertexIndex)->p); - vl.position = new Array(3); - vl.position->size = 3; - vl.position->data[0] = Float::intern(0.0f); - vl.position->data[1] = Float::intern(0.0f); - vl.position->data[2] = Float::intern(0.0f); - int influenceCount = this->iSkinContextData->GetNumAssignedBones(vertexIndex); - vl.influenceWeights = new Array(influenceCount); - vl.influenceBoneIDs = new Array(influenceCount); - vl.influenceWeights->size = influenceCount; - vl.influenceBoneIDs->size = influenceCount; - for (int influenceIndex = 0; influenceIndex < influenceCount; influenceIndex++) - { - float infuenceWeight = this->iSkinContextData->GetBoneWeight(vertexIndex, influenceIndex); - int influenceBoneID = this->iSkinContextData->GetAssignedBone(vertexIndex, influenceIndex) + 1; - vl.influenceWeights->data[influenceIndex] = Float::intern(infuenceWeight); - vl.influenceBoneIDs->data[influenceIndex] = Integer::intern(influenceBoneID); - } - vl.weights->data[vertexIndex] = vl.influenceWeights; - vl.boneIDs->data[vertexIndex] = vl.influenceBoneIDs; - vl.positions->data[vertexIndex] = vl.position; - }; - vl.skinData = new Array(3); - vl.skinData->size = 3; - vl.skinData->data[0] = vl.weights; - vl.skinData->data[1] = vl.boneIDs; - vl.skinData->data[2] = vl.positions; - return_value_tls(vl.weights); -} - - -bool SkinData::setVertexWeights(int vertexIndex, Array* vertexBones, Array* vertexWeights) -{ - if (!(vertexWeights->size == vertexBones->size)) - throw RuntimeError(_T("ids count does not match weights count"), (Value*)this->node); - - VertexData* vertexData = new VertexData(vertexWeights->size); - for (int vertexBoneIndex = 0; vertexBoneIndex < vertexWeights->size; vertexBoneIndex++) - { - float weight = vertexWeights->data[vertexBoneIndex]->to_float(); - if (weight <= 0.0f) continue; - if (weight > 1.0f) weight = 1.0f; - MAXNode* mxsVertexBoneIDNode = (MAXNode*)vertexBones->data[vertexBoneIndex]; - vertexData->appendVariables(mxsVertexBoneIDNode->to_node(), weight); - } - bool result = this->iSkinImportData->AddWeights(this->node, vertexIndex, vertexData->getBones(), vertexData->getWeights()); - this->skinModifier->NotifyDependents(FOREVER, PART_GEOM, REFMSG_CHANGE); - GetCOREInterface()->RedrawViews(GetCOREInterface()->GetTime()); - - return result; -} - - -bool SkinData::setVertexWeights(const int vertexIndex, Array* boneIDs, Array* vertexWeights, Tab skinBones) -{ - Array* vertexBoneIDs = (Array*)boneIDs->data[vertexIndex]; - Array* vertexBoneWeights = (Array*)vertexWeights->data[vertexIndex]; - VertexData* vertexData = new VertexData(vertexIndex, vertexBoneIDs, vertexBoneWeights, skinBones); - return this->iSkinImportData->AddWeights(this->node, vertexIndex, vertexData->getBones(), vertexData->getWeights()); -} - - -bool SkinData::setSkinWeights(Array* boneIDs, Array* vertexWeights, Array* vertices) -{ - const int bonesArraySize = boneIDs->size; - const int weightsArraySize = vertexWeights->size; - if (bonesArraySize != weightsArraySize) throw RuntimeError( - _T("skin bone ids count does not match skin weights count"), (Value*)this->node - ); - Tab skinBones; - int skinBonesCount = this->iSkin->GetNumBones(); - for (int boneIndex = 0; boneIndex < skinBonesCount; boneIndex++) - { - INode* bone = this->iSkin->GetBone(boneIndex); - if (boneIndex == 0) - { - skinBones.Append(1, &bone, skinBonesCount); - continue; - } - skinBones.Append(1, &bone); - } - bool skinWeightsSet = true; - const int vertexCount = this->iSkinContextData->GetNumPoints(); - for (int vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) - { - Array* vertexBoneIDs = (Array*)boneIDs->data[vertexIndex]; - Array* vertexBoneWeights = (Array*)vertexWeights->data[vertexIndex]; - VertexData* vertexData = new VertexData(vertexIndex, vertexBoneIDs, vertexBoneWeights, skinBones); - if (!(this->iSkinImportData->AddWeights(this->node, vertexIndex, vertexData->getBones(), vertexData->getWeights()))) - skinWeightsSet = false; - } - - this->skinModifier->NotifyDependents(FOREVER, PART_GEOM, REFMSG_CHANGE); - GetCOREInterface()->RedrawViews(GetCOREInterface()->GetTime()); - return skinWeightsSet; -} - - -// SkinData Functions: -void getSkinWeightsFn(INode* node, Array& ioSkinData) -{ - SkinData* skinData = new SkinData(node); - skinData->getSkinWeights(ioSkinData); -} - - -Array* getSkinWeightsFn(INode* node) -{ - SkinData* skinData = new SkinData(node); - return skinData->getSkinWeights(); -} - - -bool setVertexWeights(INode* node, int vertexIndex, Array* weightData) -{ - SkinData* skinData = new SkinData(node); - return skinData->setVertexWeights(vertexIndex, (Array*)weightData->data[0], (Array*)weightData->data[1]); -} - - -bool setSkinWeightsFn(INode* node, Array* boneIDs, Array* vertexWeights, Array* vertices) -{ - SkinData* skinData = new SkinData(node); - return skinData->setSkinWeights(boneIDs, vertexWeights, vertices); -} - - -Value* getSkinWeightsIO(Value** args) -{ - type_check(args[0], MAXNode, _T("getSkinWeights")); - one_typed_value_local(Array* skinData); - vl.skinData = new Array(3); - vl.skinData->size = 3; - getSkinWeightsFn(((MAXNode*)args[0])->to_node(), *vl.skinData); - return_value(vl.skinData); -} - - -Value* setSkinWeightsIO(Value** args) -{ - type_check(args[0], MAXNode, _T("setSkinWeights")); - type_check(args[1], Array, _T("setSkinWeights")); - type_check(args[2], Array, _T("setSkinWeights")); - type_check(args[3], Array, _T("setSkinWeights")); - bool result = setSkinWeightsFn(((MAXNode*)args[0])->to_node(), (Array*)args[1], (Array*)args[2], (Array*)args[3]); - if (result) - { - return &true_value; - } - return &false_value; -} - - -Value* getSkinWeightsMethod_cf(Value** arg_list, int count) -{ - check_arg_count_with_keys(getSkinWeightsMethod, 1, count); - return getSkinWeightsIO(arg_list); -} - -Value* getSkinWeightsFunction_cf(Value** arg_list, int count) -{ - check_arg_count_with_keys(getSkinWeightsFunction, 1, count); - return getSkinWeightsIO(arg_list); -} - -def_struct_primitive_debug_ok(getSkinWeightsMethod, SkinPPOps, "GetSkinWeights"); - -def_visible_primitive_debug_ok(getSkinWeightsFunction, "SPPGetSkinWeights"); - - -Value* setSkinWeightsMethod_cf(Value** arg_list, int count) -{ - // INode* skinnedNode, Value* boneIDs, Value* vertexWeights, Value* vertices - check_arg_count_with_keys(setSkinWeightsMethod, 4, count); - return setSkinWeightsIO(arg_list); -} - -Value* setSkinWeightsFunction_cf(Value** arg_list, int count) -{ - // INode* skinnedNode, Value* boneIDs, Value* vertexWeights, Value* vertices - check_arg_count_with_keys(setSkinWeightsFunction, 4, count); - return setSkinWeightsIO(arg_list); -} - -def_struct_primitive(setSkinWeightsMethod, SkinPPOps, "SetSkinWeights"); - -def_visible_primitive(setSkinWeightsFunction, "SPPSetSkinWeights"); - - -static bool applyOffsetToVertices(INode* inNode, Point3 inOffset) -{ - static bool success = false; - bool deleteIt = false; - bool polyDeleteIt = false; - Interface* coreInterface = GetCOREInterface(); - PolyObject* polyObject = getPolyObjectFromNode(inNode, coreInterface->GetTime(), deleteIt); - if (polyObject) - { - MNMesh& mesh = polyObject->GetMesh(); - for (int vertIndex = 0; vertIndex < mesh.VNum(); vertIndex++) - { - MNVert* vert = mesh.V(vertIndex); - vert->p += inOffset; - } - inNode->SetObjectRef(polyObject); - polyObject->FreeCaches(); - polyObject->NotifyDependents(FOREVER, OBJ_CHANNELS, REFMSG_CHANGE); - coreInterface->RedrawViews(coreInterface->GetTime()); - success = true; - } - return success; -} - -Value* getPositions(INode* inNode) -{ - Object* nodeBaseObject = inNode->GetObjectRef()->FindBaseObject(); - if (nodeBaseObject->CanConvertToType(Class_ID(POLYOBJ_CLASS_ID, 0))) - { - EPoly* ePolyInterface = (EPoly*)(nodeBaseObject->GetInterface(EPOLY_INTERFACE)); - MNMesh* mnMesh = ePolyInterface->GetMeshPtr(); - Array* positions = new Array(mnMesh->VNum()); - positions->size = mnMesh->VNum(); - for (int index = 0; index < mnMesh->VNum(); index++) - { - MNVert vertex = mnMesh->v[0]; - Point3 vertexPosition = vertex.p; - Array* _position = new Array(3); - _position->size = 3; - _position->data[0] = Float::intern(vertexPosition.x); - _position->data[1] = Float::intern(vertexPosition.y); - _position->data[2] = Float::intern(vertexPosition.z); - positions->data[index] = _position; - } - - return positions; - } - return &Undefined_class; -} - -Value* getPositions_cf(Value** arg_list, int count) -{ - // INode* skinnedNode, Value* boneIDs, Value* vertexWeights, Value* vertices - check_arg_count_with_keys(getPositions, 1, count); - INode* node = ((MAXNode*)arg_list[0])->to_node(); - return getPositions(node); -} - -def_struct_primitive(getPositions, SkinPPOps, "getPositions"); - - -struct SkinPlusPlusFunctionPublish : public FPStaticInterface -{ - DECLARE_DESCRIPTOR(SkinPlusPlusFunctionPublish); - - enum FunctionIDs - { - ID_GetSkinWeights, - ID_SetVertexWeights, - ID_SetSkinWeights, - ID_ReplaceBoneWeights, - }; - BEGIN_FUNCTION_MAP - FN_1(ID_GetSkinWeights, TYPE_VALUE, Fn_GetSkinWeights, TYPE_INODE); - FN_3(ID_SetVertexWeights, TYPE_BOOL, Fn_SetVertexWeights, TYPE_INODE, TYPE_INT, TYPE_VALUE); - FN_4(ID_SetSkinWeights, TYPE_BOOL, Fn_SetSkinWeights, TYPE_INODE, TYPE_VALUE, TYPE_VALUE, TYPE_VALUE); - //FN_4(ID_SetVertexWeights, TYPE_VALUE, Fn_SetVertexWeights, TYPE_VALUE, TYPE_VALUE, TYPE_VALUE, TYPE_VALUE); - //FN_4(ID_ReplaceBoneWeights, TYPE_VALUE, Fn_ReplaceBoneWeights, TYPE_INODE, TYPE_INODE, TYPE_INODE, TYPE_VALUE); - END_FUNCTION_MAP - - const Array* Fn_GetSkinWeights(INode* skinnedNode) - { - one_typed_value_local(Array* skinData); - //vl.skinData = new Array(2); - //vl.skinData->size = 2; - //getSkinWeightsFn(skinnedNode, *vl.skinData); - vl.skinData = getSkinWeightsFn(skinnedNode); - return_value(vl.skinData); - } - - const BOOL Fn_SetVertexWeights(INode* skinnedNode, int vertexIndex, Value* weightData) - { - Array* _weightData = (Array*)weightData; - return setVertexWeights(skinnedNode, vertexIndex, _weightData); - } - - const BOOL Fn_SetSkinWeights(INode* skinnedNode, Value* boneIDs, Value* vertexWeights, Value* vertices) - { - type_check(boneIDs, Array, _T("SetSkinWeights")); - type_check(vertexWeights, Array, _T("SetSkinWeights")); - Array* vertices_ = NULL; - if (vertices && vertices != &undefined) - { - type_check(vertices, Array, _T("SetSkinWeights")); - vertices_ = (Array*)vertices; - } - return setSkinWeightsFn(skinnedNode, (Array*)boneIDs, (Array*)vertexWeights, vertices_); - } - - - //const Value* Fn_ReplaceBoneWeights( - // INode* skinnedNode, - // INode* oldBone, - // INode* newBone, - // Value* verticesArray = &undefined - //) - //{ - // SkinData* skinData = new SkinData(skinnedNode); - // Array* verticesArray_ = NULL; - // if (verticesArray && verticesArray != &undefined) - // { - // type_check(verticesArray, Array, _T("ReplaceBoneWeights")); - // verticesArray_ = (Array*)verticesArray; - // } - // if (skinData->replaceBoneWeights(oldBone, newBone, verticesArray_)) - // { - // return &true_value; - // } - // return &false_value; - //} - - //const Value* Fn_SetVertexWeights( - // Value* skinnedNode, - // Value* vertexBoneIDsArray, - // Value* vertexWeightsArray, - // Value* verticesArray = &undefined - //) - //{ - // type_check(skinnedNode, MAXNode, _T("SetVertexWeight")); - // type_check(vertexBoneIDsArray, Array, _T("SetVertexWeight")); - // type_check(vertexWeightsArray, Array, _T("SetVertexWeight")); - // Array* verticesArray_ = NULL; - // if (verticesArray != &undefined) - // { - // verticesArray_ = (Array*)verticesArray; - // } - // if (setVertexWeights(skinnedNode->to_node(), (Array*)vertexBoneIDsArray, (Array*)vertexWeightsArray)) - // { - // return &true_value; - // } - // return &false_value; - //} - -}; - - -static SkinPlusPlusFunctionPublish skinPlusPlusFunctionPublish -( - Interface_ID(0x231958ad, 0x1ea823e8), - _T("SkinPP"), - -1, - 0, - FP_CORE, - SkinPlusPlusFunctionPublish::ID_GetSkinWeights, _T("GetSkinWeights"), 0, TYPE_VALUE, 0, 1, - _T("skinnedNode"), 0, TYPE_INODE, - SkinPlusPlusFunctionPublish::ID_SetVertexWeights, _T("SetVertexWeights"), 0, TYPE_VALUE, 0, 3, - _T("skinnedNode"), 0, TYPE_INODE, - _T("vertexIndex"), 0, TYPE_INT, - _T("weightData"), 0, TYPE_VALUE, - SkinPlusPlusFunctionPublish::ID_SetSkinWeights, _T("SetSkinWeights"), 0, TYPE_VALUE, 0, 4, - _T("skinnedNode"), 0, TYPE_INODE, - _T("vertBoneIDsArray"), 0, TYPE_VALUE, - _T("weightsArray"), 0, TYPE_VALUE, - _T("verticesArray"), 0, TYPE_VALUE, f_keyArgDefault, NULL, - //SkinPlusPlusFunctionPublish::ID_ReplaceBoneWeights, _T("ReplaceBoneWeights"), 0, TYPE_VALUE, 0, 4, - //_T("skinnedNode"), 0, TYPE_INODE, - //_T("oldBone"), 0, TYPE_INODE, - //_T("newBone"), 0, TYPE_INODE, - //_T("vertexIDs"), 0, TYPE_VALUE, f_keyArgDefault, NULL, - p_end -); - diff --git a/SDKProjects/3DsMax/SkinPlusPlus.def b/SDKProjects/3DsMax/SkinPlusPlus.def deleted file mode 100644 index 38e3f48..0000000 --- a/SDKProjects/3DsMax/SkinPlusPlus.def +++ /dev/null @@ -1,10 +0,0 @@ -LIBRARY SkinPlusPlus.gup -EXPORTS - LibDescription @1 PRIVATE - LibNumberClasses @2 PRIVATE - LibClassDesc @3 PRIVATE - LibVersion @4 PRIVATE - LibInitialize @6 PRIVATE - LibShutdown @7 PRIVATE -SECTIONS - .data READ WRITE diff --git a/SDKProjects/3DsMax/SkinPlusPlus.h b/SDKProjects/3DsMax/SkinPlusPlus.h deleted file mode 100644 index 6806530..0000000 --- a/SDKProjects/3DsMax/SkinPlusPlus.h +++ /dev/null @@ -1,107 +0,0 @@ -#pragma once - - -#include "3dsmaxsdk_preinclude.h" -#include "resource.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -extern TCHAR *GetString(int id); - -extern HINSTANCE hInstance; - -// A struct containing weight data of a single skinned vertex. -struct VertexData -{ -private: - Tab bones; - Tab weights; - -public: - VertexData(int size) { this->initialiseVariables(size); }; - VertexData(int vertexID, Array* boneIDs, Array* weights, Tab skinBones); - void initialiseVariables(int size); - void appendVariables(INode* bone, float weight); - Tab getBones() { return this->bones; }; - Tab getWeights() { return this->weights; }; -}; - - //A struct containing weight data of all skinned vertices. -struct VertexDataCollection -{ -public: - Array* weights; - Array* boneIDs; - - VertexDataCollection() {}; - VertexDataCollection(int vertexCount) - { - this->weights = new Array(vertexCount); - this->boneIDs = new Array(vertexCount); - }; -}; - -class SkinData -{ -protected: - // Properties: - bool isValid = false; - INode* node; - IDerivedObject* iDerivedObject; - Modifier* skinModifier; - ISkin* iSkin; - ISkinContextData* iSkinContextData; // used to query skin data - ISkinImportData* iSkinImportData; // used to modify skin data - Tab allVertexData; - Tab cachedUndoVertexData; - -public: - SkinData() {}; - SkinData(INode* skinnedNode) { this->isValid = this->initialise(skinnedNode); } - ~SkinData() - { - this->allVertexData.~Tab(); - this->cachedUndoVertexData.~Tab(); - } - bool initialise(INode* skinnedNode); - Tab getAllVertexData() { return this->allVertexData; }; - Tab getCachedVertexData() { return this->cachedUndoVertexData; }; - virtual void getSkinWeights(Array& ioSkinData); - virtual Array* getSkinWeights(); - bool setSkinWeights(Array* boneIDs, Array* vertexWeights, Array* vertices = NULL); - bool setVertexWeights(int vertexIndex, Array* vertexBones, Array* vertexWeights); - bool setVertexWeights(const int vertexIndex, Array* inBoneIDs, Array* inVertexWeights, Tab inSkinBones); -}; - - -//class SkinDataRestorObject : public RestoreObj { -//private: -// static SkinData* skinData; -//public: -// BOOL updateView; -// -// SkinDataRestorObject(SkinData* inSkinData, BOOL updateView = TRUE); -// ~SkinDataRestorObject(); -// void Restore(int isUndo); -// void Redo(); -// void EndHold(); -// TSTR Description(); -//}; - - diff --git a/SDKProjects/3DsMax/SkinPlusPlus.rc b/SDKProjects/3DsMax/SkinPlusPlus.rc deleted file mode 100644 index 321111d..0000000 --- a/SDKProjects/3DsMax/SkinPlusPlus.rc +++ /dev/null @@ -1,95 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_LIBDESCRIPTION "Plugin for better skin modifier access" - IDS_CATEGORY "SkinPlusPlus" - IDS_CLASS_NAME "SkinPlusPlus" - IDS_PARAMS "Parameters" - IDS_SPIN "Spin" -END - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -//// English (United Kingdom) resources -// -//#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -//LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -//#pragma code_page(1252) -// -//#ifdef APSTUDIO_INVOKED -/////////////////////////////////////////////////////////////////////////////// -//// -//// TEXTINCLUDE -//// -// -//3 TEXTINCLUDE -//BEGIN -// "\r\n" -// "\0" -//END -// -//#endif // APSTUDIO_INVOKED -// -//#endif // English (United Kingdom) resources -/////////////////////////////////////////////////////////////////////////////// -// - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/SDKProjects/3DsMax/SkinPlusPlus.sln b/SDKProjects/3DsMax/SkinPlusPlus.sln deleted file mode 100644 index b32a35a..0000000 --- a/SDKProjects/3DsMax/SkinPlusPlus.sln +++ /dev/null @@ -1,37 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31912.275 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SkinPlusPlus", "SkinPlusPlus.vcxproj", "{6671F0BA-6FB8-4F35-8392-0676D05113A8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - 2021-Debug|x64 = 2021-Debug|x64 - 2021-Hybrid|x64 = 2021-Hybrid|x64 - 2021-Release|x64 = 2021-Release|x64 - 2022-Debug|x64 = 2022-Debug|x64 - 2022-Hybrid|x64 = 2022-Hybrid|x64 - 2022-Release|x64 = 2022-Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2021-Debug|x64.ActiveCfg = 2021-Debug|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2021-Debug|x64.Build.0 = 2021-Debug|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2021-Hybrid|x64.ActiveCfg = 2021-Hybrid|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2021-Hybrid|x64.Build.0 = 2021-Hybrid|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2021-Release|x64.ActiveCfg = 2021-Release|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2021-Release|x64.Build.0 = 2021-Release|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2022-Debug|x64.ActiveCfg = 2021-Debug|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2022-Debug|x64.Build.0 = 2021-Debug|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2022-Hybrid|x64.ActiveCfg = 2022-Hybrid|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2022-Hybrid|x64.Build.0 = 2022-Hybrid|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2022-Release|x64.ActiveCfg = 2022-Release|x64 - {6671F0BA-6FB8-4F35-8392-0676D05113A8}.2022-Release|x64.Build.0 = 2022-Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {47597C01-A06B-487C-BB0B-CA7579DDA704} - EndGlobalSection -EndGlobal diff --git a/SDKProjects/3DsMax/SkinPlusPlus.vcxproj b/SDKProjects/3DsMax/SkinPlusPlus.vcxproj deleted file mode 100644 index 6eb86c6..0000000 --- a/SDKProjects/3DsMax/SkinPlusPlus.vcxproj +++ /dev/null @@ -1,109 +0,0 @@ - - - - - 2021-Debug - x64 - - - 2021-Hybrid - x64 - - - 2021-Release - x64 - - - 2022-Debug - x64 - - - 2022-Hybrid - x64 - - - 2022-Release - x64 - - - - SkinPlusPlus - {6671F0BA-6FB8-4f35-8392-0676D05113A8} - DynamicLibrary - $(ADSK_3DSMAX_SDK_2021) - 10.0.17134.0 - - - SkinPlusPlus - {6671F0BA-6FB8-4f35-8392-0676D05113A8} - DynamicLibrary - $(ADSK_3DSMAX_SDK_2022) - 10.0.17134.0 - - - SkinPlusPlus - {6671F0BA-6FB8-4f35-8392-0676D05113A8} - DynamicLibrary - $(ADSK_3DSMAX_SDK_2022) - 10.0.17134.0 - - - 10.0.17134.0 - - - - v141 - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(ADSK_3DSMAX_x64_2022)Plugins\ - $(ADSK_3DSMAX_x64_2022)Plugins\ - $(ProjectDir)obj\$(Platform)\$(Configuration)\ - SkinPlusPlus - .gup - - - - - - _USRDLL;%(PreprocessorDefinitions) - $(MaxSdkInc);C:\Program Files\Python37\include;$(ProjectDir)venv\venv37\Lib\site-packages\pybind11\include;%(AdditionalIncludeDirectories) - Level4 - stdcpp14 - - - false - stdcpp14 - - - false - - - $(MaxSdk)\lib\x64\Release;C:\Program Files\Python37\libs;%(AdditionalLibraryDirectories) - bmm.lib;core.lib;geom.lib;gfx.lib;mesh.lib;maxutil.lib;maxscrpt.lib;gup.lib;paramblk2.lib;;%(AdditionalDependencies) - SkinPlusPlus.def - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SDKProjects/3DsMax/SkinPlusPlus.vcxproj.filters b/SDKProjects/3DsMax/SkinPlusPlus.vcxproj.filters deleted file mode 100644 index 53fb80f..0000000 --- a/SDKProjects/3DsMax/SkinPlusPlus.vcxproj.filters +++ /dev/null @@ -1,49 +0,0 @@ - - - - - {fbad0f2d-faaa-4b0b-865c-583fac8ddcb1} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {92f20462-242f-4a0c-883e-b3c33819b84b} - h;hpp;hxx;hm;inl - - - {ad6e765e-4300-41dc-b185-05b019286785} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/SDKProjects/3DsMax/SkinPlusPlusPy.cpp b/SDKProjects/3DsMax/SkinPlusPlusPy.cpp deleted file mode 100644 index 23fc6f3..0000000 --- a/SDKProjects/3DsMax/SkinPlusPlusPy.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include "SkinPlusPlusPy.h" - - -//py::array_t> SkinDataPy::getSkinWeights() -py::array_t SkinDataPy::getSkinWeights() -{ - //int vertexCount = this->iSkinContextData->GetNumPoints(); - //weights = new Array(vertexCount); - //boneIDs = new Array(vertexCount); - //weights->size = vertexCount; - //boneIDs->size = vertexCount; - //for (int vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) - //{ - // int influenceCount = this->iSkinContextData->GetNumAssignedBones(vertexIndex); - // vl.influenceWeights = new Array(influenceCount); - // vl.influenceBoneIDs = new Array(influenceCount); - // vl.influenceWeights->size = influenceCount; - // vl.influenceBoneIDs->size = influenceCount; - // for (int influenceIndex = 0; influenceIndex < influenceCount; influenceIndex++) - // { - // float infuenceWeight = this->iSkinContextData->GetBoneWeight(vertexIndex, influenceIndex); - // int influenceBoneID = this->iSkinContextData->GetAssignedBone(vertexIndex, influenceIndex) + 1; - // vl.influenceWeights->data[influenceIndex] = Float::intern(infuenceWeight); - // vl.influenceBoneIDs->data[influenceIndex] = Integer::intern(influenceBoneID); - // } - // vl.weights->data[vertexIndex] = vl.influenceWeights; - // vl.boneIDs->data[vertexIndex] = vl.influenceBoneIDs; - //}; - //vl.skinData = new Array(2); - //vl.skinData->size = 2; - //vl.skinData->data[0] = vl.weights; - //vl.skinData->data[1] = vl.boneIDs; - //return_value_tls(vl.weights); - - py::array_t sub_array = py::array_t(10); - //py::array_t> array = py::array_t>(1); - //array[0] = sub_array; - return sub_array; -} - - - -py::array_t getSkinWeights() -{ - SkinDataPy* skinDataPy = new SkinDataPy(); - return skinDataPy->getSkinWeights(); -}; - - - -PYBIND11_MODULE(SkinPlusPlusPy, m) { - m.def("get_skin_weights", &getSkinWeights, "Get Skin Weights"); - -//#ifdef VERSION_INFO -// m.attr("__version__") = VERSION_INFO; -//#else -// m.attr("__version__") = "dev"; -//#endif -} \ No newline at end of file diff --git a/SDKProjects/3DsMax/SkinPlusPlusPy.h b/SDKProjects/3DsMax/SkinPlusPlusPy.h deleted file mode 100644 index 0613b24..0000000 --- a/SDKProjects/3DsMax/SkinPlusPlusPy.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include -#include -#include "SkinPlusPlus.h" - - -namespace py = pybind11; - - -class SkinDataPy: SkinData -{ -//private: - -public: - SkinDataPy() {}; - py::array_t getSkinWeights(); -}; - -py::array_t getSkinWeights(); - diff --git a/SDKProjects/3DsMax/pyproject.toml b/SDKProjects/3DsMax/pyproject.toml deleted file mode 100644 index 61c68c9..0000000 --- a/SDKProjects/3DsMax/pyproject.toml +++ /dev/null @@ -1,3 +0,0 @@ -[build-system] -requires = ["setuptools", "wheel", "pybind11"] -build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/SDKProjects/3DsMax/resource.h b/SDKProjects/3DsMax/resource.h deleted file mode 100644 index 2f454d5..0000000 --- a/SDKProjects/3DsMax/resource.h +++ /dev/null @@ -1,23 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by SkinPlusPlus.rc -// -#define IDS_LIBDESCRIPTION 1 -#define IDS_CATEGORY 2 -#define IDS_CLASS_NAME 3 -#define IDS_PARAMS 4 -#define IDS_SPIN 5 -#define IDC_CLOSEBUTTON 1000 -#define IDC_DOSTUFF 1000 -#define IDC_COLOR 1456 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/SDKProjects/3DsMax/setup.py b/SDKProjects/3DsMax/setup.py deleted file mode 100644 index 4487dc3..0000000 --- a/SDKProjects/3DsMax/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -from setuptools import setup, Extension -import pybind11 - -cpp_args = ["-std=c++14", "-stdlib=libc++", "-mmacosx-version-min=10.7"] - -skin_plus_plus_module = Extension( - "SkinPlusPlusPy", - sources=["SkinPlusPlusPy.cpp"], - include_dirs=[pybind11.get_include()], - language="c++", - extra_compile_args=cpp_args, - ) - -setup( - name="SkinPlusPlusPy", - version="1.0", - description="Python package for getting and setting skin weights in 3DsMax", - ext_modules=[skin_plus_plus_module], -) \ No newline at end of file