Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Dissapearing buttons in Custom Render Dialog Tab Rollouts...

Dissapearing buttons in Custom Render Dialog Tab Rollouts...

Anonymous
Not applicable
268 Views
1 Reply
Message 1 of 2

Dissapearing buttons in Custom Render Dialog Tab Rollouts...

Anonymous
Not applicable
Hello,
I am making the Renderer plugin and got this strange problem with dissapering UI elements:

1. I removed unused Tabs like Render Elements and Advanced Lighting.
2. I added my Custom tab called ex. "My Renderer"
3. I added a rollout to the tab.
4. I added a button to the rollout.
5. After assigning my renderer, the "My Renderer" tab and rollout appears but there is no button.
The button apperas if I close an re-open rollout, but after a while it dissappears again.

What is the problem?

I'm giving some code below:


// RENDERER CLASS
class plug_05_Renderer : public Renderer, public ITabDialogObject
{
public:
plug_05_Renderer();
~plug_05_Renderer();

virtual int Open(INode*, INode*, ViewParams*, RendParams&, HWND, DefaultLight*, int, RendProgressCallback*);
virtual int Render(TimeValue, Bitmap*, FrameRendParams&, HWND, RendProgressCallback*, ViewParams*);
virtual void Close(HWND, RendProgressCallback*);

virtual ReferenceTarget* Clone(RemapDir&);
virtual RendParamDlg* CreateParamDialog(IRendParams*, BOOL);
virtual RefResult NotifyRefChanged(Interval, RefTargetHandle, PartID&, RefMessage);
virtual void ResetParams();

BaseInterface* GetInterface ( Interface_ID );
virtual void AddTabToDialog ( ITabbedDialog* , ITabDialogPluginTab* );
virtual int AcceptTab ( ITabDialogPluginTab* );

virtual Class_ID ClassID();
virtual void GetClassName( TSTR& );
};

plug_05_Renderer :: plug_05_Renderer() { }
plug_05_Renderer :: ~plug_05_Renderer() { }

int plug_05_Renderer :: Open (INode *scene, INode *vnode, ViewParams *viewPar, RendParams &rp, HWND hwnd, DefaultLight *defaultLights=NULL, int numDefLights=0, RendProgressCallback *prog=NULL)
{
return 1;
}

int plug_05_Renderer :: Render (TimeValue t, Bitmap *tobm, FrameRendParams &frp, HWND hwnd, RendProgressCallback *prog=NULL, ViewParams *viewPar=NULL)
{
int nExitStatus = 1;

return nExitStatus;
}

void plug_05_Renderer :: Close (HWND hwnd, RendProgressCallback *prog=NULL)
{
}

ReferenceTarget* plug_05_Renderer :: Clone(RemapDir &remap)
{
ReferenceTarget* result = new plug_05_Renderer();
BaseClone(this, result, remap);
return result;
}

RendParamDlg* plug_05_Renderer :: CreateParamDialog(IRendParams *ir, BOOL prog=FALSE)
{
return new plug_05_RendParamDlg( ir, prog );
}

RefResult plug_05_Renderer :: NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message)
{
return REF_DONTCARE;
}

void plug_05_Renderer :: ResetParams() { }

BaseInterface* plug_05_Renderer :: GetInterface ( Interface_ID id )
{
if ( id == TAB_DIALOG_OBJECT_INTERFACE_ID )
{
ITabDialogObject* r = this;
return r;
}
else
{
return Renderer :: GetInterface ( id );
}
}

void plug_05_Renderer :: AddTabToDialog ( ITabbedDialog* dialog, ITabDialogPluginTab* tab )
{
dialog->AddRollout( GetString( hDllInstance, IDS_TABNAME ), NULL, kTabClassID, tab, -1, 0, 0, 0, ITabbedDialog::kNormalPage, -1 );
}

int plug_05_Renderer :: AcceptTab ( ITabDialogPluginTab* tab )
{
Class_ID blurRaytrace ( 0x4fa95e9b, 0x9a26e66 );

switch ( tab->GetSuperClassID ( ) )
{
case RADIOSITY_CLASS_ID:
return 0; // Don't show the advanced lighting tab
}

Class_ID id = tab->GetClassID ( );

if ( id == blurRaytrace )
return 0; // Don't show the blur raytracer tab

// Accept all other tabs
return TAB_DIALOG_ADD_TAB;
}

Class_ID plug_05_Renderer :: ClassID()
{
return PLUG_05_CLASS_ID;
}

void plug_05_Renderer :: GetClassName(TSTR& s)
{
s = GetString( hDllInstance, IDS_CLASSNAME );
}

// REND PARAM DIALOG CLASS

class plug_05_RendParamDlg : public RendParamDlg
{
public:
IRendParams* ir;

HWND hRoll_01, hRoll_02, hRoll_03;

plug_05_RendParamDlg( IRendParams*, BOOL );
~plug_05_RendParamDlg();

virtual void AcceptParams();
virtual void RejectParams();
virtual void DeleteThis();
};

plug_05_RendParamDlg :: plug_05_RendParamDlg( IRendParams *_ir, BOOL _prog )
{
this->ir = _ir;

if ( !_prog )
{
_ir->AddTabRollupPage( kTabClassID, hDllInstance, MAKEINTRESOURCE( IDD_ROLL_01 ), RendParamsDlg_Proc, GetString( hDllInstance, IDS_ROLL_01_NAME ), (LPARAM)this, 0, ROLLUP_CAT_STANDARD );

}
}





Thanks for any advices...!
0 Likes
269 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Ok, I have found the solution,
I left the INT_PTR CALLBACK RendParamsDlg_Proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
empty because I didn't make any controls yet and that was the error,
it should be implemented at least in the minimum:


static INT_PTR CALLBACK RendParamsDlg_Proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch ( msg )
{
case WM_INITDIALOG:
break;

case WM_DESTROY:
break;

case WM_COMMAND:
break;

case WM_LBUTTONDOWN:
case WM_MOUSEMOVE:
case WM_LBUTTONUP:
break;

default:
return FALSE;
}

return true;
}
0 Likes