How I can access new gloval setting values without change them from UI?

Issue #152 resolved
engetudouiti created an issue

I read your post https://diffeomorphic.blogspot.com/2020/08/global-settings-improved.html then I know it is more good way to manage those setting values.

At same time I found new thing.

Untill I change those setting value, I can not access scene properties which plug in added.

I hope to keep “absolute duf path” for each rig which I imported. And add those URL as new prop of the rig (and mesh)

I made script. To work it, the script need to serch these vailables first. and use loop to serch duf (dbz) file are actuaally there.

Scene.DazNumPaths, and all Scene.DazPath1 Scene.DazPath2 ….. untill user defined NumPaths limit.

Before, I could access those value without tweak setting. (so those values are added when I import daz scene.duf with dbz by your plug in)

But now I can not access those value. But It sudenly appear when I tweak settings. ^^;

(And I know your new management way correctly work as you dscirbed,,)

You discribe

“The global settings are now global variables, which Blender can not mess with. In order to inspect and change the settings, they are converted into scene properties only when necessary, and then immediately converted back to global variables again.”

So what I hope to know is how to access those gloval variables from python?

Or I hope to request, if you can add new props which tell us “imported duf absolute path” for each rig and meshes.

Though I asked it before.

At current if I select rigs , those DazUrl and DazID usually show dsf in data directory, which is not duf path what we imported.

and If I select mesh (armature modifiered with rig), those DazID usually show duf path but it is not absolute path.

So precisely there is no way to get absolute duf path which we imported from UI

. (eg if you get it you can use the path for file browser, or when you forget which duf file you used for current rig and mesh, you can easy check them without serch around 3 or 4 library paths. So I recommend to offer way which user can easy find duf (and dbz) absolute path for each obj and armature.

Then we can merge many assets and rig which already saved in another blend file, with keep infomation of duf (and dbz) easy then uer can open them in daz studio,, (when they need) about each rig and meshes currently used in blend scene.

this pic is after I open setting file,, and close it, and use my script it now get and add those props for each object. Though I did not hope to re-open setting window, everytime to set absolute paths. I think even though you add new props (absolute duf or dbz path) for each armaterure or mesh objs, it not break user workflow, I believe ^^;

Comments (5)

  1. Thomas Larsson repo owner

    The scene properties only have meaningful values while the global settings dialog is shown. You need to check the fields of the global variable GS defined in settings.py. It is the unique instance of the class GlobalSettings. To list content directories, you do like this:

    import bpy
    import import_daz
    from import_daz.settings import GS

    for path in GS.contentDirs + GS.mdlDirs + GS.cloudDirs:
    print(path)

    Edit: For some reason I can’t get code formatting to work propertly.

    Edit 2: On second thought, I will import GS into the top module , so you can do

    from import_daz import GS

  2. Log in to comment