I can't seem to set the correct value in Poly selection Constraint on Texture Offset (UV)
polySelectConstraint -mode 3 -type 0x0010 -dist 1 -distpoint 0.5 0.5 0 -distbound 0 0.5;
distbound is suppose to set the Min and Max for distance. But it refuses to set to 0.5, whenever it executes it jumps down to 0.25. It is a wierd behavior. Also when I try to do it manually in Selection constraint options, it won't work either.
Replies
You will eventually stumble upon commands that behave weird like this, especially as you do more and more coding. There isn't much to do about it other than either work around it or contact Autodesk directly.
This will set Max Distance in Use Constraint to 0.5 - not sure why it happens but there you have it.
Klaudio2U: thanks. It seems that even if I set the -distbound 0 0.7071. the uv selection still seems to be inaccurate. So Im gona have to do a lot more testing to make my script work.
if you run it now it will give this sort of error
// Error: $storedUVs[] = stringArrayCatenate($strAryA,$strAryB);
//
// Error: Line 22.24: Syntax error //
// Error: string $finalUVs[] = stringArrayRemoveDuplicates $storedUVs;
//
// Error: Line 24.71: Invalid use of Maya object "stringArrayRemoveDuplicates". //
After getting the above code to work by concatenate each string array manually instead of using a for loop to do it. I realize that this method is way too slow. So I decided to use a different approach. Instead of using multiple polySelectConstraint , use only one with a bigger range which selects the uvs covering the tile with some overlap due to the radial selection> then I test those uvs against the min and max of the UV tile > after correct uvs are stored, it reselects them.
but now comes another issue, if I run the code now, it seems to ignore my if statement and store all the uvs instead of storing the correct uvs only.
I would appreciate it if someone can give me some pointers.