Bool ApplinkImporter::CreateChannelNormal(long i, BaseMaterial* mat)
{
	if(this->matArray[i].norm_map != "")
	{
		BaseChannel *color = mat->GetChannel(CHANNEL_NORMAL);
		if (!color)	return false;

		GeData b;
		mat->GetParameter(DescID(MATERIAL_USE_NORMAL), b, DESCFLAGS_GET_0);
		if(!b.GetBool()) mat->SetParameter(DescID(MATERIAL_USE_NORMAL), true, DESCFLAGS_SET_0);

		mat->SetParameter(DescID(MATERIAL_NORMAL_REVERSEY), true, DESCFLAGS_SET_0);

		BaseContainer cdata = color->GetData();
		if (this->matArray[i].useTextures)
		{
			//GePrint ("Material Use texture: " + this->matArray[i].map_Kd);
			cdata.SetString(BASECHANNEL_TEXTURE, this->matArray[i].norm_map);
			cdata.SetFilename(BASECHANNEL_SUGGESTEDFOLDER, this->pSet.tempPath);
		}
		color->SetData(cdata);
	}
	
	return true;
}
Beispiel #2
0
Bool ColorBox::InputEvent(const BaseContainer &msg)
{
	if(msg.GetInt32(BFM_INPUT_DEVICE) == BFM_INPUT_MOUSE){
		if(msg.GetInt32(BFM_INPUT_CHANNEL) == BFM_INPUT_MOUSELEFT){
			m_mouseX = msg.GetInt32(BFM_INPUT_X);
			m_mouseY = msg.GetInt32(BFM_INPUT_Y);
			m_mouseDown = TRUE;
			Global2Local(&m_mouseX, &m_mouseY);
			MouseDragStart(BFM_INPUT_MOUSELEFT,m_mouseX, m_mouseY,MOUSEDRAGFLAGS_0);
			MouseUpdate();
		}
	}
	Float x, y;
	BaseContainer channels;
	while (MouseDrag(&x, &y, &channels) == MOUSEDRAGRESULT_CONTINUE)
	{
		m_mouseX -= x;
		m_mouseY -= y;
		//Global2Local(&m_mouseX, &m_mouseY);
		MouseUpdate();
	}
	BaseContainer res;
	if(GetInputState(BFM_INPUT_MOUSE,BFM_INPUT_MOUSELEFT,res) && res.GetInt32(BFM_INPUT_VALUE) == 0){
		if(m_mouseDown){
			MouseDragEnd();
			m_mouseDown = FALSE;
		}
	}

	return FALSE;
}
void DropEffector::InitPoints(BaseObject* op, BaseObject* gen, BaseDocument* doc, EffectorDataStruct* data, MoData* md, BaseThread* thread)
{
	BaseContainer* bc = op->GetDataInstance();
	if (!bc)
		return;

	if (!rcol)
		return;

	ed.mode = bc->GetInt32(DROPEFFECTOR_MODE);
	ed.maxdist = bc->GetFloat(DROPEFFECTOR_DISTANCE);
	ed.target	 = bc->GetObjectLink(DROPEFFECTOR_TARGET, doc);
	if (!ed.target)
		return;

	ed.targmg	 = ed.target->GetMg();
	ed.itargmg = ~ed.targmg;
	ed.genmg	= gen->GetMg();
	ed.igenmg = ~ed.genmg;

	//Add a dependency so that the effector will update if the target changes
	AddEffectorDependence(ed.target);

	//Can't init raycollider or the target isn't polygonal, then skip
	if (!rcol->Init(ed.target))
		ed.target = nullptr;
	else if (!ed.target->IsInstanceOf(Opolygon))
		ed.target = nullptr;
}
Beispiel #4
0
Bool SDKGradientClass::Init(GeListNode *node)
{
	BaseContainer *data = ((BaseShader*)node)->GetDataInstance();

	AutoAlloc<Gradient> gradient;
	if (!gradient) return FALSE;

	GradientKnot k1,k2;
	k1.col =Vector(0.0,0.0,1.0);
	k1.pos =0.0;

	k2.col =1.0;
	k2.pos =1.0;

	gradient->InsertKnot(k1);
	gradient->InsertKnot(k2);

	data->SetData(SDKGRADIENTSHADER_COLOR,GeData(CUSTOMDATATYPE_GRADIENT,gradient));
	data->SetBool(SDKGRADIENTSHADER_CYCLE,FALSE);
	data->SetLong(SDKGRADIENTSHADER_MODE,0);
	data->SetReal(SDKGRADIENTSHADER_ANGLE,0.0);

	data->SetReal(SDKGRADIENTSHADER_TURBULENCE,0.0);
	data->SetReal(SDKGRADIENTSHADER_OCTAVES,5.0);
	data->SetReal(SDKGRADIENTSHADER_SCALE,1.0);
	data->SetReal(SDKGRADIENTSHADER_FREQ,1.0);
	data->SetBool(SDKGRADIENTSHADER_ABSOLUTE,FALSE);
	
	return TRUE;
}
Beispiel #5
0
/// ***************************************************************************
/// ***************************************************************************
Bool RegisterContainerObject(Bool menu)
{
  if (menu) {
    BaseContainer* menu = nullptr;
    FindMenuResource("M_EDITOR", "IDS_MENU_OBJECT", &menu);
    if (menu) {
      menu->InsData(MENURESOURCE_SEPERATOR, true);
      menu->InsData(MENURESOURCE_COMMAND, "PLUGIN_CMD_" + LongToString(Ocontainer));
    }
    return true;
  }

  _orig_GetInfo = C4DOS.Bo->GetInfo;
  C4DOS.Bo->GetInfo = _hook_GetInfo;

  AutoAlloc<BaseBitmap> bmp;
  bmp->Init(GeGetPluginPath() + "res" + "img" + "ocontainer.png");

  return RegisterObjectPlugin(
    Ocontainer,
    GeLoadString(IDS_OCONTAINER),
    OBJECT_GENERATOR,
    ContainerObject::Alloc,
    "Ocontainer",
    bmp,
    CONTAINEROBJECT_DISKLEVEL);
}
Beispiel #6
0
INITRENDERRESULT SDKGradientClass::InitRender(BaseShader *sh, const InitRenderStruct &irs)
{
	BaseContainer *dat = sh->GetDataInstance();

	gdata.mode			 = dat->GetLong(SDKGRADIENTSHADER_MODE); 
	gdata.angle			 = dat->GetReal(SDKGRADIENTSHADER_ANGLE); 
	gdata.cycle			 = dat->GetBool(SDKGRADIENTSHADER_CYCLE);
	gdata.turbulence = dat->GetReal(SDKGRADIENTSHADER_TURBULENCE);
	gdata.octaves    = dat->GetReal(SDKGRADIENTSHADER_OCTAVES);
	gdata.scale      = dat->GetReal(SDKGRADIENTSHADER_SCALE);
	gdata.freq       = dat->GetReal(SDKGRADIENTSHADER_FREQ);
	gdata.absolute   = dat->GetBool(SDKGRADIENTSHADER_ABSOLUTE);
	gdata.gradient	 = (Gradient*)dat->GetCustomDataType(SDKGRADIENTSHADER_COLOR,CUSTOMDATATYPE_GRADIENT); 
	if (!gdata.gradient || !gdata.gradient->InitRender(irs)) return INITRENDERRESULT_OUTOFMEMORY;

	gdata.sa=Sin(gdata.angle);
	gdata.ca=Cos(gdata.angle);

	LONG i;
	GradientKnot *k;

	for (i=0; i<4; i++)
	{
		gdata.c[i]=0.0;
		k = gdata.gradient->GetRenderKnot(i); 
		if (k) gdata.c[i]=k->col; 
	}

	return INITRENDERRESULT_OK;
}
Beispiel #7
0
/*********************************************************************\
	Function name    : TreeView::AddItem
	Description      :
	Created at       : 15.08.01, @ 09:39:49
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
TreeViewItem* TreeView::AddItem(String strName, Int32 lType, TreeViewItem* pParent)
{
	BaseContainer bc;
	bc.SetString(TREEVIEW_TEXT, strName);
	bc.SetInt32(TREEVIEW_ICON, lType);
	return AddItem(bc, pParent);
}
/*********************************************************************\
	Function name    : CCustomSubDialog::InitValues
	Description      :
	Created at       : 27.03.02, @ 12:07:33
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
Bool CCustomSubDialog::InitValues(void)
{
    Int32 lID = FIRST_CUSTOM_ELEMENT_ID;
    Int32 i;

    CCustomElements* pElement = g_pCustomElements->GetItem(m_pElement->m_lElement);
    if (!pElement) return true;

    if (!m_pElement->m_pbcGUI) return true;
    BaseContainer* pBC = &m_pElement->m_pbcGUI[m_pElement->m_lElement];

    SetBool(IDC_CUSTOM_OPEN_CLOSE, pElement->m_bIsOpen);

    for (i = 0; m_pProp && m_pProp[i].type != CUSTOMTYPE_END; i++, lID++)
    {
        CustomProperty* pProp = &pElement->m_pProp[i];

        if (pProp->type == CUSTOMTYPE_FLAG) SetBool(lID, pBC, pProp->id);
        else if (pProp->type == CUSTOMTYPE_LONG) SetInt32(lID, pBC, pProp->id);
        else if (pProp->type == CUSTOMTYPE_REAL) SetFloat(lID, pBC, pProp->id);
        else if (pProp->type == CUSTOMTYPE_STRING) SetString(lID, pBC, pProp->id);
        else if (pProp->type == CUSTOMTYPE_VECTOR)
        {
            Vector v = pBC->GetVector(pProp->id);
            SetFloat(lID++,v.x);
            SetFloat(lID++,v.y);
            SetFloat(lID,v.z);
        }
    }

    return true;
}
Beispiel #9
0
		virtual void InsertObject(void *root,void *userdata,void *obj,Int32 dragtype,void *dragobject,Int32 insertmode, Bool bCopy)
		{
			TreeView* pTree = (TreeView*)userdata;

			if (dragtype == DRAGTYPE_FILES)
			{
				Filename* fn = (Filename*)dragobject;
				if (!fn) return;
				((CTreeDialog*)pTree->m_pParent)->OpenDialog(*fn);
			}

			if (dragtype == pTree->m_lElementType)
			{
				TreeViewItem* pDragItem = (TreeViewItem*)dragobject;
				TreeViewItem* pDestItem = (TreeViewItem*)obj;

				if (bCopy)
				{
					if (!pDragItem || !pDestItem) return;

					CTreeDialog* pDlg = (CTreeDialog*)pTree->m_pParent;
					if (!pDlg) return;
					CDialogDoc* pDoc = pDlg->GetDocument();
					if (!pDoc) return;

					CDialogItem* pDlgItemDrag = (CDialogItem*)pDragItem->GetData()->GetVoid(TREEVIEW_DATA);
					CDialogItem* pDlgItemDrop = (CDialogItem*)pDestItem->GetData()->GetVoid(TREEVIEW_DATA);
					if (!pDlgItemDrag || !pDlgItemDrop) return;

					pDoc->ExportMacro(GeGetPluginPath() + String("DragDrop.dmf"), pDlgItemDrag);
					CDialogItem* pNewItem = pDoc->ImportMacro(GeGetPluginPath() + String("DragDrop.dmf"), pDlgItemDrop);
					GeFKill(GeGetPluginPath() + String("DragDrop.dmf"));

					if (pNewItem)
					{
						TreeViewItem* pNewTreeItem = pNewItem->m_pTreeViewItem;
						switch (insertmode)
						{
							case INSERT_BEFORE: pNewTreeItem->ChangeParent(pDestItem->GetParent(), pDestItem, nullptr); break;
							case INSERT_UNDER:  pNewTreeItem->ChangeParent(pDestItem, nullptr, nullptr); Open(root, userdata, obj, true); break;
							default:            pNewTreeItem->ChangeParent(pDestItem->GetParent(), nullptr, pDestItem); break;
						}
						Select(root, userdata, pNewTreeItem, SELECTION_NEW);
					}
				}
				else
				{
					switch (insertmode)
					{
						case INSERT_BEFORE: pDragItem->ChangeParent(pDestItem->GetParent(), pDestItem, nullptr); break;
						case INSERT_UNDER:  pDragItem->ChangeParent(pDestItem, nullptr, nullptr); Open(root, userdata, obj, true); break;
						default:            pDragItem->ChangeParent(pDestItem->GetParent(), nullptr, pDestItem); break;
					}
				}
				BaseContainer bc;
				bc.SetInt32(TREEVIEW_MESSAGE_TYPE, TREEVIEW_STRUCTURE_CHANGE);
				pTree->m_pParent->Command(pTree->m_lTreeID, bc);
				pTree->m_pTree->Refresh();
			}
		}
/*********************************************************************\
	Function name    : CDialogCustomElement::CreateElementBegin
	Description      :
	Created at       : 27.03.02, @ 11:22:38
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CDialogCustomElement::CreateElementBegin(Int32 lID, GeDialog *pDlg)
{
    if (!m_pbcGUI) return;

    if (g_pCustomElements && m_lElement >= 0 && m_lElement < g_pCustomElements->Entries())
    {
        CCustomElements* pElement = g_pCustomElements->GetItem(m_lElement);

        if (pElement)
        {
            BaseContainer bc = m_pbcGUI[m_lElement];
            for (Int32 i = 0; pElement->m_pProp && pElement->m_pProp[i].type != CUSTOMTYPE_END; i++)
            {
                if (pElement->m_pProp[i].type == CUSTOMTYPE_STRING)
                {
                    String str = m_pbcGUI[m_lElement].GetString(pElement->m_pProp[i].id);
                    if (str.Content())
                    {
                        Bool b;
                        String str1 = m_pDocument->GetString(str, b);
                        if (!b) str1 = "[" + str + "]";
                        bc.SetString(pElement->m_pProp[i].id, str1);
                    }
                }
            }
            pDlg->AddCustomGui(lID, pElement->m_lID, m_strName, m_lFlags, CONVERT_WIDTH(m_lInitW), CONVERT_HEIGHT(m_lInitH), bc);
            //BaseCustomGuiLib* pGUI = (BaseCustomGuiLib*)pDlg->FindCustomGui(lID, pElement->m_lID);
            //if (pGUI) pGUI->SetDefaultForResEdit();
        }
    }
}
Beispiel #11
0
Bool PaletteSubDialog::CoreMessage(Int32 id, const BaseContainer& msg)
{
    switch ( id )
    {
      case  PALETTE_ID:
			Int64 color =  (Int64) msg.GetVoid( BFM_CORE_PAR1 );
			Int64 palette = (Int64) msg.GetVoid( BFM_CORE_PAR2 );
            if( palette == -1){
                BaseContainer *bc = GetActiveDocument()->BaseList2D::GetDataInstance()->GetContainerInstance(PALETTE_SCENE_HOOK_ID)->GetContainerInstance(m_id);
                if(bc != nullptr){
                    FromContainer(*bc);
                } else {
                    BaseContainer tmp;
                    m_paletteID = 0;
                    m_rows = 1;
                    m_layout = 0;
                    m_searchString = "";
                    m_showLabel = FALSE;
                    ToContainer(tmp);
                    GetActiveDocument()->BaseList2D::GetDataInstance()->GetContainerInstance(PALETTE_SCENE_HOOK_ID)->SetContainer(m_id,tmp);
                    FromContainer(tmp);
                }
            }
			if((palette == m_paletteID || palette == -1) && color == -1){
				LoadPalette(m_paletteID);
			}
        break;
    }
    return GeDialog::CoreMessage( id, msg );
}
Bool ApplinkImporter::CreateChannelSpecular(long i, BaseMaterial* mat)
{
	if(this->matArray[i].map_Ks != "")
	{
		BaseChannel *color = mat->GetChannel(CHANNEL_SPECULARCOLOR);
		if (!color) return false;

		GeData b;
		mat->GetParameter(DescID(MATERIAL_USE_SPECULARCOLOR), b, DESCFLAGS_GET_0);
		if(!b.GetBool()) mat->SetParameter(DescID(MATERIAL_USE_SPECULARCOLOR), true, DESCFLAGS_SET_0);
		BaseContainer cdata = color->GetData();
		cdata.SetVector(BASECHANNEL_COLOR_EX, this->matArray[i].Ks);

		cdata.SetData(BAKE_TEX_NORMAL_FLIP_Y, GeData(true));

		if (this->matArray[i].useTextures)
		{
			//GePrint ("Material Use texture: " + this->matArray[i].map_Kd);
			cdata.SetString(BASECHANNEL_TEXTURE, this->matArray[i].map_Ks);
			cdata.SetFilename(BASECHANNEL_SUGGESTEDFOLDER, this->pSet.tempPath);
		}
		color->SetData(cdata);
	}
	
	return true;
}
Bool ApplinkImporter::CreateChannelDisplacement(long i, BaseMaterial* mat)
{
	if(this->matArray[i].disp_map != "")
	{
		BaseChannel *color = mat->GetChannel(CHANNEL_DISPLACEMENT);
		if (!color)	return false;
		
		GeData b;
		mat->GetParameter(DescID(MATERIAL_USE_DISPLACEMENT), b, DESCFLAGS_GET_0);
		if(!b.GetBool())	mat->SetParameter(DescID(MATERIAL_USE_DISPLACEMENT), true, DESCFLAGS_SET_0);
		BaseContainer cdata = color->GetData();
		//GePrint("disp: " + RealToString(this->matArray[i].disp_k));
		mat->SetParameter(DescID(MATERIAL_DISPLACEMENT_STRENGTH), this->matArray[i].disp_k/100, DESCFLAGS_SET_0);

		if (this->matArray[i].useTextures)
		{
			//GePrint ("Material Use texture: " + this->matArray[i].map_Kd);
			cdata.SetString(BASECHANNEL_TEXTURE, this->matArray[i].disp_map);
			cdata.SetFilename(BASECHANNEL_SUGGESTEDFOLDER, this->pSet.tempPath);
		}
		color->SetData(cdata);
	}
	
	return true;
}
Beispiel #14
0
QStringList ContainerAreaLayout::listItems() const
{
    QStringList items;
    for (ItemList::const_iterator it = m_items.constBegin();
         it != m_items.constEnd(); ++it)
    {
        QLayoutItem* item = (*it)->item;
        BaseContainer* container = dynamic_cast<BaseContainer*>(item->widget());

        if (!container)
        {
            continue;
        }

        AppletContainer* applet = dynamic_cast<AppletContainer*>(container);
        if (applet)
        {
            items.append(applet->info().desktopFile());
        }
        else
        {
            // button containers don't give us anything useful that isn't
            // i18n'd (e.g. all service buttons and url buttons simply report
            // "URL" as their tileName()) which would require that we
            // extend PanelButton to be more expressive to get something more
            // instead i just cop'd out and use the visible name. good enough.
            items.append(container->visibleName());
        }
    }

    return items;
}
Beispiel #15
0
/*********************************************************************\
	Function name    : CCompareTableDialog::SaveResult
	Description      :
	Created at       : 10.10.01, @ 22:16:07
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CCompareTableDialog::SaveResult()
{
	Filename fn;
	if (!fn.FileSelect(FILESELECTTYPE_ANYTHING, FILESELECT_SAVE, String())) return;

	Int32 lMaxLen = 0;

	Int32 a, lNumItems;
	lNumItems = m_wndOutputList.GetItemCount();

	for (a = 0; a < lNumItems; a++)
	{
		BaseContainer data;
		m_wndOutputList.GetItem(a, &data);
		lMaxLen = LMax(lMaxLen, data.GetString(COMPARE_LIST_NAME).GetLength());
	}
	lMaxLen += 2;

	AutoAlloc <BaseFile> pFile;
	if (!pFile)
		return;

	pFile->Open(fn, FILEOPEN_WRITE);
	for (a = 0; a < lNumItems; a++)
	{
		BaseContainer data;
		m_wndOutputList.GetItem(a, &data);
		String str = data.GetString(COMPARE_LIST_NAME);
		WriteString(pFile, str);
		Int32 b = lMaxLen - str.GetLength();
		while (b--) WriteString(pFile, " ");
		WriteString(pFile, data.GetString(COMPARE_LIST_DATA));
		LineBreak(pFile, "");
	}
}
Beispiel #16
0
void ContainerAreaLayoutItem::setFreeSpaceRatio(double ratio)
{
    BaseContainer* container = dynamic_cast<BaseContainer*>(item->widget());
    if (container)
        container->setFreeSpace(ratio);
    else
        m_freeSpaceRatio = ratio;
}
Beispiel #17
0
double ContainerAreaLayoutItem::freeSpaceRatio() const
{
    BaseContainer* container = dynamic_cast<BaseContainer*>(item->widget());
    if (container)
        return kClamp(container->freeSpace(), 0.0, 1.0);
    else
        return m_freeSpaceRatio;
}
Beispiel #18
0
Bool PickObjectTool::MouseInput(BaseDocument* doc, BaseContainer& data, BaseDraw* bd, EditorWindow* win, const BaseContainer& msg)
{
	Int32						mode = data.GetInt32(MDATA_PICKOBJECT_MODE);
	Int32						x, y, l, xr = 0, yr = 0, wr = 0, hr = 0;
	Matrix4d				m;
	ViewportPixel** pix = nullptr;
	String					str;
	char ch[200];
	Bool ret = false;
	AutoAlloc<C4DObjectList> list;
	if (!list)
		return false;

	VIEWPORT_PICK_FLAGS flags = VIEWPORT_PICK_FLAGS_ALLOW_OGL | VIEWPORT_PICK_FLAGS_USE_SEL_FILTER;
	if (data.GetBool(MDATA_PICKOBJECT_ONLY_VISIBLE))
		flags |= VIEWPORT_PICK_FLAGS_OGL_ONLY_VISIBLE;
	x = msg.GetInt32(BFM_INPUT_X);
	y = msg.GetInt32(BFM_INPUT_Y);
	Float64 timer = 0.0;
	if (mode == MDATA_PICKOBJECT_MODE_CIRCLE)
	{
		Int32 rad = data.GetInt32(MDATA_PICKOBJECT_CIRCLE_RAD);
		timer = GeGetMilliSeconds();
		ret = ViewportSelect::PickObject(bd, doc, x, y, rad, xr, yr, wr, hr, pix, flags, nullptr, list, &m);
		timer = GeGetMilliSeconds() - timer;
	}
	else if (mode == MDATA_PICKOBJECT_MODE_RECTANGLE)
	{
		Int32 width	 = data.GetInt32(MDATA_PICKOBJECT_RECT_W);
		Int32 height = data.GetInt32(MDATA_PICKOBJECT_RECT_H);
		x -= width / 2;
		y -= height / 2;
		timer = GeGetMilliSeconds();
		ret = ViewportSelect::PickObject(bd, doc, x, y, x + width, y + height, xr, yr, wr, hr, pix, flags, nullptr, list, &m);
		timer = GeGetMilliSeconds() - timer;
	}
	if (ret)
	{
		sprintf(ch, "Picking region from (%d, %d), size (%d, %d)|", xr, yr, wr, hr);
		str += ch;
		for (l = 0; l < list->GetCount(); l++)
		{
			sprintf(ch, ", z = %.4f|", list->GetZ(l));
			str += "Found Object " + list->GetObject(l)->GetName() + ch;
		}
	}
	else
	{
		str	= "PickObject failed";
	}
	sprintf(ch, "|Time: %.2f us", float(timer) * 1000.0f);
	str += ch;

	DeleteMem(pix);
	GeOutString(str, GEMB_OK);

	return true;
}
Beispiel #19
0
Bool LiquidToolData::GetCursorInfo(BaseDocument* doc, BaseContainer& data, BaseDraw* bd, Float x, Float y, BaseContainer& bc)
{
	if (bc.GetId() == BFM_CURSORINFO_REMOVE)
		return true;

	bc.SetString(RESULT_BUBBLEHELP, GeLoadString(IDS_PRIMITIVETOOL));
	bc.SetInt32(RESULT_CURSOR, MOUSE_POINT_HAND);
	return true;
}
Beispiel #20
0
Bool AtomObject::Message(GeListNode *node, LONG type, void *t_data)
{
	if (type==MSG_DESCRIPTION_VALIDATE)
	{
		BaseContainer *data = ((BaseObject*)node)->GetDataInstance();
		CutReal(*data,ATOMOBJECT_CRAD,0.0,data->GetReal(ATOMOBJECT_SRAD));
	}
	return TRUE;
}
Beispiel #21
0
/*********************************************************************\
	Function name    : CResEditBrowser::Message
	Description      :
	Created at       : 21.10.01, @ 17:23:02
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
Int32 CResEditBrowser::Message(const BaseContainer &msg, BaseContainer &result)
{
	if (msg.GetId() == BFM_GETCURSORINFO && m_dirText.Content()) {
		result.SetId(msg.GetId());
		result.SetString(RESULT_BUBBLEHELP, "<b>Selected:</b> " + m_dirText.GetString());
		return true;
	}
	return GeDialog::Message(msg, result);
}
Beispiel #22
0
void PaletteSubDialog::ToContainer(BaseContainer &bc)
{
    Int32 i=0;
    bc.SetBool(++i, m_showLabel);
    bc.SetInt32(++i, m_rows);
    bc.SetInt32(++i, m_layout);
    bc.SetString(++i, m_searchString);
    bc.SetInt32(++i, m_paletteID);
}
Bool BitmapData::Message(GeListNode *node, LONG type, void *msgdat)
{
	BaseContainer *data = ((BaseShader*)node)->GetDataInstance();

	HandleInitialChannel(node,BITMAPDISTORTIONSHADER_TEXTURE,type,msgdat);
	HandleShaderMessage(node,(BaseShader*)data->GetLink(BITMAPDISTORTIONSHADER_TEXTURE,node->GetDocument(),Xbase),type,msgdat);

	return TRUE;
}
Beispiel #24
0
Bool VoxelGenerator::Init(GeListNode* node)
{
	BaseObject*		 op = (BaseObject*)node;
	BaseContainer* data = op->GetDataInstance();
	
	data->SetFloat(VGEN_SCALE, 0.95);
	data->SetFloat(VGEN_THRESHOLD,0.01);
	return true;
}
/*********************************************************************\
	Function name    : CCustomElementSettings::SetData
	Description      :
	Created at       : 11.08.01, @ 23:18:59
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CCustomElementSettings::SetData()
{
    _Init();

    CreateElementList();

    // fill the list view with the elements
    Int32 a = 0;
    while (m_wndListView.RemoveItem(a)) {
        a++;
    }


    if (!g_pCustomElements) return;
    Int32 lElementCount = g_pCustomElements->Entries();
    if (lElementCount == 0) return;

    CCustomElements* pFirst = g_pCustomElements->First();
    a = 0;

    while (pFirst)
    {
        BaseContainer data;
        data.SetString('name', pFirst->m_strName);
        data.SetString('resy', pFirst->m_pChResSym);
        data.SetString('ceid', String::IntToString(pFirst->m_lID));

        m_wndListView.SetItem(a, data);
        a++;
        pFirst = g_pCustomElements->Next(pFirst);
    }

    m_wndListView.DataChanged();

    AutoAlloc<BaseSelect> pSel;
    if (pSel)
    {
        pSel->Select(m_pElement->m_lElement);
        m_lLastID = -1;
        m_wndListView.SetSelection(pSel);
        m_wndListView.DataChanged();
    }

    // write the custom object properties
    if (g_pCustomElements && m_pElement->m_lElement >= 0 && m_pElement->m_lElement < g_pCustomElements->Entries())
    {
        CCustomElements* pElement = g_pCustomElements->GetItem(m_pElement->m_lElement);
        BasePlugin* pPlug = nullptr;
        if (pElement) pPlug = pElement->m_pPlug;
        if (pPlug)
        {
            CustomProperty *prop = CallCustomGuiCmd(pPlug, GetProperties)();
            m_wndSubDlg.Refresh(m_pSettingsDialog, prop, m_pElement);
        }
    }
}
/*********************************************************************\
	Function name    : CCustomElementSettings::Init
	Description      :
	Created at       : 27.03.02, @ 10:35:40
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CCustomElementSettings::Init()
{
    m_wndListView.AttachListView(m_pSettingsDialog, IDC_CUSTOM_GUI_LIST);

    BaseContainer bc;
    bc.SetInt32('name', LV_COLUMN_TEXT);
    bc.SetInt32('resy', LV_COLUMN_TEXT);
    bc.SetInt32('ceid', LV_COLUMN_TEXT);
    m_wndListView.SetLayout(3, bc);
}
Beispiel #27
0
		virtual Bool DoubleClick(void *root,void *userdata,void *obj,Int32 col,MouseInfo *mouseinfo)
		{
			TreeView* pTree = (TreeView*)userdata;

			BaseContainer bc;
			bc.SetInt32(TREEVIEW_MESSAGE_TYPE, TREEVIEW_DOUBLECLICK);
			bc.SetVoid(TREEVIEW_MESSAGE_ITEM, obj);
			return pTree->m_pParent->Command(pTree->m_lTreeID, bc);
			//return false;
		}
Beispiel #28
0
void PaletteSubDialog::UpdatePopup(Int32 current)
{
    BaseContainer bc;
    bc.SetString(ACTION_LOAD, "Load palette");
    bc.SetString(ACTION_NEW,  "New palette");
    bc.SetString(ACTION_SAVE, "Save palette");
    bc.InsData(0, String(""));
    if(m_showControls){
        bc.SetString(ACTION_LABEL, "Show controls&c&");
    }else{
        bc.SetString(ACTION_LABEL, "Show controls");
    }
    bc.InsData(0, String(""));
    GeDynamicArray<Palette> pals;
    Palette::GetPalettes(pals);
    for(Int32 i=0;i<pals.GetCount();i++){
        String str;
        if(i==current){
            str = "&c&";
        }
        bc.SetString(ACTION_COUNT+i,pals[i].m_name+str);
    }
    SetPopup(m_actionPopup,bc);

}
Beispiel #29
0
Bool Objectify::Init(GeListNode *node)
{
    BaseObject    *op   = (BaseObject*)node;
    BaseContainer *data = op->GetDataInstance();
    
    data->SetReal(TRIANGULATION_MAX_SEARCH_RADIUS,30.);

    GePrint("Objectify by http://twitter.com/eight_io for Cinema 4D r14");
    prevFrame = 0;
    return TRUE;
}
Beispiel #30
0
Bool Voxelify::Init(GeListNode *node)
{
	BaseObject		*op   = (BaseObject*)node;
	BaseContainer *data = op->GetDataInstance();
    
	//data->SetReal(CTTSPOBJECT_MAXSEG,1000.);
	//data->SetReal(CTTSPOBJECT_MINSEG,0.1);
    data->SetLong(SPLINEOBJECT_INTERPOLATION,SPLINEOBJECT_INTERPOLATION_ADAPTIVE);
    GePrint("Voxelify by http://twitter.com/eight_io for Cinema 4D r14");
    
    return TRUE;
}