CGTalk > Software > Maxon Cinema 4D
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 10-25-2012, 12:30 PM   #1
Aurety
Expert
 
Aurety's Avatar
portfolio
Antoine Aurety
LEV COMMUNICATION
LORIENT, France
 
Join Date: Sep 2002
Posts: 746
Multishader layers driven by user data ?

hi everybody !
Maybe you could help me, I have a mograph multishader with 4 cards (or more ) in layers but I need just one clone to display the texture which is controlled by user data ( linklist cycle button ).

I did this little file who match my need but not exactly what I'm looking for, I would prefer to preserve the 4 differents layers in my multishader...

Please have a look and tell me what I'm doing wrong or if it is a better solution !

Thanks, here's my file, use the user data "Cartes" on the "Cartes Texture controleur" Null object to change the texture... As you can see, it works but not in a convenient way.

Thanks for any advice !

http://www.lev-communication.fr/wip/cartes.zip

__________________
Frenchcinema4D Moderator http://www.frenchcinema4d.fr
my website : http://www.lev-communication.fr
Kamigaz® Project on : Pinterest
 
Old 10-25-2012, 02:08 PM   #2
douwe
Know-it-All
 
douwe's Avatar
portfolio
douwe
Brussels, Belgium
 
Join Date: May 2010
Posts: 472
You can use a Color's Greyscale Value in a Shader Effector to control which Layer of a MultiShader to display (if you set your MultiShader back to Color Brightness)

Then you can have your User Data control the Shader Effector's color value

If you have 4 cards you could do something like this :
if User Data == 0 display color value V of 0%
if User Data == 1 display color value V of 26%
if User Data == 2 display color value V of 51%
if User Data == 0 display color value V of 76%

probably simpler ways to do this, but that's the first thing that comes to mind.
hope that helps.

cheers,
d
__________________
-----------> douwe on vimeo
 
Old 10-25-2012, 02:10 PM   #3
douwe
Know-it-All
 
douwe's Avatar
portfolio
douwe
Brussels, Belgium
 
Join Date: May 2010
Posts: 472
Forgot to add :
You need to render to view the effect.
The Viewport doesn't play along nicely with the Multishader
__________________
-----------> douwe on vimeo
 
Old 10-25-2012, 02:12 PM   #4
Jops
hyper nerd
Florian Sepp
Germany
 
Join Date: Mar 2005
Posts: 348
Hi Aurety,

Im sorry but I really do not understand what you want to do :(

maybe you want to have a easy way to change a texfile with userdata?

the easiest way would be to rename the textures to 0.png , 1.png , 2.png
and trigger them with a integer value. you can add the ".png" with the math node switched to string I think.
that way it doesn't matter if you have 4 or 1000 texture files. you don't have to change anything in the xpresso.

best regards
Jops
 
Old 10-25-2012, 02:34 PM   #5
douwe
Know-it-All
 
douwe's Avatar
portfolio
douwe
Brussels, Belgium
 
Join Date: May 2010
Posts: 472
made a quick example.

used this Formula : User Data * (255/number of cards) + 1
so if you add cards, just increase the number of cards value.

d
__________________
-----------> douwe on vimeo
 
Old 10-25-2012, 02:43 PM   #6
Aurety
Expert
 
Aurety's Avatar
portfolio
Antoine Aurety
LEV COMMUNICATION
LORIENT, France
 
Join Date: Sep 2002
Posts: 746
Thanks for the answers, nice approachs both.

Douwe, I will probably add more cards, in fact I don't know how much.. And Jops, it's a really good idea but my idea is to make a tutorial for a french guy on our forum to build various 2D ( no morphs ) lips or eyes synching approaches.

The first method I used was to build a large picture with 200 px for each expression ( with alpha mask ) then used a driven data to offset the picture in step mode. Nice results but I would prefer a individual picture by expression. But it works nice

2nd approach, I used one material for each expression and add a link list node to switch betwwen them. Work nice too...

third, I tried to use the multishader approach, to link all the various expressions in one time then find a way to driven theses. that's all but with your answers, I will have ton investigate further more :-)
__________________
Frenchcinema4D Moderator http://www.frenchcinema4d.fr
my website : http://www.lev-communication.fr
Kamigaz® Project on : Pinterest
 
Old 10-25-2012, 02:47 PM   #7
Aurety
Expert
 
Aurety's Avatar
portfolio
Antoine Aurety
LEV COMMUNICATION
LORIENT, France
 
Join Date: Sep 2002
Posts: 746
pfff ! Douwe... simple as that ! as always... I would like to have your brain... thanks !
perfect, i will try with that.
__________________
Frenchcinema4D Moderator http://www.frenchcinema4d.fr
my website : http://www.lev-communication.fr
Kamigaz® Project on : Pinterest
 
Old 10-25-2012, 03:06 PM   #8
douwe
Know-it-All
 
douwe's Avatar
portfolio
douwe
Brussels, Belgium
 
Join Date: May 2010
Posts: 472
Glad I could help you out.
Sounds like an interesting setup you're working on.

final remark :
There's no need for that Range Mapper i put in there.
You can skip it by dividing the outcome of that formula by 255

(user data*(255/number of cards)+1)/255

cheers,
d

Edit : Oops.
__________________
-----------> douwe on vimeo

Last edited by douwe : 10-25-2012 at 08:42 PM.
 
Old 10-25-2012, 03:06 PM   #9
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:59 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.