Notifications
Clear all

[Closed] animating the material editor slots

well I dont know how to get this working using the vertex color .

here’s my bit of code Im using could someone take a look and tell me why its not setting any keys in the time line , or tell me how to change it so it will ?. keydiff = 1 if the key is down 0 if up , the black keyobjects have a # in the name so the script knows to what colour to turn back to from being Red . I do hope someone can help me with this cos its doing me head in:(

 animate on 

at time (execute(T2 as string + "s")) rotate theObj rot_key

if keydif == 1 then (theObj.material = meditMaterials["RedKeys"] ) 

if keydif == 0 then ( 

if (findstring $.name "#") ==undefined then (theObj.material = meditMaterials["WhiteKeys"] ) else (

theObj.material = meditMaterials["BlackKeys"]))


Thanks for reading and all the help so far guys

You could also do it with one material, in the diffuse slot a gradient ramp set to the colours you were after (with no gradient transitions, the knots right next to each other) . Assign a UVW map to the key & scale it up so the key has only one colour on it. Then write a script to move the UVW gizmo around to change the colour.

yes but then the rest of the Keyobjects will also change colour ,as Ive said I got it working with the bit of code above but it wont record it too the time line ,I want only the keys or key that are selected at a given point in time to change .and the script to record the changes in the time line. thanks anyway

 rdg

thats how a pro would do it nice idea I am gonna have to try doing this.

I tried this suggestion.
But isn’t this getting realy slow?
Changing the vertexcolors for complex objects?

Georg

in the end I just wrote my script to make a multi Material and added 128 Materials (now using 128 Keys as midi will go up to this amount)each with there own ID and just animated what ever mat I needed to ,each key object had its own ID so as you can see it works great .Im writing a script that converts a midi file to a text file then reads that text file I got most of it working so now I got a midi controled animation . still got a few midi commands to add but Im getting there

 rdg

This looks very cool.
I allready noticed by your avatar that you must have found a way to get this running.

Will this be a free available script?

I am hooked by that vertex color thing.

Georg

yeah once its ready I will Email it out to anyone that wants it. I still got a few bits to sort out. but it should be ready soon.I also have added to the script so now you tell it how many keys you want and it makes and lays them out for you , it also makes the body ,this can be a grand piano or upright or a synthesizer type body , you can also pick if you want synthesizer type keys or piano type keys , you also have the option to use your own objects if you wish and have them animated to the midi files you put into it .Im very happy with how its coming along so far . let me know if you get the vertex color working .

Page 2 / 2