VEGAS Titles & Text Positioning (VEGASPython)

xjirj22 wrote on 11/26/2020, 11:34 AM

Dear All,

would You point me how to get Text Position, Anchor, text(preset) animation under control?

I am sharing my text-position/anchor idea below (sorry for VEGASPython but I love it.):

for track in pyVEGAS.Project.Tracks:
    if (track.IsVideo()):
        for evnt in track.Events:
            if(evnt.ActiveTake and evnt.ActiveTake.Media.IsGenerated()):
                if(evnt.ActiveTake.Media.Generator.PlugIn.IsOFX):
                    if(evnt.ActiveTake.Media.Generator.PlugIn.UniqueID == "{Svfx:com.vegascreativesoftware:titlesandtext}"):
                        OFX = evnt.ActiveTake.Media.Generator.OFXEffect
                        param = OFX.FindParameterByName("Text")                            
                        winRtf = System.Windows.Forms.RichTextBox()
                        winRtf.Rtf = param.Value
                        print("Plain text: ", winRtf.Text) 
                        print("Form Height: ", winRtf.Height) 
                        print("Form Width: ", winRtf.Width) # Some relation to string.Length?
                        print("Form Client Height: ", winRtf.ClientSize.Height) 
                        print("Form Client Width: ", winRtf.ClientSize.Width) # Some relation to string.Length?

                        # DOES NOT UPDATE WHEN CHANGED VIA OFX.AllParametersChanged()?
                        # Ie: BottomLeft = 6 (Bottom    2    Left    4    None    0    Right    8    Top    1    )
                        print("Form Anchor: ", winRtf.Anchor)
                        
                        # DOES NOT UPDATE WHEN CHANGED VIA OFX.AllParametersChanged()?
                        print("Form Location: ", winRtf.Location) # result = 0,0
                        
                        OFX.AllParametersChanged()

I am totally out to get the text animation under control...So one can solve issues mentioned (cadudesu:Titles & Text: Several Vegas 18 new presets are buggy) by oneself.

Thank you.

 

Stay Alive, Life is Good ;-)

Jan

 

 

 

Comments

jetdv wrote on 11/26/2020, 2:07 PM

Here's how to set the "Anchor Point/Alignment" in c#

                OFXChoiceParameter tparm3 = (OFXChoiceParameter)fxo.FindParameterByName("Alignment");
                tparm3.Value = tparm3.Choices[3]; //Center Left
 - change as needed for your anchor point
                fxo.AllParametersChanged();

Here's how to set the "Position" in c#

            OFXDouble2DParameter tparm2 = (OFXDouble2DParameter)fxo.FindParameterByName("Location");
            OFXDouble2D Pos;
            Pos.X = myX;
            Pos.Y = myY;
            tparm2.Value = Pos;

 

xjirj22 wrote on 11/26/2020, 3:55 PM

Dear jetdv,

thank You for sharing your deep knowledge.

Best regards

Jan

 

xjirj22 wrote on 11/27/2020, 2:51 AM

Here's how to set the "Anchor Point/Alignment" in c#

                OFXChoiceParameter tparm3 = (OFXChoiceParameter)fxo.FindParameterByName("Alignment");
                tparm3.Value = tparm3.Choices[3]; //Center Left
 - change as needed for your anchor point
                fxo.AllParametersChanged();

Here's how to set the "Position" in c#

            OFXDouble2DParameter tparm2 = (OFXDouble2DParameter)fxo.FindParameterByName("Location");
            OFXDouble2D Pos;
            Pos.X = myX;
            Pos.Y = myY;
            tparm2.Value = Pos;

 

Dear jetdv,

is there some source where could one get the list of all fxo.FindParameterByName("parameters") or expose all params somehow?

Or do we have to decompile the OFX?[😨 and feel panic!]

I could hit the animation sequence and understand the preset problems mentioned by cadudesu.

Actually I can imagine why is this happening but I want to think about the solution...

 

Best regards

Jan

For other VEGASPython Explorers ;-)

                            OFX = evnt.ActiveTake.Media.Generator.OFXEffect
                            OFXAlignment = OFX.FindParameterByName("Alignment");
                            OFXLocation = OFX.FindParameterByName("Location");
                            print("OFX Location", OFXLocation.Value.X, OFXLocation.Value.Y)
                            print("OFX Alignment", OFXAlignment.Value)
                            # Alignment Enumeration
                            for choice in OFXAlignment.Choices:
                                print(choice)      

 

jetdv wrote on 11/27/2020, 9:33 AM

When "reading" the effect, you can browse through all of the settings. For example, if you were exporting settings and then importing them again, you would just read through all of the parameters to export them. That will give you a list of all options available for that plugin. For the choices above, just open the choices list in Vegas and count down starting with zero as the first one.

xjirj22 wrote on 11/27/2020, 9:53 AM

Dear jetdv,

this is easy. Thank You.

The Animation Sequence(s) seems to be part of the OFX PlugIn. So I have to study OFX resources. 🎒

Best regards

Jan