load viewport background

hello

I made a little script which create a Attribute holder.
It store camera properties (height and width) so when I switch to another camera, I can click "apply" and retrieve camera parameters.

I would like to make the same thing for viewport background.

I wrote in the rollout :
editText edt_path "Background Image:" labelOnTop:true
and then when I want to apply
backgroundimagefilename = edt_path as Filename

Don't work.
but for eg backgroundimagefilename ="e:/x.jpg" is ok.

Somebody can help converting edt_path to something which can work ?
thanks.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
titane357's picture

Thank you sooo much Pixamoon

Thank you sooo much Pixamoon !!!!

pixamoon's picture

no prob

no prob, Happy to help :)

pixamoon's picture

`

I think you need to call "text" propriety of edt_path

backgroundimagefilename = edt_path.text

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.