Notifications
Clear all

[Closed] (Maxscript) How to check if property writable or read-ony?

Hi guy. As the title, can someone help me? Thank you in advanced

4 Replies

Perhaps you can simply parse it out of the showProperties output like this:

fn IsReadOnlyProp obj prop =
(
	local ss = StringStream ""
	showProperties obj prop to:ss
	
	local str = ss as string
	free ss
	
	MatchPattern str pattern:"*read-only*"
)

thanks Serejah. This help alot

This is a virtual method … we cannot trust it, relying only on the kindness of the developer.

Good point. If show_props_vf could be overriden for any third party class then it doesn’t even need to implement writing to stream or doing anything meaningful at all (like MAXAKey::show_props_vf does, it only returns bool)