-
Notifications
You must be signed in to change notification settings - Fork 0
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
renc
committed
Jun 11, 2013
0 parents
commit 72a81bb
Showing
6 changed files
with
387 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,22 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
*.sln merge=union | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain |
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,215 @@ | ||
################# | ||
## Eclipse | ||
################# | ||
|
||
*.pydevproject | ||
.project | ||
.metadata | ||
bin/ | ||
tmp/ | ||
*.tmp | ||
*.bak | ||
*.swp | ||
*~.nib | ||
local.properties | ||
.classpath | ||
.settings/ | ||
.loadpath | ||
|
||
# External tool builders | ||
.externalToolBuilders/ | ||
|
||
# Locally stored "Eclipse launch configurations" | ||
*.launch | ||
|
||
# CDT-specific | ||
.cproject | ||
|
||
# PDT-specific | ||
.buildpath | ||
|
||
|
||
################# | ||
## Visual Studio | ||
################# | ||
|
||
## Ignore Visual Studio temporary files, build results, and | ||
## files generated by popular Visual Studio add-ons. | ||
|
||
# User-specific files | ||
*.suo | ||
*.user | ||
*.sln.docstates | ||
|
||
# Build results | ||
|
||
[Dd]ebug/ | ||
[Rr]elease/ | ||
x64/ | ||
build/ | ||
[Bb]in/ | ||
[Oo]bj/ | ||
|
||
# MSTest test Results | ||
[Tt]est[Rr]esult*/ | ||
[Bb]uild[Ll]og.* | ||
|
||
*_i.c | ||
*_p.c | ||
*.ilk | ||
*.meta | ||
*.obj | ||
*.pch | ||
*.pdb | ||
*.pgc | ||
*.pgd | ||
*.rsp | ||
*.sbr | ||
*.tlb | ||
*.tli | ||
*.tlh | ||
*.tmp | ||
*.tmp_proj | ||
*.log | ||
*.vspscc | ||
*.vssscc | ||
.builds | ||
*.pidb | ||
*.log | ||
*.scc | ||
|
||
# Visual C++ cache files | ||
ipch/ | ||
*.aps | ||
*.ncb | ||
*.opensdf | ||
*.sdf | ||
*.cachefile | ||
|
||
# Visual Studio profiler | ||
*.psess | ||
*.vsp | ||
*.vspx | ||
|
||
# Guidance Automation Toolkit | ||
*.gpState | ||
|
||
# ReSharper is a .NET coding add-in | ||
_ReSharper*/ | ||
*.[Rr]e[Ss]harper | ||
|
||
# TeamCity is a build add-in | ||
_TeamCity* | ||
|
||
# DotCover is a Code Coverage Tool | ||
*.dotCover | ||
|
||
# NCrunch | ||
*.ncrunch* | ||
.*crunch*.local.xml | ||
|
||
# Installshield output folder | ||
[Ee]xpress/ | ||
|
||
# DocProject is a documentation generator add-in | ||
DocProject/buildhelp/ | ||
DocProject/Help/*.HxT | ||
DocProject/Help/*.HxC | ||
DocProject/Help/*.hhc | ||
DocProject/Help/*.hhk | ||
DocProject/Help/*.hhp | ||
DocProject/Help/Html2 | ||
DocProject/Help/html | ||
|
||
# Click-Once directory | ||
publish/ | ||
|
||
# Publish Web Output | ||
*.Publish.xml | ||
*.pubxml | ||
|
||
# NuGet Packages Directory | ||
## TODO: If you have NuGet Package Restore enabled, uncomment the next line | ||
#packages/ | ||
|
||
# Windows Azure Build Output | ||
csx | ||
*.build.csdef | ||
|
||
# Windows Store app package directory | ||
AppPackages/ | ||
|
||
# Others | ||
sql/ | ||
*.Cache | ||
ClientBin/ | ||
[Ss]tyle[Cc]op.* | ||
~$* | ||
*~ | ||
*.dbmdl | ||
*.[Pp]ublish.xml | ||
*.pfx | ||
*.publishsettings | ||
|
||
# RIA/Silverlight projects | ||
Generated_Code/ | ||
|
||
# Backup & report files from converting an old project file to a newer | ||
# Visual Studio version. Backup files are not needed, because we have git ;-) | ||
_UpgradeReport_Files/ | ||
Backup*/ | ||
UpgradeLog*.XML | ||
UpgradeLog*.htm | ||
|
||
# SQL Server files | ||
App_Data/*.mdf | ||
App_Data/*.ldf | ||
|
||
############# | ||
## Windows detritus | ||
############# | ||
|
||
# Windows image file caches | ||
Thumbs.db | ||
ehthumbs.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Mac crap | ||
.DS_Store | ||
|
||
|
||
############# | ||
## Python | ||
############# | ||
|
||
*.py[co] | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist/ | ||
build/ | ||
eggs/ | ||
parts/ | ||
var/ | ||
sdist/ | ||
develop-eggs/ | ||
.installed.cfg | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
|
||
#Translations | ||
*.mo | ||
|
||
#Mr Developer | ||
.mr.developer.cfg |
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,57 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
################ | ||
# mudbox | ||
set (MUDBOXSDK_DIR "C:/Program Files/Autodesk/Mudbox 2014/SDK") | ||
set (MUDBOXSDK_INC_DIR ${MUDBOXSDK_DIR}/include) | ||
set (MUDBOXSDK_QT_INC_DIR | ||
${MUDBOXSDK_INC_DIR}/QtCore | ||
${MUDBOXSDK_INC_DIR}/QtGui | ||
${MUDBOXSDK_INC_DIR}/QtOpenGL | ||
) | ||
set (MUDBOXSDK_LIB_DIR ${MUDBOXSDK_DIR}/lib) | ||
set (MUDBOXSDK_LIB | ||
cg.lib | ||
cgGL.lib | ||
EdgeBleeding.lib | ||
MapExtractor.lib | ||
MapExtractorAPI.lib | ||
MudboxFramework.lib | ||
phonon4.lib | ||
QtCore4.lib | ||
QtGui4.lib | ||
QtNetwork4.lib | ||
QtOpenGL4.lib | ||
QtScript4.lib | ||
QtSql4.lib | ||
QtSvg4.lib | ||
QtWebKit4.lib | ||
QtXml4.lib | ||
UVlessPainting.lib | ||
) | ||
|
||
include_directories ("${MUDBOXSDK_INC_DIR}" ${MUDBOXSDK_QT_INC_DIR}) | ||
link_directories ( "${MUDBOXSDK_LIB_DIR}") | ||
|
||
|
||
################ | ||
# | ||
project (Mudbox_custom_plugin_LayerOps) | ||
|
||
set (PLUGIN_NAME Mudbox_custom_plugin_LayerOps) | ||
|
||
set(SRC | ||
PluginMain.cpp | ||
|
||
LayerCleaner.h | ||
LayerCleaner.cpp | ||
|
||
) | ||
|
||
add_library(${PLUGIN_NAME} SHARED ${SRC}) | ||
|
||
target_link_libraries( | ||
${PLUGIN_NAME} | ||
|
||
${MUDBOXSDK_LIB} | ||
) |
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,58 @@ | ||
#include <QtCore/QObject> // include this before mudbox headers. | ||
#include <Mudbox/mudbox.h> | ||
#include "LayerCleaner.h" | ||
|
||
using namespace mudbox; | ||
|
||
void CleanSculptLayers() | ||
{ | ||
// traver all the geometries. | ||
for (unsigned int iG = 0; iG < Kernel()->Scene()->GeometryCount(); ++iG) | ||
{ | ||
Geometry *pG = Kernel()->Scene()->Geometry(iG); | ||
if (!pG) | ||
continue; | ||
|
||
Store<Mesh *> aMeshes; | ||
Store<LayerMeshData *> aLayers; | ||
|
||
// go through all the sculpt layers of this geometry, | ||
// they may lock to different levels though. | ||
const unsigned int iLayerCount = pG->LayerCount(); | ||
for (unsigned int iL = 0; iL < iLayerCount; ++iL) | ||
{ | ||
LayerMeshData *pLayer = pG->LayerData(iL); | ||
if (!pLayer) | ||
continue; | ||
|
||
Mesh *pMesh = pLayer->Mesh(); pMesh; | ||
aMeshes.Add(pLayer->Mesh()); | ||
aLayers.Add(pLayer); | ||
} | ||
|
||
SubdivisionLevel *pActiveLevel = pG->ActiveLevel(); | ||
for (unsigned int i = 0; i < aLayers.ItemCount(); ++i) | ||
{ | ||
if (!aMeshes[i]) | ||
continue; | ||
|
||
// sculpt layer can only be removed from the active level | ||
// and this active level is the layer locked to. | ||
pG->ChangeActiveLevel(dynamic_cast<SubdivisionLevel *>(aMeshes[i])); | ||
aMeshes[i]->RemoveLayer(aLayers[i]); | ||
|
||
// update the mesh renderer. | ||
aMeshes[i]->ContentChanged(); | ||
MeshRenderer *pR = NULL; | ||
for (unsigned int r = 0; pR = aMeshes[i]->ChildByClass<MeshRenderer>(r); ++r) | ||
{ | ||
pR->OnMeshChange(MeshRenderer::changeVertexPosition); | ||
pR->OnVertexPositionChange(-1, -1); | ||
} | ||
} | ||
pG->ChangeActiveLevel(pActiveLevel); | ||
pG->ContentChanged(); | ||
} | ||
Kernel()->ViewPort()->Redraw(); | ||
Kernel()->Interface()->RefreshUI(); | ||
} |
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,7 @@ | ||
#ifndef LAYERCLEANER_H | ||
#define LAYERCLEANER_H | ||
|
||
|
||
void CleanSculptLayers(); | ||
|
||
#endif // LAYERCLEANER_H |
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,28 @@ | ||
#include <QtCore/QObject> // include this before mudbox headers. | ||
#include <Mudbox/mudbox.h> | ||
|
||
#include "LayerCleaner.h" | ||
|
||
using namespace mudbox; | ||
|
||
void Initializer(); | ||
void MenuItemHandler_RemoveLayers(); | ||
|
||
static const char *sPluginName = "CustomLayerOp"; | ||
static const char *sPluginDescription = "some custom layer operations"; | ||
static const char *sPluginAuthorName = ""; | ||
static const char *sPluginURL = ""; | ||
// Register this plugin. The "Initializer" method will be called when the plugin is loaded. | ||
MB_PLUGIN( sPluginName, sPluginDescription, sPluginAuthorName, sPluginURL, Initializer ); | ||
|
||
// This function will be called then the plugin is loaded. | ||
void Initializer(void) | ||
{ | ||
// Add a menu entry for this operation. | ||
Kernel()->Interface()->AddCallbackMenuItem( mudbox::Interface::menuMesh, QString::null, QObject::tr("Remove all the sculpt layers"), MenuItemHandler_RemoveLayers); | ||
} | ||
|
||
void MenuItemHandler_RemoveLayers() | ||
{ | ||
CleanSculptLayers(); | ||
} |