Hello again, so I'm trying to force set a specific value into the UV toolkit. I want to run a line of script that sets Map Size to 2048
I set the value there with history turned on in the script editor, but it only captures this command.
uvTkTexelDensityChangeCB;
When I paste that command in I can't figure out what the arguments are, or if it even has any. Anyone know how I could figure this out. If the user sets this field to 0 it will cause an error in my script so I just want to force it to any other number than zero as my script runs.
When you run across things like that, there's two ways to hunt it down. The first is the mel command "whatIs uvTkTexelDensityChangeCB". This usually returns the full path to the appropriate file.
I've run into cases where it doesn't really know. So I do a command line search while in [maya install path]\scripts\ findstr /n /s /c:"uvTkTexelDensityChangeCB" *.*
Ultimately, I'm of no help here, I can't think offhand how to put values into a text box via scripting. I'll try again in the morning unless someone smarter has that answer.
But that script does contain a command for doing the command directly too, in case that's what you'd rather do. "texSetTexelDensity 7.5 512" for example.
Yeah I just need to pre populate that value to avoid a script error, the texSetTexelDensity I actually want to be dynamic, so setting that explicitly doesn't help in that case.
Yeah I just need to pre populate that value to avoid a script error, the texSetTexelDensity I actually want to be dynamic, so setting that explicitly doesn't help in that case.
That's awesome, this was the magic line I was looking for to get my script working. Thank you very much for that. I just need to explicitly set the value of this one float field before my script runs to avoid it causing an error if someone accidentally has 0 set in that field. You da maaaaan.
That's awesome, this was the magic line I was looking for to get my script working. Thank you very much for that. I just need to explicitly set the value of this one float field before my script runs to avoid it causing an error if someone accidentally has 0 set in that field. You da maaaaan.
floatField -e -v 5.12 uvTkTexelDensityField;
uvTkSaveToogleFloatValue("uvTkTexelDensity");
Just a heads up that this sets the option back into the preference file, there's a chance that if you don't do both, the value could get reset mid-session. (i think)
Replies
https://www.moddb.com/downloads/maya-mel-texel-density-td-script
When you run across things like that, there's two ways to hunt it down. The first is the mel command "whatIs uvTkTexelDensityChangeCB". This usually returns the full path to the appropriate file.
I've run into cases where it doesn't really know. So I do a command line search while in [maya install path]\scripts\
findstr /n /s /c:"uvTkTexelDensityChangeCB" *.*
Ultimately, I'm of no help here, I can't think offhand how to put values into a text box via scripting. I'll try again in the morning unless someone smarter has that answer.
But that script does contain a command for doing the command directly too, in case that's what you'd rather do. "texSetTexelDensity 7.5 512" for example.
$TDValue = 8.5
Just a heads up that this sets the option back into the preference file, there's a chance that if you don't do both, the value could get reset mid-session. (i think)
texSetTexelDensity 142 1024;