Notifications
Clear all
[Closed] (Maxscript) How to check if property writable or read-ony?
Jul 11, 2021 12:33 pm
Hi guy. As the title, can someone help me? Thank you in advanced
4 Replies
Jul 11, 2021 12:33 pm
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*"
)
Jul 11, 2021 12:33 pm
This is a virtual method … we cannot trust it, relying only on the kindness of the developer.
Jul 11, 2021 12:33 pm
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)