ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
This is great!
But if I use example#2 and at a later time wan't to access the note how do I do that? I tried a few ways but I can't seem to get it to work.
First I add the ca to the material, then I add it to a matlib and saves it. At a later time I wan't to load that matlib and access the note and print it to a edittext
I'm trying to access the note with custAttributes.get mat materialNote but all I get is undefined
--CA definition
materialNote = attributes mtlNote
(
parameters notesParm rollout:notesRoll
(
note type:#string ui:et_note
)
rollout notesRoll "Material Note"(
edittext et_note height:100))-- example (you can use any material from ME, from object, from library)
mtl = meditMaterials[1]-- the next line will assigne new rollout to material only if not existsif not (isProperty mtl #mtlNote)do custAttributes.add mtl materialNote
-- now you can get/set some text
mtl.mtlNote.note = "Standard gray material"--or if you want to extend existing note
mtl.mtlNote.note += "\nStandard gray material"-- open material editor and look "Material Note" rollout inside first matrial.
-- define and store note in variable
txt = "This is a custom material note text.\nCheck similar example in MXS Help."--define custom attributes to hold main function
materialNote = attributes mtlNote
(
fn getNote = (format"Note: %\n" txt))-- example (you can use any material from ME, from object, from library)
mtl = meditMaterials[1]--assigne CA to material
custAttributes.add mtl materialNote
----------------------------------------------------------- now to get note you need first to get material CA
ca = custAttributes.get mtl materialNote
-- then check if ca exists but if not send a messageif ca != undefined then ca.getNote()else messageBox "This material not have any note!" title:"MaterialNote" beep:off
Comments
This is great! But if I use
This is great!
But if I use example#2 and at a later time wan't to access the note how do I do that? I tried a few ways but I can't seem to get it to work.
Thanks so much for your help!
...
What do you try?
bga
First I add the ca to the
First I add the ca to the material, then I add it to a matlib and saves it. At a later time I wan't to load that matlib and access the note and print it to a edittext
I'm trying to access the note with custAttributes.get mat materialNote but all I get is undefined
Thanks
Let's say you put material
Let's say you put material from the library which already have note inside to material slot 3.
Now to get note simply use
If you assigne that material to en object (Box001 for example) then you can use
$Box001.material.mtlNote.noteAnd to set new note just do
bga
That was easy! Thanks again!
That was easy! Thanks again!
Thanks for the reply! I'm
Thanks for the reply!
I'm going to look at it today.
example #2 (visible notes)
Also you can add new rollout inside any material
bga
example (hidden notes)
bga