Using Materials dynamically

Using Materials dynamically

Postby CaptLogic » Tue Feb 25, 2014 10:11 pm

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.
0

CaptLogic 
Premium Member
Premium Member
 

Re: Using Materials dynamically

Postby Jim » Tue Feb 25, 2014 11:15 pm

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 is FALSE, and Mona is visible.
1
Hi

Jim 
Global Moderator
 

Re: Using Materials dynamically

Postby CaptLogic » Wed Feb 26, 2014 12:44 am

Awesome,

Thanks for your help.
0

CaptLogic 
Premium Member
Premium Member
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Dynamic Components

Who is online

Users browsing this forum: No registered users and 7 guests

Visit our sponsors: