CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-09-2013, 06:59 PM   #1
lo
the frequentest!
portfolio
Rotem Shiffman
Tel Aviv, Israel
 
Join Date: Jul 2005
Posts: 2,827
File IO Notification [SDK]

There are 4 notifications in the SDK that can allegedly give information about what kind of IO operation is taking place:

Code:
#define NOTIFY_FILE_PRE_OPEN_PROCESS 0x000000AD #define NOTIFY_FILE_POST_OPEN_PROCESS 0x0000008B #define NOTIFY_FILE_PRE_SAVE_PROCESS 0x000000AE #define NOTIFY_FILE_POST_SAVE_PROCESS 0x000000AF

Quote:
All contain a CallParam that points to a struct{ int iProcessType; const MCHAR* filename; }.See File Process Type

where iProcessType should be one of these values:
Code:
#define FILE_PROCESS_SCENE 0x1 #define FILE_PROCESS_HOLD_FETCH 0x2 #define FILE_PROCESS_AUTOBAK 0x3


It seems if I use their struct definition, iProcessType is always 2, and the filename is gibberish.

Has anyone ever got this to work?
 
Old 03-09-2013, 07:48 PM   #2
Klunk
Lord of the posts
 
Klunk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Sep 2005
Posts: 701
this seems to work OK....

somewhere above the constructor....

Code:
#include "maxscrpt/Listener.h" #include "notify.h"


Code:
struct fileIONotifyParam { int iProcessType; const MCHAR* filename; }; static void file_pre_open_process_notify_proc(void* param, NotifyInfo* pInfo) { fileIONotifyParam* ioparams = (fileIONotifyParam*)pInfo->callParam; if(ioparams) { the_listener->edit_stream->printf("id:%d filename:%s\n", ioparams->iProcessType, ioparams->filename); the_listener->edit_stream->flush(); } }



in the constructor this

Code:
RegisterNotification(file_pre_open_process_notify_ proc, this, NOTIFY_FILE_PRE_OPEN_PROCESS);


then in the destructor this

Code:
UnRegisterNotification(file_pre_open_process_notif y_proc, this, NOTIFY_FILE_PRE_OPEN_PROCESS);

Last edited by Klunk : 03-10-2013 at 09:58 PM.
 
Old 03-09-2013, 07:57 PM   #3
lo
the frequentest!
portfolio
Rotem Shiffman
Tel Aviv, Israel
 
Join Date: Jul 2005
Posts: 2,827
Oh shit. My bad, I was casting the wrong pointer!
Sorry, I'm tired

Thanks for the help.
 
Old 03-09-2013, 08:01 PM   #4
lo
the frequentest!
portfolio
Rotem Shiffman
Tel Aviv, Israel
 
Join Date: Jul 2005
Posts: 2,827
btw, why do you use
Code:
the_listener->edit_stream->printf("text")

instead of
Code:
mprintf("text")

Is there a difference?
 
Old 03-09-2013, 08:09 PM   #5
Klunk
Lord of the posts
 
Klunk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Sep 2005
Posts: 701
probably not
 
Old 03-09-2013, 08:09 PM   #6
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:28 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.