Float Vector Property in Draw() Function

Hey All. Does anyone know the proper way to place a Float Vector Property in the operator draw() function? By default, the function “FloatVectorProperty()” produces XYZ stacked in 3 rows, like “Location”, “Rotation”, and “Scale” in the Properties Panel. However, if I use this in the class definition:


test_vector=FloatVectorProperty(name="Test Vector",subtype='XYZ',default=[0.0,1.0,0.0])

then this expression in the draw() function:


row.prop(self,"test_vector")

I get X, Y, and Z smashed together on a single row. Does anyone know the proper way to format a Float Vector Property in draw(), so that it comes in 3 stacked rows, like the default layout? I have been unable to find any documentation on this. Thanks.

Ah ha. Column.


                box.label('Object Origin')
                col = box.column()
                col.prop(xx,'Origin',text = '')

1 Like

Results in the following…

/uploads/default/original/4X/3/9/7/3973f22fe1e10a3eda2bde2e03095e53178bd44f.jpgstc=1

Attachments


Thanks Traveller. That worked. Actually with a little experimentation, I found that i could shorten it to:


        col=self.layout.column()
        col.prop(self,'test_vector')

The really strange thing is, I swear that I already tried this—yesterday or the day before. I must have been tired and made a typo, or left out some vital syntax. I knew it had to be simple. Thanks again.