Notifications
Clear all

[Closed] movekey defusemapamount.controller = undefined??

the script:


...
 
k1 +=2 
k2 +=2
k3 +=2 
minus -=1
plus -=1


for i = 1 to planesArray.count do
(
   --moveKey planesArray[i].material.selfIllumAmount.controller k1 (random minus plus)
   moveKey planesArray[i].material.controller k2 (random minus plus)
)

I allways get the errormessage:

– Error occurred in i loop; filename: C:\Programme\Autodesk\personal Scripts\Syncroning selfIllumination.ms; position: 1176
– Frame:
– i: 1
– called in f loop; filename: C:\Programme\Autodesk\personal Scripts\Syncroning selfIllumination.ms; position: 1274
– Frame:
– f: 1
– No ““moveKey”” function for undefined

why is it undefined?there are some keys.
and the same script with selIllumamount.controller works fine.
could it be that it is because my key-tangents are set to step in the defusemapAmount?

9 Replies

My guess would be that:

moveKey planesArray[i].material.controller k2 (random minus plus)

should be:

moveKey planesArray[i].material.defusemapAmount.controller k2 (random minus plus)

-Eric

Heres your problem:

planesArray[i].material.controller

materials don’t have controllers. If you want to access the diffuse map amount you need to get to it like this:

[b]planesArray[i].material.diffuseMapAmount.controller[\b]

-Dave

[color=white]yea, I’m sorry, I was hurrying when writing the post. I wrote it wrong here, but correctly in max.try it yoursef.

animate the diffuse amount, and write:

[/color]

movekey meditmaterials[1].diffuseMapAmount.controller 1 5

will get this message:

– No ““moveKey”” function for undefined

But the DiffuseMapAmount is’nt animateable…

Perhaps you could show more of your code.

-Dave

i have keyframes in it. you have to first apply any map inside, then it will get animatable
if you delete the map, all the keys get deleted too. perhaps this has to do something with it.
but why does it make no problemes with the self illumination controller.

you can download the whole script at www.megalomania.ch/capitanred/Scripts/SyncroningSelfIllumination.ms
but there is no more important stuff there, which would change the fact of the diffuse thing.

Not sure why, but I checked to see what happens when it works.

meditMaterials[1][#Maps].Diffuse_Color_Amount.controller

That should help. Looks like it’s using a weird alias for it.

-Dave

wow!nice…thanx, never saw something like that before

now it’s getting strange(perhaps only for me ;))

$.material[#Maps].Diffuse_Color_Amount.controller –>does only work, if the material is in the material editor and the material editor was opened.
otherwise this message appears:
[size=1]Unknown property: “Diffuse_Color_Amount” in SubAnim:Maps

but in my case, all the planes have a material applyed trough script, and these materials are not in the edtor. what can I do now?

I cleaned up the script if you need it. the link is two posts ago

[/size]

Well, you’re right about that. I’m getting that issue too.

One thing that I did notice is that all that needs to happen is for the material to be in the editor once. You can clear it from the material editor and the animateable property still exists.


mat = standard()  --we make a material
mat.diffuseMap = Noise() --add a noise map to the diffuse slot

meditMaterials[1] = mat --make the first material in the material editor the mat we made
mat[#maps].diffuse_Color_Amount.controller = bezier_float() --add a controller to the property

meditMaterials[1] = standard() --clear out the material we made

mat[#maps].diffuse_Color_Amount.controller --access the material we made and the property still is animatable.

That proves the work around. That could at least get you what you need for the moment. It’s a bandaid, but I’ll keep looking into a way to do it otherwise.

-Dave