use animation foreground layer
This commit is contained in:
parent
3a367e8c73
commit
056bc1e6ba
1 changed files with 43 additions and 29 deletions
72
render.py
72
render.py
|
@ -90,22 +90,25 @@ def compose(clips, target=150, base=1024, voice_over=None):
|
|||
break
|
||||
length += clip['duration']
|
||||
|
||||
fg = clip['foreground']
|
||||
if 'foley' in clip:
|
||||
foley = clip['foley']
|
||||
if "foreground" not in clip and "animation" in clip:
|
||||
fg = clip['animation']
|
||||
else:
|
||||
foley = fg
|
||||
if 'foreground2' in clip:
|
||||
if 'foreground3' in clip:
|
||||
n = seq()
|
||||
if n <= 3: # 0,1,2,3
|
||||
clip['foreground']
|
||||
elif n <= 6: # 4,5,6
|
||||
clip['foreground2']
|
||||
else: # 7,8,9
|
||||
clip['foreground3']
|
||||
elif chance(seq, 0.5):
|
||||
fg = clip['foreground2']
|
||||
fg = clip['foreground']
|
||||
if 'foley' in clip:
|
||||
foley = clip['foley']
|
||||
else:
|
||||
foley = fg
|
||||
if 'foreground2' in clip:
|
||||
if 'foreground3' in clip:
|
||||
n = seq()
|
||||
if n <= 3: # 0,1,2,3
|
||||
clip['foreground']
|
||||
elif n <= 6: # 4,5,6
|
||||
clip['foreground2']
|
||||
else: # 7,8,9
|
||||
clip['foreground3']
|
||||
elif chance(seq, 0.5):
|
||||
fg = clip['foreground2']
|
||||
|
||||
scene['front']['V1'].append({
|
||||
'duration': clip['duration'],
|
||||
|
@ -123,20 +126,31 @@ def compose(clips, target=150, base=1024, voice_over=None):
|
|||
else:
|
||||
transparency_back = transparency
|
||||
transparency_front = 0
|
||||
scene['front']['V2'].append({
|
||||
'duration': clip['duration'],
|
||||
'src': clip['background'],
|
||||
"filter": {
|
||||
'transparency': transparency_front
|
||||
}
|
||||
})
|
||||
scene['back']['V1'].append({
|
||||
'duration': clip['duration'],
|
||||
'src': clip['background'],
|
||||
"filter": {
|
||||
'transparency': transparency_back
|
||||
}
|
||||
})
|
||||
if "background" in clip:
|
||||
scene['front']['V2'].append({
|
||||
'duration': clip['duration'],
|
||||
'src': clip['background'],
|
||||
"filter": {
|
||||
'transparency': transparency_front
|
||||
}
|
||||
})
|
||||
scene['back']['V1'].append({
|
||||
'duration': clip['duration'],
|
||||
'src': clip['background'],
|
||||
"filter": {
|
||||
'transparency': transparency_back
|
||||
}
|
||||
})
|
||||
else:
|
||||
scene['front']['V2'].append({
|
||||
'blank': True,
|
||||
'duration': clip['duration'],
|
||||
})
|
||||
scene['back']['V1'].append({
|
||||
'blank': True,
|
||||
'duration': clip['duration'],
|
||||
})
|
||||
|
||||
scene['back']['V2'].append({
|
||||
'duration': clip['duration'],
|
||||
'src': clip['original'],
|
||||
|
|
Loading…
Reference in a new issue