Get/Set external file properties with maxscript?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 12 December 2010   #1
Get/Set external file properties with maxscript?

Is there a way to get/set file properties of external files (not .max files) with maxscript?
__________________
Not bad. For a hughman.
 
Old 12 December 2010   #2
Originally Posted by 3rd Dimentia: Is there a way to get/set file properties of external files (not .max files) with maxscript?


there is no way to get it with maxscript only. there are some free DLLs which give access to file proprties (some of them are open source). using .net you technically can get this data. try to search on this forum, i posted some links.
 
Old 12 December 2010   #3
Thanks Denis, I'm assuming you men the CalumMcLellan StructuredStorage DLLs. If so, thanks for the tip. However I wouldn't even know where to put them, never mind how to access/use them. I appreciate the reply though.

Cheers,

Cg.
__________________
Not bad. For a hughman.
 
Old 12 December 2010   #4
Originally Posted by 3rd Dimentia: Thanks Denis, I'm assuming you men the CalumMcLellan StructuredStorage DLLs. If so, thanks for the tip. However I wouldn't even know where to put them, never mind how to access/use them. I appreciate the reply though.

Cheers,

Cg.


yes. it's Calum McLellan StructuredStorage. I think it's one of the best things about this matter. I'm using my own but his one is much more powerful. Unfortunately I can't share my DLL but my experiments with Calum's might be helpful:


global StructuredStorage = dotnet.loadassembly @"C:\Tools\StructuredStorage\64\CalumMcLellan.Struct    uredStorage.dll" 
-- read properties
(
	file = @"C:\Temp\attr_test01.max"
	PropertySets = dotnetobject "CalumMcLellan.StructuredStorage.PropertySets" file on -- ON is for read only
	member = dotnetclass "CalumMcLellan.StructuredStorage.PropertySetIds"
	format "Summary:\n"
	if PropertySets.Contains member.SummaryInformation do
	(
		SummaryInfoIds = dotnetclass "CalumMcLellan.StructuredStorage.SummaryInfoIds"
		pp = PropertySets.item[member.SummaryInformation]
		
		title = pp.item[SummaryInfoIds.Title]
		format "\t%: %\n" title.name title.value
		subject = pp.item[SummaryInfoIds.Subject]
		format "\t%: %\n" subject.name subject.value
		author = pp.item[SummaryInfoIds.Author]
		format "\t%: %\n" author.name author.value
	)
	format "Custom:\n"
	if PropertySets.Contains member.UserDefinedProperties do
	(
		pp = PropertySets.item[member.UserDefinedProperties]
		enum = pp.GetEnumerator()
		enum.MoveNext()
		while enum.current != undefined do
		(
			format "\t%: %\n" enum.current.name enum.current.value
			enum.MoveNext()
		)
		enum.Dispose()
	)
	PropertySets.Dispose()
)
-- write properties
(
	file = @"C:\Temp\attr_test.max"
	PropertySets = dotnetobject "CalumMcLellan.StructuredStorage.PropertySets" file off -- OFF is not read only
	member = dotnetclass "CalumMcLellan.StructuredStorage.PropertySetIds"
	format "Summary:\n"
	if PropertySets.Contains member.SummaryInformation do
	(
		SummaryInfoIds = dotnetclass "CalumMcLellan.StructuredStorage.SummaryInfoIds"
		pp = PropertySets.item[member.SummaryInformation]
		
		title = pp.item[SummaryInfoIds.Title]
		title.value = "changed"
		format "\t%: %\n" title.name title.value
	)
	PropertySets.Dispose()
)


best,
 
Old 12 December 2010   #5
ooh, interesting. I'd looked into COM structured storage before - http://lonerobot.net/?p=151 when I was working out how to get the max file thumbnail through dotnet. I dont think his API was out at the time. I used microsoft's dsofile.dll. This looks much better, thanks Denis.
__________________
Regards,
Pete

Read my technical blog - lonerobot.net
 
Old 12 December 2010   #6
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.
 
Thread Closed share thread



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 06:54 AM.


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