CLI unwrap does not work

Unwrapping does not work using CLI -unwrap -params.xmlcommand, when before this another unwrap was called already on another model.
here as you can see the file has values 2048, but it generates 4096 (or 8192 seems using the latest settings used in UI instead of the params.xml)

params.xml (643 Bytes)

image

Hi Serob, I tested this and it worked for me properly.
The pasted commands are the exact as you are using them? If so, there shouldn’t be “-” before params.xml.

Hi,
No, there was a mistake in the question.
What I use was -unwrap params.xml, also I tried to set settings before and then call unwrap (which was always working for older versions):

-set "unwrapMaxTexResolution=2048" ^
-set "unwrapMinTexResolution=2048" ^
-unwrap

I’m sending the full script, where you can find %decimate_command% part, and with unwrap command inside it. You can see it is called before exportSelectedModel. This structure worked for years in our application, but not after 2.0 update.

run.bat (3.2 KB)

Hi Serob,

thank you for your script.

First of all,

-set "unwrapMaxTexResolution=2048" ^
-set "unwrapMinTexResolution=2048" ^

is applied only for default unwrap parameters. So using these settings after first texturing doesn’t change the settings for the unwrap.

To use the new unwrap for the simplified model you need to use the params.xml file. For me it worked using your script (I just need to modify it for my usage).

So for me it worked like this:
-renameSelectedModel %raw_name%_decimated ^
-unwrap %unwrap_params% ^
-reprojectTexture %raw_name%_decimated_SQ %raw_name%_decimated ^
-selectModel %raw_name%_decimated

using the params file from the attachment in 2.0.1 version.

image

Unwrap.xml (587 Bytes)

Hi, thanks for the example.

First of all did I understand right that %unwrap_params% is the path to Unwrap.xml?
Also, I have tried the same thing with the file initially (see my original question) and it did not work either. Was it in a wrong format? Seems not, as I used 2.0.1 to generate it. unwrapMaxTexResolutionalso worked before the update to 2.0.1

Did you try with the 2-nd pass as in my script? This is the crucial point. The problem is that it works if it used separately, but when run in terms of this scirpt (after setting unwrap parameters for texturing) both approaches do not work (file and unwrapMaxTexResolution)

Hi Serob

First of all did I understand right that %unwrap_params% is the path to Unwrap.xml?
Yes, that is the path to the xml file.

Also, I have tried the same thing with the file initially (see my original question) and it did not work either. Was it in a wrong format?
It wasn’t a wrong format.

unwrapMaxTexResolutionalso worked before the update to 2.0.1
I’ve checked this in 1.3.2 version and the settings still apply only for the unwrap under Color and Texture Settings, not for the Unwrap tool.

Did you try with the 2-nd pass as in my script?
Yes, I’ve tried your script. Just a little bit modified for my usage. You can see that on the results, as the first model is decimated_SQ 5.5 M tris and second one is decimated 75 k tris and they have different texture size. I showed you just a part IF “%decimation%”==“True” ( where I removed -set commands and used -unwrap with the parameters.

run_2.bat (3.6 KB)

Thanks for verifying.

That’s really strange, cause on different systems I have the same behavior of the 2.0.1 version and it does not work with the xml parameter as well.

Concerning your checks on the 1.3.2 version: is there a chance that old versions read Color and Texture Settings when -unwrap is called without a parameter? So that’s why they worked and current one is not.

Thanks again.

Which CLI script version are you using on those systems?

In 1.3.2 the unwrap settings are used when the unwrap command is used without parameters: