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.

Saving a read-only Max file?

Saving a read-only Max file?

Anonymous
Not applicable
1,291 Views
1 Reply
Message 1 of 2

Saving a read-only Max file?

Anonymous
Not applicable
Hi,

I'm currently integrating source control functionality into our 3DS Max plugins, and have come across a problem.

Attempting to save over a read-only file won't work - the save dialog rejects the attemtp before any of my code is reached.

I'm using the NOTIFY_FILE_PRE_SAVE notification, but this must be happening too late. Obviously the files have to be marked as read-only because they are not checked out at the point where the first save is requested.

Is there any way around this? If not, could a future release/patch of Max support allowing the NOTIFY_FILE_PRE_SAVE callback to happen earlier, so that I could remove the read-only status of
the file before it is opened and written to?

I don't want to check the file out when it is opened, as that could become counter-productive.

But hopefully I've missed something and it's already possible to work around this somehow?

Thanks,
Richard
0 Likes
1,292 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
I know you posted awhile ago; hopefully you've found a solution by now, but just in case:
You can use the SDK to call a maxscript command that sets the file attribute:

ManagedServices.MaxscriptSDK.ExecuteMaxscriptCommand(("setFileAttribute " + (myFile) + " #readOnly false"))

The maxscript command used here is
setFileAttribute <filename_string> <attribute> <boolean>


You could use this before doing the file dialog, this would set the file attribute without actually checking it out.
0 Likes