-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
359 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.DS_Store | ||
*~ | ||
#* | ||
*# | ||
*.o | ||
**/Debug | ||
**/Release | ||
external/CGAL/* | ||
GeneratedFiles | ||
.vs | ||
*.db | ||
*.opendb | ||
*.pro.user | ||
!**/distribute/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// variable definitions | ||
[VarDef, dllPath, "dummy"] | ||
[VarDef, Tool_Export_Tri] | ||
[VarDef, Tool_Polypaint_Colorize] | ||
[VarDef, Tool_Export_Txr] | ||
[VarDef, Tool_Export_Flp] | ||
[VarDef, Tool_Export_Mrg] | ||
[VarDef, Tool_Export_Grp] | ||
// hard coded... | ||
[VarDef, tmpFilePath, [fileNameResolvePath, "ZBRUSH_ZSTARTUP\ZPlugs64\ExactUnionData\test.obj"]] | ||
[VarDef, unionResult] | ||
[VarDef, path, "dummyPath"] | ||
[VarDef, memBlock] | ||
|
||
// check if this plugin is correctly installed | ||
// from http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/zfileutils/#dllPath | ||
[RoutineDef, CheckSystem, | ||
//check ZBrush version | ||
[VarSet,Zvers,[ZBrushInfo,0]] | ||
[If,[Val,Zvers] >= 4.8,, | ||
[Note,"\Cff9923This zscript\Cffffff is not designed for this version of \Cff9923ZBrush\Cffffff.",,3,4737096,,300] | ||
[Exit] | ||
] | ||
[VarSet,isMac, [ZBrushInfo,6]] //check Mac or PC | ||
// Make sure we have the dll and set its path | ||
[If, [ZBrushInfo, 16]==64,//64 bit | ||
[If, isMac, | ||
//use the path below for testing only | ||
[VarSet, dllPath, "ExactUnionData/ExactUnion.lib"] | ||
//use the path below for installed plugins | ||
//[VarSet, dllPath, "ZBRUSH_ZSTARTUP/ZPlugs64/ExactUnionData/ExactUnion.lib"] | ||
, | ||
//use the path below for testing only | ||
[VarSet, dllPath, "ExactUnionData\ExactUnion64.dll"] | ||
//use the path below for installed plugins | ||
//[VarSet, dllPath, "ZBRUSH_ZSTARTUP\ZPlugs64\ExactUnionData\ExactUnion64.dll"] | ||
] | ||
,//else 32 bit - no longer supported | ||
[Note, "\Cff9923This zscript\Cffffff is not designed for this version of \Cff9923ZBrush\Cffffff.",,3,4737096,,300] | ||
[Exit] | ||
] | ||
// check if there are dll/lib exists | ||
[If, [FileExists, [Var,dllPath]], | ||
, // else no DLL. | ||
[Note,"\Cff9923Note :\Cc0c0c0 The \Cff9923 ExactUnion plugin \Cffffffdll/lib\Cc0c0c0 could not be found at the correct location. Please re-install the plugin, making sure the relevant files and folders are in the \CffffffZStartup/ZPlugs\Cc0c0c0 folder."] | ||
[Exit] | ||
] | ||
]//end routine | ||
|
||
|
||
|
||
// main processing | ||
//[ISubPalette, "ZPlugin:Exact Union"] | ||
//[IButton, "ZPlugin:Exact Union:Compute", "Compute exact union of multiple shells", | ||
[ISubPalette, "ZPlugin:Test plugin"] | ||
[IButton, "ZPlugin:Test plugin:Compute", "Plugin test", | ||
[If, [IExists, Tool:Export], | ||
[RoutineCall, CheckSystem] | ||
// store current export settings | ||
[VarSet, Tool_Export_Tri,[IGet, Tool:Export:Tri]] | ||
[VarSet, Tool_Polypaint_Colorize,[IGet, Tool:Polypaint:Colorize]] | ||
[VarSet, Tool_Export_Txr,[IGet, Tool:Export:Txr]] | ||
[VarSet, Tool_Export_Flp,[IGet, Tool:Export:Flp]] | ||
[VarSet, Tool_Export_Mrg,[IGet, Tool:Export:Mrg]] | ||
[VarSet, Tool_Export_Grp,[IGet, Tool:Export:Grp]] | ||
|
||
//set export options | ||
[IPress,Tool:Export:Tri] | ||
// don't need any extra attributes | ||
[IUnPress,Tool:Polypaint:Colorize] | ||
[IUnPress,Tool:Export:Txr] | ||
[IUnPress,Tool:Export:Flp] | ||
[IUnPress,Tool:Export:Mrg] | ||
[IUnPress,Tool:Export:Grp] | ||
|
||
//export current subtool to OBJ file (temporary file) | ||
[FileNameSetNext, [Var, tmpFilePath]] | ||
[IPress,Tool:Clone] | ||
[IPress,Tool:Export] | ||
|
||
// restore original settings | ||
[If, [Var, Tool_Export_Tri], | ||
[IPress, Tool:Export:Tri], | ||
[IPress, Tool:Export:Qud] | ||
] | ||
[ISet, Tool:Polypaint:Colorize, [Var, Tool_Polypaint_Colorize]] | ||
[ISet, Tool:Export:Txr, [Var, Tool_Export_Txr]] | ||
[ISet, Tool:Export:Flp, [Var, Tool_Export_Flp]] | ||
[ISet, Tool:Export:Mrg, [Var, Tool_Export_Mrg]] | ||
[ISet, Tool:Export:Grp, [Var, Tool_Export_Grp]] | ||
|
||
// do something with C++ | ||
[Varset, unionResult, [FileExecute, [Var, dllPath], "computeUnion", [var, tmpFilePath]]] | ||
|
||
// import to Tool | ||
[FileNameSetNext,[Var, tmpFilePath]] | ||
[IPress,Tool:Import] | ||
|
||
// erase temporary file. | ||
[FileDelete, [Var, tmpFilePath]] | ||
, | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28307.102 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExactUnion64", "ExactUnion64\ExactUnion64.vcxproj", "{0FDF8009-20C6-4A59-986B-89AF78C97A0E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{0FDF8009-20C6-4A59-986B-89AF78C97A0E}.Debug|x64.ActiveCfg = Debug|x64 | ||
{0FDF8009-20C6-4A59-986B-89AF78C97A0E}.Debug|x64.Build.0 = Debug|x64 | ||
{0FDF8009-20C6-4A59-986B-89AF78C97A0E}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{0FDF8009-20C6-4A59-986B-89AF78C97A0E}.Debug|x86.Build.0 = Debug|Win32 | ||
{0FDF8009-20C6-4A59-986B-89AF78C97A0E}.Release|x64.ActiveCfg = Release|x64 | ||
{0FDF8009-20C6-4A59-986B-89AF78C97A0E}.Release|x64.Build.0 = Release|x64 | ||
{0FDF8009-20C6-4A59-986B-89AF78C97A0E}.Release|x86.ActiveCfg = Release|Win32 | ||
{0FDF8009-20C6-4A59-986B-89AF78C97A0E}.Release|x86.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {9D6D592A-A704-4394-B890-7E5B451CA0B8} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// ExactUnion64.cpp : Defines the exported functions for the DLL application. | ||
// | ||
|
||
#define DLLEXPORT __declspec(dllexport) | ||
|
||
#include "igl/readOBJ.h" | ||
#include "igl/writeOBJ.h" | ||
#include "Eigen/Core" | ||
|
||
extern "C" { | ||
float DLLEXPORT computeUnion(char* someText, double optValue, char* outputBuffer, int optBuffer1Size, | ||
char* pOptBuffer2, int optBuffer2Size, char** zData) | ||
{ | ||
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> V; | ||
Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic> F; | ||
igl::readOBJ(someText, V, F); | ||
V.col(1) *= 2; | ||
igl::writeOBJ(someText, V, F); | ||
|
||
return 0.0f; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|Win32"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Debug|x64"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<VCProjectVersion>15.0</VCProjectVersion> | ||
<ProjectGuid>{0FDF8009-20C6-4A59-986B-89AF78C97A0E}</ProjectGuid> | ||
<Keyword>Win32Proj</Keyword> | ||
<RootNamespace>ExactUnion64</RootNamespace> | ||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Label="Shared"> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<LinkIncremental>true</LinkIncremental> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<LinkIncremental>true</LinkIncremental> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<LinkIncremental>false</LinkIncremental> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<LinkIncremental>false</LinkIncremental> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<ClCompile> | ||
<PrecompiledHeader>NotUsing</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>Disabled</Optimization> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;EXACTUNION64_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
<AdditionalIncludeDirectories>..\..\submodule\eigen;..\..\submodule\libigl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<ClCompile> | ||
<PrecompiledHeader>NotUsing</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>Disabled</Optimization> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;EXACTUNION64_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
<AdditionalIncludeDirectories>..\..\submodule\eigen;..\..\submodule\libigl\include;</AdditionalIncludeDirectories> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<ClCompile> | ||
<PrecompiledHeader>NotUsing</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;EXACTUNION64_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
<AdditionalIncludeDirectories>..\..\submodule\eigen;..\..\submodule\libigl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<ClCompile> | ||
<PrecompiledHeader>NotUsing</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;EXACTUNION64_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
<AdditionalIncludeDirectories>..\..\submodule\eigen;..\..\submodule\libigl\include;</AdditionalIncludeDirectories> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ClCompile Include="..\..\..\..\..\..\Downloads\DLL_Template\DLL_Template\main.cpp" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="..\..\..\..\..\..\Downloads\DLL_Template\DLL_Template\main.h" /> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
</ImportGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Source Files"> | ||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
</Filter> | ||
<Filter Include="Header Files"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions> | ||
</Filter> | ||
<Filter Include="Resource Files"> | ||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="..\..\..\..\..\..\Downloads\DLL_Template\DLL_Template\main.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="..\..\..\..\..\..\Downloads\DLL_Template\DLL_Template\main.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
</ItemGroup> | ||
</Project> |
Binary file not shown.
Binary file not shown.