void ApplinkDialog::Timer(const BaseContainer &msg)
{
	Bool b;
	GetBool(IDC_CHK_PROMPT, b);
	if(b)
	{
		Filename fn;
		fn.SetDirectory(gPreferences.GetString(IDC_EXCH_FOLDER));
		fn.SetFile("export.txt");
        
		if(GeFExist(fn))
		{
			GePrint("File exists!");
			SetTimer(0);
			if(GeOutString("To import a new object?", GEMB_OKCANCEL) == GEMB_R_OK)
			{
				GePrint("Start import!");
				BaseDocument* doc = GetActiveDocument();
				ApplinkImporter* importer = NewObjClear(ApplinkImporter);
				importer->Execute(doc, &gPreferences);
				SetTimer(1000);
			}
			else
			{
				SetBool(IDC_CHK_PROMPT, false);
			}
		}
	}
}
Esempio n. 2
0
void RecSearchPlugin(BasePlugin *plug)
{
	for (; plug; plug = (BasePlugin*)plug->GetNext())
	{
		if (plug->GetPluginType() == PLUGINTYPE_CUSTOMGUI)
		{
			Int32 id = plug->GetID();
			const Char *ressym = CallCustomGuiCmd(plug, GetResourceSym)();
			CustomProperty *prop = CallCustomGuiCmd(plug, GetProperties)();

			CCustomElements* pNew = NewObjClear(CCustomElements);
			pNew->m_pPlug = plug;
			pNew->m_strName = plug->GetName();
			pNew->m_pChResSym = ressym;
			pNew->m_pProp = prop;
			pNew->m_lID = id;
			g_pCustomElements->Append(pNew);

			/*for (i = 0; prop && prop[i].type != CUSTOMTYPE_END; i++)
			{
			}*/
		}
		RecSearchPlugin((BasePlugin*)plug->GetDown());
	}
}
Esempio n. 3
0
	Bool RestoreLayout(void *secret)
	{
		if (!g_pDistriDialog)
			g_pDistriDialog = NewObjClear(DiffDistriDialog);
		if (!g_pDistriDialog)
			return false;
		g_pDistriDialog->RestoreLayout(DIFF_DISTRI_ID, 0, secret);
		return true;
	}
Esempio n. 4
0
Bool RegisterBFF(void)
{
	String name = GeLoadString(IDS_BFF);
	if (!RegisterBitmapLoaderPlugin(ID_BFFLOADER, name, 0, NewObjClear(BFFLoaderData)))
		return false;
	if (!RegisterBitmapSaverPlugin(ID_BFFSAVER, name, PLUGINFLAG_BITMAPSAVER_SUPPORT_8BIT, NewObjClear(BFFSaverData), "bff"))
		return false;
	return true;
}
Esempio n. 5
0
	Bool Execute(BaseDocument *doc)
	{
		if (!g_pDistriDialog)
			g_pDistriDialog = NewObjClear(DiffDistriDialog);
		if (!g_pDistriDialog)
			return false;
		g_pDistriDialog->Open(DLG_TYPE_ASYNC, DIFF_DISTRI_ID, -1, -1, 400, 300);
		return true;
	}
Bool ApplinkDialog::Command(Int32 id, const BaseContainer& msg)
{
	dirty = true;
	saveSettings();
    
	switch(id)
	{
        case IDC_BTN_EXPORT:
		{
			BaseDocument* doc = GetActiveDocument();
			ApplinkExporter* exporter = NewObjClear(ApplinkExporter);
			exporter->Execute(doc, &gPreferences);			
            
			String exeCoat = gPreferences.GetString(IDC_COAT_EXE_PATH);
			if(gPreferences.GetBool(IDC_CHK_COAT_START) && exeCoat != "")
			{
				if(!Find3DCoat())
				{
					Int32 length = exeCoat.GetCStringLen(STRINGENCODING_8BIT) + 1;
					char* buffer = NewMemClear(char,length);
					exeCoat.GetCString(buffer, length, STRINGENCODING_8BIT);
                    
#if defined _WIN32 || defined _WIN64
					SHELLEXECUTEINFO ExecuteInfo;
                    
					memset(&ExecuteInfo, 0, sizeof(ExecuteInfo));
                    
					ExecuteInfo.cbSize       = sizeof(ExecuteInfo);
					ExecuteInfo.fMask        = 0;                
					ExecuteInfo.hwnd         = 0;                
					ExecuteInfo.lpVerb       = TEXT("open");                      // Operation to perform

					wchar_t *pBuffer = (wchar_t *)malloc(MAX_PATH);
					mbstowcs(pBuffer, buffer, MAX_PATH);
					ExecuteInfo.lpFile       = pBuffer;  // Application name

					ExecuteInfo.lpDirectory  = 0;                           // Default directory
					ExecuteInfo.nShow        = SW_SHOWNORMAL;
					ExecuteInfo.hInstApp     = 0;
                    
					if(ShellExecuteEx(&ExecuteInfo) == false)
					{
						GePrint("3D-Coat.exe not found!");
					}
#elif __APPLE__
                    string str = "open " + string(buffer);
                    system(str.c_str());
                    GePrint("Start 3D-Coat: " + String(buffer));
#endif
					DeleteMem(buffer);
				}
				else
				{
					GePrint("3D-Coat.exe is run!");
				}
			}
		}
Esempio n. 7
0
Bool CDynamicFilenameSet::AddFilename(const Filename &fn)
{
	Filename* pfn = NewObjClear(Filename, fn);
	if (!pfn)
		return false;
	Bool bExisted = false;
	if (!InsertObject(pfn, bExisted))
	{
		DeleteObj(pfn);
		return false;
	}
	if (bExisted)
		DeleteObj(pfn);
	return true;
}
Esempio n. 8
0
Bool CDynamicStringSet::AddString(const String &str)
{
	String* pstr = NewObjClear(String, str);
	if (!pstr)
		return false;
	Bool bExisted = false;
	if (!InsertObject(pstr, bExisted))
	{
		DeleteObj(pstr);
		return false;
	}
	if (bExisted)
		DeleteObj(pstr);
	return true;
}
Esempio n. 9
0
/*********************************************************************\
	Function name    : CLanguageList::AddLanguage
	Description      :
	Created at       : 26.09.01, @ 16:27:08
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CLanguageList::AddLanguage(String strName, String strSuffix)
{
	//TRACE("Found Language\n");
	//TRACE("    Name: "); TRACE_STRING(strName);
	//TRACE("  Suffix: "); TRACE_STRING(strSuffix);

	tagLanguage* pNewLang = NewObjClear(tagLanguage);
	tagLanguage** ppNewLang = bNewDeprecatedUseArraysInstead<tagLanguage*>(m_lLanguages + 1);
	CopyMemType(m_ppLanguages, ppNewLang, m_lLanguages);
	ppNewLang[m_lLanguages] = pNewLang;
	bDelete(m_ppLanguages);
	m_ppLanguages = ppNewLang;
	m_lLanguages++;
	pNewLang->strLanguageName = strName;
	pNewLang->strLanguageSuffix = strSuffix;
}
Esempio n. 10
0
/*********************************************************************\
	Function name    : CreateElementList
	Description      :
	Created at       : 26.03.02, @ 15:33:10
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CreateElementList()
{
	Int32 a;
	if (bCreatedElementList) return;
	bCreatedElementList = true;

	g_pCustomElements = NewObjClear(CDoubleLinkedList<CCustomElements>);
	if (!g_pCustomElements) return;

	RecSearchPlugin(GetFirstPlugin());

	Int32 lElementCount = g_pCustomElements->Entries();
	if (!lElementCount) return;
	AutoArray(plElements, Int32, lElementCount);
	AutoArray(plCustomElements, CCustomElements*, lElementCount);
	//AutoArray <Int32> plElements(lElementCount);
	//AutoArray <CCustomElements*> plCustomElements(lElementCount);
	if (!plElements || !plCustomElements) return;

	for (a = 0; a < lElementCount; a++)
		plElements[a] = a;

	CShellSort <Int32> s;
	s.Sort(plElements, SortCustomGuiByName, lElementCount);

	for (a = 0; a < lElementCount; a++)
		plCustomElements[a] = g_pCustomElements->GetItem(plElements[a]);
	g_pCustomElements->UnlinkList();
	g_pCustomElements->FromArray(plCustomElements, lElementCount);


	/*BasePlugin* plug = FindPlugin(DESCRIPTIONCUSTOMGUIDATA, PLUGINTYPE_CUSTOMGUI);

	if (plug)
	{
		Int32 i;
		const Char *ressym = CallCustomGuiCmd(plug, GetResourceSym)();
		CustomGuiProperty *prop = CallCustomGuiCmd(plug, GetProperties)();
		for (i = 0; prop && prop[i].type != CUSTOMTYPE_END; i++)
		{
		}
	}*/
}
Esempio n. 11
0
/*********************************************************************\
	Function name    : TreeViewItem::AddItem
	Description      :
	Created at       : 14.08.01, @ 19:05:03
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
TreeViewItem* TreeViewItem::AddItem(const BaseContainer &data, TreeViewItem* pInsertAfter)
{
	TreeViewItem* pNewItem = NewObjClear(TreeViewItem);
	pNewItem->m_Data = data;

	TreeViewItem** pNewChildren = bNewDeprecatedUseArraysInstead<TreeViewItem*>(m_lChildren + 1);
	Int32 a, b;
	for (a = 0, b = 0; a < m_lChildren; a++, b++)
	{
		pNewChildren[b] = m_ppChildren[a];
		if ((m_ppChildren[a] == pInsertAfter) && b == a)
			pNewChildren[++b] = pNewItem;
	}

	//CopyMem(m_ppChildren, pNewChildren, sizeof(TreeViewItem*) * m_lChildren);

	bDelete(m_ppChildren);
	m_ppChildren = pNewChildren;
	if (b <= m_lChildren)
		m_ppChildren[m_lChildren] = pNewItem;
	m_lChildren++;

	return pNewItem;
}
	static FalloffData* Alloc(void) { return NewObjClear(RandomFalloff); }
Esempio n. 13
0
String* CDynamicStringArray::AllocObject() const
{
	return NewObjClear(String);
}
Esempio n. 14
0
String* CDynamicStringSet::GetClone(const String* pObj, AliasTrans* pTrans) const
{
	return NewObjClear(String, *pObj);
}
Esempio n. 15
0
Bool RegisterSculptSelectionBrush()
{
	SculptBrushParams* pParams = SculptBrushParams::Alloc();
	if (!pParams)
		return false;

	//Since we are using StartStroke/EndStroke calls then we need to set this to true.
	pParams->EnableBrushAccess(true);

	//We want to handle undo/redo ourselves so we tell the Sculpting System that should not do anything with its Undo System.
	pParams->SetUndoType(SCULPTBRUSHDATATYPE_NONE);

	//Tell the system to only rebuild the collision cache if something other than the select flags have changed
	pParams->SetPolygonObjectDirtyFlags(DIRTYFLAGS_ALL & ~DIRTYFLAGS_SELECT);

	//Set the MovePointFunc to call for each dab.
	pParams->SetMovePointFunc(&SculptSelectionBrush::MovePointsFunc);

	//Register the tool with Cinema4D.
	return RegisterToolPlugin(SCULPTBRUSH_SDK_EXAMPLE_SELECTION, GeLoadString(IDS_SCULPTBRUSH_SELECTIONTOOL), PLUGINFLAG_TOOL_SCULPTBRUSH | PLUGINFLAG_TOOL_NO_OBJECTOUTLINE, nullptr, GeLoadString(IDS_SCULPTBRUSH_SELECTIONTOOL), NewObjClear(SculptSelectionBrush, pParams));
}
Esempio n. 16
0
Bool RegisterDiffZipCommand()
{
	RegisterResEditIcon(DIFF_DISTRI_ID, 8, 2);
	RegisterCommandPlugin(DIFF_DISTRI_ID, GeLoadString(IDS_DIFF_DISTRI), 0, nullptr, GeLoadString(IDS_DIFF_DISTRI), NewObjClear(DiffDistriCommand));
	return true;
}
Esempio n. 17
0
/*********************************************************************\
	Function name    : CResEditBrowser::FillList
	Description      :
	Created at       : 25.09.01, @ 22:58:07
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CResEditBrowser::FillList()
{
	SetTitle(GeLoadString(IDS_BROWSER_CAPT) + " - " + m_strPath.GetString());
	GeShowMouse(MOUSE_BUSY);

	m_wndTreeView.LockWindowUpdate();
	m_wndTreeView.Reset();

	m_pDialogsItem = m_wndTreeView.AddItem(GeLoadString(IDS_BROWSER_DIALOGS));
	m_pImagesItem = m_wndTreeView.AddItem(GeLoadString(IDS_BROWSER_IMAGES));
	m_pStringTablesItem = m_wndTreeView.AddItem(GeLoadString(IDS_BROWSER_STRIG_TABLES));

	BrowsePath(m_strPath);

	// add global string table(s)
	CDoubleLinkedList <CStringTableName> stringList;

	AutoAlloc <BrowseFiles> pBrowse;
	pBrowse->Init(m_strPath, false);
	while (pBrowse->GetNext())
	{
		if (!pBrowse->IsDir()) continue;

		Filename fnNew = pBrowse->GetFilename();

		if (fnNew.GetString().SubStr(0, 8).ToLower() == "strings_")
		{
			Filename fnStringTable = m_strPath + fnNew;
			TRACE("Found string table path ");
			//TRACE_STRING(fnStringTable.GetString());

			AutoAlloc <BrowseFiles> pBrowseTable;
			pBrowseTable->Init(fnStringTable, false);

			while (pBrowseTable->GetNext())
			{
				Filename fnTable = pBrowseTable->GetFilename();
				if (fnTable.CheckSuffix("str"))
				{
					TRACE("  ");
					//TRACE_STRING(fnTable.GetString());

					String strNewName = fnTable.GetString();
					// check, if we didn't find this table before

					CStringTableName *pSearch = stringList.First();
					Bool bFound = false;
					while (pSearch)
					{
						if (pSearch->strName == strNewName)
						{
							bFound = true;
							break;
						}
						pSearch = stringList.Next(pSearch);
					}
					if (bFound) continue;

					CStringTableName *pNewItem = NewObjClear(CStringTableName);
					pNewItem->strName = strNewName;
					stringList.Append(pNewItem);
				}
			}
		}
	}

	CStringTableName *pInsert = stringList.First();
	while (pInsert)
	{
		TreeViewItem* pNewItem = m_wndTreeView.AddItem(pInsert->strName, m_pStringTablesItem);
		pNewItem->GetData()->SetString(ITEM_PATH_NAME, pInsert->strName);
		pInsert = stringList.Next(pInsert);
	}
	stringList.FreeList();

	m_wndTreeView.SortChildren(m_pDialogsItem);
	m_wndTreeView.SortChildren(m_pImagesItem);
	m_wndTreeView.SortChildren(m_pStringTablesItem);

	m_wndTreeView.UnlockWindowUpdate();

	GeShowMouse(MOUSE_NORMAL);
}
Esempio n. 18
0
Bool RegisterMenuTest(void)
{
	// be sure to use a unique ID obtained from www.plugincafe.com
	return RegisterCommandPlugin(1000956, GeLoadString(IDS_MENUTEST), 0, AutoBitmap("icon.tif"), String("C++ SDK Menu Test Plugin"), NewObjClear(MenuTest));
}
Esempio n. 19
0
Bool RegisterPickObjectTool()
{
	return RegisterToolPlugin(ID_SAMPLE_PICK_OBJECT_TOOL, GeLoadString(IDS_PICKOBJECT_SDK), PLUGINFLAG_TOOL_OBJECTHIGHLIGHT, nullptr, GeLoadString(IDS_HELP_PICKOBJECT_SDK), NewObjClear(PickObjectTool));
}
Esempio n. 20
0
Bool RegisterSubDialog(void)
{
	return RegisterCommandPlugin(ID_SUBDIALOGTEST, GeLoadString(IDS_SUBDIALOG), 0, nullptr, String(), NewObjClear(SubDialogTest));
}
Esempio n. 21
0
Bool RegisterPrimitiveTool(void)
{
	return RegisterToolPlugin(ID_LIQUIDTOOL, GeLoadString(IDS_PRIMITIVETOOL), 0, AutoBitmap("liquid.tif"), "C++ SDK Liquid Painting Tool", NewObjClear(LiquidToolData));
}
Esempio n. 22
0
SubDialog* LiquidToolData::AllocSubDialog(BaseContainer* bc)
{
	return NewObjClear(LiquidToolDialog);
}
Esempio n. 23
0
Bool DiffZipFiles(const CDynamicFilenameSet &arFiles, const Filename &fnNew, const Filename &fnDestZip, const char* pchPassword)
{
	AutoAlloc <ZipFile> pOldZip, pNewZip, pDiffZip;
	ZipArray arStrings;
	ZipFileInfo info;
	String strName;
	Bool bExisted;
	Bool bOK = false;
	Int32 l, lCount;
	ZipArrayEntry* pEntry;
	void* pchData = nullptr;
	UInt32 lMaxDataLen = 0;
	ZipWriteInfo writeinfo;
	Bool bAppFolderChanged = false;

	if (!pOldZip || !pNewZip || !pDiffZip)
		return false;

	if (!pNewZip->Open(fnNew, true) || !pDiffZip->Open(fnDestZip, false))
		return false;

	// first, add all files of the new zip file into our array
	if (pNewZip->GoToFirstFile())
	{
		do
		{
			if (!pNewZip->GetCurrentFileInfo(info) ||
					!pNewZip->GetCurrentFileInfo(&strName))
				GOTO_ERROR;

			ZipArrayEntry* pEntry = arStrings.SearchObject(&strName);
			if (!pEntry)
			{
				pEntry = NewObjClear(ZipArrayEntry);
				if (!pEntry)
					GOTO_ERROR;
				pEntry->strName = strName;
				pEntry->bInNew = true;
				pEntry->bInOld = false;
				pEntry->ulCRCNew = info.lCRC32;
				pEntry->lNewSize = info.lUncompressedSize;
				pEntry->bChanged = false;
				pEntry->bInAppFolder = strName.FindFirst(".app/", nullptr);
				arStrings.InsertObject(pEntry, bExisted);
				DebugAssert(!bExisted);
			}
			else
			{
				// exists twice?!
				DebugAssert(false);
			}
		} while (pNewZip->GoToNextFile());
	}

	// browse through the array and check if something has changed
	for (l = 0; l < arFiles.GetElementCount(); l++)
	{
		if (!pOldZip->Open(*arFiles[l], true))
			GOTO_ERROR;
		if (pOldZip->GoToFirstFile())
		{
			do
			{
				if (!pOldZip->GetCurrentFileInfo(info) ||
						!pOldZip->GetCurrentFileInfo(&strName))
					GOTO_ERROR;

				ZipArrayEntry* pEntry = arStrings.SearchObject(&strName);
				if (!pEntry)
				{
					// file has been deleted
					pEntry = NewObjClear(ZipArrayEntry);
					if (!pEntry)
						GOTO_ERROR;
						pEntry->strName = strName;
					pEntry->bInNew = false;
					pEntry->bInOld = true;
					arStrings.InsertObject(pEntry, bExisted);
					DebugAssert(!bExisted);
				}
				else
				{
					// check for size and CRC
					pEntry->bInOld++;
					if ((pEntry->lNewSize != info.lUncompressedSize || pEntry->ulCRCNew != info.lCRC32) && pEntry->bInNew)
					{
						pEntry->bChanged = true;
						if (pEntry->bInAppFolder)
							bAppFolderChanged = true;
					}
				}
			} while (pOldZip->GoToNextFile());
		}
		pOldZip->Close();
	}

	lCount = arFiles.GetElementCount();
	for (l = 0; l < arStrings.GetElementCount(); l++)
	{
		if (arStrings[l]->bInNew)
			// we want to add it - mark as old if it exists in all old archives
			arStrings[l]->bInOld = (arStrings[l]->bInOld == lCount);
		else
			// old if it exists in at least one archive
			arStrings[l]->bInOld = (arStrings[l]->bInOld > 0);
	}

	lCount = arStrings.GetElementCount();
	if (!bAppFolderChanged)
	{
		// check if a new file as been added
		for (l = 0; l < lCount; l++)
		{
			pEntry = arStrings.GetObjectAt(l);
			if (!pEntry)
			{
				DebugAssert(false);
				continue;
			}
			if (pEntry->bInAppFolder && pEntry->bInNew && !pEntry->bInOld)
			{
				bAppFolderChanged = true;
				break;
			}
		}
	}

	for (l = 0; l < lCount; l++)
	{
		pEntry = arStrings.GetObjectAt(l);
		if (!pEntry)
		{
			DebugAssert(false);
			continue;
		}
		if (pEntry->bChanged || (pEntry->bInNew && !pEntry->bInOld) || (bAppFolderChanged && pEntry->bInAppFolder))
		{
			// the file has changed or was added, copy it from the new distri to the diff
			if (!pNewZip->LocateFile(pEntry->strName))
				GOTO_ERROR;
			if (!pNewZip->GetCurrentFileInfo(info))
				GOTO_ERROR;
			if (!pchData || lMaxDataLen < pEntry->lNewSize)
			{
				DeleteMem(pchData);
				pchData = NewMem(UChar, pEntry->lNewSize + 1);
				if (!pchData)
					GOTO_ERROR;
				lMaxDataLen = pEntry->lNewSize;
			}

			if (!pNewZip->OpenCurrentFile(pchPassword))
				GOTO_ERROR;

			if (pNewZip->ReadCurrentFile(pchData, pEntry->lNewSize) != pEntry->lNewSize)
				GOTO_ERROR;

			pNewZip->CloseCurrentFile();

			writeinfo.ti = info.t;
			if (pEntry->strName[pEntry->strName.GetLength() - 1] == '/')
			{
				writeinfo.lExternalAttr = ZIP_FLAG_DIRECTORY;
				writeinfo.lInternalAttr = 0;
				if (!pDiffZip->CreateFileInZip(pEntry->strName, &writeinfo, nullptr, 0, nullptr, 0, nullptr, ZipMethodStore, 0, pchPassword, 0))
					GOTO_ERROR;
				if (!pDiffZip->CloseFileInZip())
					GOTO_ERROR;
			}
			else
			{
				writeinfo.lExternalAttr = info.lExternalAttr;
				writeinfo.lInternalAttr = info.lInternalAttr;
				if (!pDiffZip->CreateFileInZip(pEntry->strName, &writeinfo, nullptr, 0, nullptr, 0, nullptr, ZipMethodDeflate, 9, nullptr, 0))
					GOTO_ERROR;
				if (!pDiffZip->WriteInFileInZip(pchData, pEntry->lNewSize))
					GOTO_ERROR;
				if (!pDiffZip->CloseFileInZip())
					GOTO_ERROR;
			}
		}
		else if (!pEntry->bInNew && pEntry->bInOld)
		{
			if (pEntry->strName[pEntry->strName.GetLength() - 1] == '/')
			{
				writeinfo.lExternalAttr = ZIP_FLAG_DIRECTORY;
				writeinfo.lInternalAttr = 0;
				if (!pDiffZip->CreateFileInZip("----" + pEntry->strName, &writeinfo, nullptr, 0, nullptr, 0, nullptr, ZipMethodStore, 0, pchPassword, 0))
					GOTO_ERROR;
				if (!pDiffZip->CloseFileInZip())
					GOTO_ERROR;
			}
			else
			{
				writeinfo.lExternalAttr = 0;
				writeinfo.lInternalAttr = 0;
				if (!pDiffZip->CreateFileInZip("----" + pEntry->strName, &writeinfo, nullptr, 0, nullptr, 0, nullptr, ZipMethodStore, 9, nullptr, 0))
					GOTO_ERROR;
				if (!pDiffZip->CloseFileInZip())
					GOTO_ERROR;
			}
		}
	}

	bOK = true;
error:
	pOldZip->Close();
	pNewZip->Close();
	pDiffZip->Close();

	arStrings.Free();
	DeleteMem(pchData);
	return bOK;
}
Esempio n. 24
0
	static NodeData* Alloc(void) { return NewObjClear(DropEffector); }
Esempio n. 25
0
	virtual Filename* AllocObject() const { return NewObjClear(Filename); }
Esempio n. 26
0
Filename* CDynamicFilenameSet::GetClone(const Filename* pObj, AliasTrans* pTrans) const
{
	return NewObjClear(Filename, *pObj);
}
Esempio n. 27
0
Bool RegisterSculptGrabBrush()
{
	SculptBrushParams* pParams = SculptBrushParams::Alloc();
	if (!pParams)
		return false;

	//Tell the system that its a grab brush. This means that on mouse down it will grab the selected vertices that are under the brush and
	//then during the entire mouse movement it will only affect those points.
	//If this was set to SCULPTBRUSHMODE_NORMAL then it would select new points every time the brush moves.
	pParams->SetBrushMode(SCULPTBRUSHMODE_GRAB);

	//Hide the pressure value from the HUD when the middle mouse button is pressed or ctrl+shift is held down.
	pParams->EnablePressureHUD(false);

	//This tells the system that the brush is going to be adjusting the points on the layer so it should setup the undo system for points.
	pParams->SetUndoType(SCULPTBRUSHDATATYPE_POINT);

	//Pass in the pointer to the static MovePointsFunc. This will get called for every dab.
	pParams->SetMovePointFunc(&ExampleSculptGrabBrush::MovePointsFunc);

	//Register the tool with Cinema4D.
	return RegisterToolPlugin(SCULPTGRABBRUSH_SDK_EXAMPLE, GeLoadString(IDS_SCULPTGRABBRUSH_TOOL), PLUGINFLAG_TOOL_SCULPTBRUSH | PLUGINFLAG_TOOL_NO_OBJECTOUTLINE, nullptr, GeLoadString(IDS_SCULPTGRABBRUSH_TOOL), NewObjClear(ExampleSculptGrabBrush, pParams));
}
Esempio n. 28
0
Filename* CDynamicFilenameSet::AllocObject() const
{
	return NewObjClear(Filename);
}
Esempio n. 29
0
Bool RegisterMemoryStat(void)
{
	return RegisterCommandPlugin(ID_MEMSTAT, String("C++ SDK - Memory Statistics"), 0, nullptr, String(), NewObjClear(MemStatCommand));
}
Bool RegisterPaintBrushSculpt()
{
	SculptBrushParams *pParams = SculptBrushParams::Alloc();
	if (!pParams) return false;

	pParams->EnableInvertCheckbox(true);
	pParams->EnableBrushAccess(true);
	pParams->SetUndoType(SCULPTBRUSHDATATYPE_POINT);
	pParams->SetMovePointFunc(&SculptMovePointsFunc);

	String name = GeLoadString(IDS_PAINT_BRUSH_SCULPT); if (!name.Content()) return true;
	return RegisterToolPlugin(ID_PAINT_BRUSH_SCULPT, name, PLUGINFLAG_TOOL_SCULPTBRUSH|PLUGINFLAG_TOOL_NO_OBJECTOUTLINE, nullptr, GeLoadString(IDS_PAINT_BRUSH_SCULPT_HELP), NewObjClear(PaintBrushSculpt, pParams));
}