Using Materials dynamically
-
Hello,
I'm trying to create a dynamic component that mimics the functionality of the 'Art Frame' dynamic component that Google created. Basically it is a dynamic component of a frame picture. Each time you click on the frame the 'artwork' material changes.
If I understand correctly, this behavior comes from the components 'onClick' behavior that is currently: SET("ArtCount",1,2,3,4)
To me this says, rotate the material between 4 different options.
What I cannot figure out is how to create this to begin with. I see a 'Custom' section in the components attributes section that has a 'ArtCount' property that is set to '4'. What I don't understand is how to designate each material. Is it a hidden face that has a tag that identifies it as item #1 or 2 and is unhidden in response to a 'dynamic click'?
I'm happy to absorb a video or other tutorial, I just can't seem to find what I'm looking for.
Thanks so much.
-
It's not a hidden face exactly - there are 4 sub-components which are being made visible/hidden depending on the value of the ArtCount attribute.
The onClick is just cycling the value of the ArtCount attribute through 1 - 4. Nothing more to the onClick than that.
Then each of the 4 Components which contain the images looks at the value of ArtCount to decide to be hidden or visible. These 4 components use the built-in HIDDEN attribute to decide to be hidden or visible.
"Mona" Component:
Hidden: =IF(ROUND(PictureFrame!ArtCount)=1,FALSE(),TRUE())
means if ArtCount equals 1, then
Hidden
isFALSE
, and Mona is visible. -
Awesome,
Thanks for your help.
Advertisement