CGTalk > Software Specific Forums > Maxon Cinema 4D
To minimize the ads you see on this page create a CGTalk account and log in HERE
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 01-31-2013, 12:23 PM   #1
firewireflow
Veteran
 
firewireflow's Avatar
Florian Herweg
Vienna, Austria
 
Join Date: Jun 2006
Posts: 38
mograph - time offset animated texture exactly one frame

i am trying to time offset the texture of mograph clones exactly 1 frame. i found douwes walkthrough on how to sequentially offset the texture via the formula effector here on cgtalk:

http://forums.cgsociety.org/showthr...?f=47&t=1084532

that basically works fine but it does start the next clones texture once the old clones texture is animated till the end. and so on.

what i need to achieve is that the time offset of each clone should be exactly 1 frame. i tried to fiddle around with the formula but couldn't wrap my head around it.

here's my scene file so far!

http://helloweare.at/experiments/time_offset_test.zip

any help with this is very much appreciated!
 
Old 01-31-2013, 12:37 PM   #2
firewireflow
Veteran
 
firewireflow's Avatar
Florian Herweg
Vienna, Austria
 
Join Date: Jun 2006
Posts: 38
figured it out with douwes other walkthrough on how to time offset animated texture:

forums.cgsociety.org/showthread.php?t=964676

with fiddling around with the step effector it works like a charm!

i am still interested in how to solve that with the formula effector. i'd really like to understand how this would work.

http://helloweare.at/experiments/time_offset_test2.zip

thanks
 
Old 01-31-2013, 01:01 PM   #3
firewireflow
Veteran
 
firewireflow's Avatar
Florian Herweg
Vienna, Austria
 
Join Date: Jun 2006
Posts: 38
there is one addon i'd like to mention:

while the solution with step effector works, its not very elegant. changing the amount of clones throws everything of and you'd have to fiddle with step effector settings again :(
 
Old 01-31-2013, 04:23 PM   #4
douwe
Know-it-All
 
douwe's Avatar
portfolio
douwe
Brussels, Belgium
 
Join Date: May 2010
Posts: 472
Try this simple Python Effector :
http://www.mediafire.com/?ecl1idfabuo53p5

cheers,
d
__________________
-----------> douwe on vimeo
 
Old 01-31-2013, 06:52 PM   #5
firewireflow
Veteran
 
firewireflow's Avatar
Florian Herweg
Vienna, Austria
 
Join Date: Jun 2006
Posts: 38
great! thanks!
 
Old 01-31-2013, 07:52 PM   #6
Aurety
Lord of the posts
 
Aurety's Avatar
portfolio
Antoine Aurety
LEV COMMUNICATION
LORIENT, France
 
Join Date: Sep 2002
Posts: 743
brillant ! Douwe, as always ! Thanks ..
__________________
Frenchcinema4D Moderator http://www.frenchcinema4d.fr
my website : http://www.lev-communication.fr
Kamigaz® Project on : Pinterest
 
Old 02-05-2013, 03:36 PM   #7
firewireflow
Veteran
 
firewireflow's Avatar
Florian Herweg
Vienna, Austria
 
Join Date: Jun 2006
Posts: 38
hi douwe,

thanks again for your help. i've never used the python effector before and i am amazed about the possibilities it offers. just ordered books and try to get my head around python itself.

i got some basic questions about the script you posted and if you got the time i'd really appreciate if you could help me understand it.

Code:
import c4d from c4d.modules import mograph as mo from c4d import utils def main(): TexFrames = 66 md = mo.GeGetMoData(op) if md==None: return False cnt = md.GetCount() carr = md.GetArray(c4d.MODATA_COLOR) #fall = md.GetFalloffs() frame = doc.GetTime().GetFrame(doc.GetFps()) for i in (xrange(0, cnt)): value = c4d.utils.RangeMap(frame, i, i+(TexFrames-1), 0, 1, clampval=True) col = c4d.Vector(value) carr[i] = col md.SetArray(c4d.MODATA_COLOR, carr, True) print(cnt) print(i) print(frame) print("next") return True



i just added print commands at the end of the script to see what the value of the variables are that you used in the rangemapper.

what i am trying to figure out is how to modify your script so that the textures of each clone are offset by 1 from the very beginning. like so:

10
09
08
07
06
05
04
03
02
01
00

and the next frame would be

11
10
09
08
07
...

if you could point me in the right direction, that would be amazing!

Last edited by firewireflow : 02-05-2013 at 03:39 PM.
 
Old 02-05-2013, 04:44 PM   #8
douwe
Know-it-All
 
douwe's Avatar
portfolio
douwe
Brussels, Belgium
 
Join Date: May 2010
Posts: 472
This is not a matter of studying Python, it's just plain old school logic and math.

Instead of the frame number, you take the index number as the start value.
Then you add the actual frame number to that, so the values increase with 1 each frame.
The index number is an Integer, so you need to make that a float.
Now, for the start position you don't want the last clone in the row to display the last Shader in the Multishader, but the one that corresponds with the clone's Index Number, no matter how many clones you set, so you divide the value by the number of Shaders minus 1.
Finally you clamp the result between 0 and 1.

Code:
for i in (xrange(0, cnt)): value = max(min(float(i+frame)/(TexFrames-1), 1), 0) col = c4d.Vector(value) carr[i] = col


cheers,
d
__________________
-----------> douwe on vimeo
 
Old 02-07-2013, 11:01 AM   #9
firewireflow
Veteran
 
firewireflow's Avatar
Florian Herweg
Vienna, Austria
 
Join Date: Jun 2006
Posts: 38
thanks douwe!
 
Old 02-07-2013, 11:01 AM   #10
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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 10:46 PM.


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