mograph - time offset animated texture exactly one frame

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 01 January 2013   #1
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 January 2013   #2
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 January 2013   #3
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 January 2013   #4
Try this simple Python Effector :
http://www.mediafire.com/?ecl1idfabuo53p5

cheers,
d
 
Old 01 January 2013   #5
great! thanks!
 
Old 01 January 2013   #6
brillant ! Douwe, as always ! Thanks ..
__________________
Frenchcinema4D Moderator http://www.frenchcinema4d.fr
my website : http://www.lev-communication.fr
Kamigaz® Project on : Pinterest
 
Old 02 February 2013   #7
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.

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 February 2013 at 03:39 PM.
 
Old 02 February 2013   #8
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.

 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
 
Old 02 February 2013   #9
thanks douwe!
 
Old 02 February 2013   #10
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.
 
Thread Closed share thread



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 01:13 AM.


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