I want to give something to everyone who watches and follows and comments and helps encourage me to put out more videos.
Link to the Python script.
https://www.dropbox.com/scl/fi/oalbol...
Below is the script you can copy and paste into your own script.
from pyfbsdk import *
from pyfbsdk_additions import *
Button creation
def BtnCallback(control, event):
print(control.Caption, " has been clicked!")
'''
This is the single take plot function
'''
def Plot(b, n):
myPlotOptions = FBPlotOptions ()
myPlotOptions.ConstantKeyReducerKeepOneKey = False
myPlotOptions.PlotAllTakes = False
myPlotOptions.PlotOnFrame = True
myPlotOptions.PlotPeriod = FBTime ( 0, 0, 0, 1 )
myPlotOptions.PlotTranslationOnRootOnly = False
myPlotOptions.PreciseTimeDiscontinuities = False
myPlotOptions.RotationFilterToApply = FBRotationFilter.kFBRotationFilterNone
myPlotOptions.UseConstantKeyReducer = False
TheChar = FBApplication().CurrentCharacter
if TheChar.ActiveInput == True:
TheChar.PlotAnimation(FBCharacterPlotWhere.kFBCharacterPlotOnSkeleton, myPlotOptions)
else:
TheChar.PlotAnimation(FBCharacterPlotWhere.kFBCharacterPlotOnControlRig, myPlotOptions)
'''
This is the Plot all takes function
'''
def PlotAll(b, n):
myPlotOptions = FBPlotOptions ()
myPlotOptions.ConstantKeyReducerKeepOneKey = False
myPlotOptions.PlotAllTakes = True
myPlotOptions.PlotOnFrame = True
myPlotOptions.PlotPeriod = FBTime ( 0, 0, 0, 1 )
myPlotOptions.PlotTranslationOnRootOnly = False
myPlotOptions.PreciseTimeDiscontinuities = False
myPlotOptions.RotationFilterToApply = FBRotationFilter.kFBRotationFilterNone
myPlotOptions.UseConstantKeyReducer = False
TheChar = FBApplication().CurrentCharacter
if TheChar.ActiveInput == True:
TheChar.PlotAnimation(FBCharacterPlotWhere.kFBCharacterPlotOnSkeleton, myPlotOptions)
else:
TheChar.PlotAnimation(FBCharacterPlotWhere.kFBCharacterPlotOnControlRig, myPlotOptions)
'''
This is the button creation
'''
def PopulateLayout(mainLyt):
x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(5,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(0,FBAttachType.kFBAttachRight,"")
h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
mainLyt.AddRegion("main","main", x, y, w, h)
lyt = FBHBoxLayout()
mainLyt.SetControl("main",lyt)
b = FBButton()
b.Caption = "Plot"
b.Style = FBButtonStyle.kFB2States
b.Look = FBButtonLook.kFBLookColorChange
b.Justify = FBTextJustify.kFBTextJustifyCenter
b.SetStateColor(FBButtonState.kFBButtonState0,FBColor(0.62, 0.0, 1.0))
b.SetStateColor(FBButtonState.kFBButtonState1,FBColor(0.0, 1.0, 0.5))
lyt.Add(b,60)
b.OnClick.Add(Plot)
b = FBButton()
b.Caption = "DoublePlot"
b.Look = FBButtonLook.kFBLookColorChange
b.Justify = FBTextJustify.kFBTextJustifyCenter
b.SetStateColor(FBButtonState.kFBButtonState0,FBColor(0.00, 0.49, 0.0))
lyt.Add(b,75)
b.OnClick.Add(Plot)
b.OnClick.Add(Plot)
b = FBButton()
b.Caption = "|"
b.Justify = FBTextJustify.kFBTextJustifyCenter
lyt.Add(b,10, height=25)
b.OnClick.Add(BtnCallback)
b = FBButton()
b.Caption = "Plot ALL"
b.Style = FBButtonStyle.kFB2States
b.Look = FBButtonLook.kFBLookColorChange
b.Justify = FBTextJustify.kFBTextJustifyCenter
b.SetStateColor(FBButtonState.kFBButtonState0,FBColor(0.62, 0.0, 1.0))
b.SetStateColor(FBButtonState.kFBButtonState1,FBColor(0.0, 1.0, 0.5))
lyt.Add(b,60)
b.OnClick.Add(PlotAll)
b = FBButton()
b.Caption = "DoublePlot ALL"
b.Look = FBButtonLook.kFBLookColorChange
b.Justify = FBTextJustify.kFBTextJustifyCenter
b.SetStateColor(FBButtonState.kFBButtonState0,FBColor(0.00, 0.49, 0.0))
lyt.Add(b,75)
b.OnClick.Add(PlotAll)
b.OnClick.Add(PlotAll)
def CreateTool():
t = FBCreateUniqueTool("BrewhouseArt Plot Tools")
t.StartSizeX = 315
t.StartSizeY = 60
PopulateLayout(t)
ShowTool(t)
CreateTool()
In questa pagina del sito puoi guardare il video online Motionbuilder Tools: Free Gift!!! Plot (Bake) Tool Python Script della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Bryan Brewer 03 settembre 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,842 volte e gli è piaciuto 72 spettatori. Buona visione!