Notifications
Clear all

[Closed] How to keep custom node?

hi
I try to pick a shape object in view port , get node( shape object) and show node name
like this:

I success pick a shape object and show it’s name,
When I save my MAX file and close 3ds MAX,
next time I open MAX file, it will lost shape object name.
like this:

how do I fix this problem?
thx

4 Replies

Hello,

I suppose that this is a scripted plugin that you write, right? Then you should have at least one parameter block and one rollout. I suppose that you ‘save’ your object in a parameter. I suggest that you should ‘refresh’ the label’s text whenever you open the rollout or when the plugin is getting loaded.

Enjoy,
har1sf0x

Thx for your reply.

Yes, this plugin is writed by myself, it is my practice work use VC++. I try to write a function to
pick object, This function same with Space warps->Force->path follow’s
Pick shape object
(maxsdk\samples\objects\particles\pfollow.cpp)

I think I do ‘refresh’ the label’s text, the ‘refresh’ code like this:

1. ShowName function :
voidForceWObject::ShowName()
{
TSTR name=TSTR(GetString(IDS_AP_OBJECTSTR1)) + (custnode ?custname : TSTR(GetString(IDS_AP_NONE1)));
SetWindowText(GetDlgItem(hParams,IDC_SP_PATHNAME), name);
}

2. Update function to getnode and change label’s text
void ForceWObjectDlgProc::Update(TimeValuet)
{
po->ShowName();
float size;
po->pblock2->GetValue(PB_DISPLENGTH,0,size,FOREVER);
TurnButton(po->hParams,IDC_SP_PATHNAMEPICK2,(size>=0.01f));

}

3. initialization and Update
BOOL ForceWObjectDlgProc:: DlgProc(TimeValuet, IParamMap2 *map,
HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
switch (msg) {
case WM_INITDIALOG:
{

                    ICustButton *iBut =GetICustButton(GetDlgItem(hWnd,IDC_SP_PATHNAMEPICK2));
                    iBut->SetType(CBT_CHECK);
                   iBut->SetHighlightColor(GREEN_WASH);
                    ReleaseICustButton(iBut);
                    po->hParams=hWnd;
                    Update(t);
                    return FALSE;
                    
            }       

I think that maybe ‘object reference’ or ’iLoad()’ or ‘iSave()’ function problem.
I don’t know this direction is right or not?

thx

do you really think that these pieces of code which you show make any sense to anyone?

I am sorry. I not usually ask problems about that.
I don’t know I should to show what of information for everyone?
If you can, please tell me.
thanks.