ZBrushCentral

Question: Is there way to make a filepath flexibly?

I would like to achive something like below.
Get the filename from a dialog, merge it with the path, and check the existence.

But, I notice any variables remove “\”, so maybe I can’t store and process file name paths.
What can I do?

[varset, ActualFile,""]
[varset, Filepath, "C:\test\"]
[varset, Filename, "something file name that user inputs from the dialog"]
[varset, ActualFile, [StrMerge, Filepath, Filename, ".psd"]]

[IF, [FileExists, ActualFile]==1,
//If
	[Note,"Yes"]
, //Else
	[Note,"No"]
]

Maybe i misunderstood your post, you will correct me if i’m wrong.

But If you have outputed your variable in a note to know it’s content, the antiSlashes are not displayed.

image

Antislashes do not display in notes but don’t worry.

Outputing with [NoteBar,actualFile] instruction will show you the complete path with the antislashes…

image

Your variable is not changed. The slash still exists in it.

So your code will work as it is without problem. As long as you create the file in the good path C:\test\test.psd.

[IButton," test ","",
    [varset, actualFile,[StrAsk, "test","enter filename"]]
    [varset, filepath, "C\test\"]
    [varset, filename, "test"]
    [varset, actualFile, [StrMerge, filepath, filename, ".psd"]]
    [NoteBar,actualFile]
    [if, [FileExists, actualFile]==1,
    //If
        [Note,"Yes"]
    , //Else
        [Note,"No"]
    ]
]

Another way of watching your values is using a log :

1 Like

Ah! NoteBar! Thank you. I use always Note.

And, I have totally no idea why, but I restart PC and my test script works.
It was really confused me. and sorry for disturbing your time.
I used the Note for check the value, so I misunderstanded the cause was the lack of “\”.

Thank you for the reply! I use Notebar for those correct value checks.

1 Like