Home Coding, Scripting, Shaders

(MEL) question about condition statement

polycounter lvl 16
Offline / Send Message
onionhead_o polycounter lvl 16
So im writing this code that reads if User has partial uvs selected

  1. global proc string getNormalizeType(){
  2. string $objSel[] = `ls -sl -o`; //get objects only
  3. float $UVBBox[] = `polyEvaluate -bc2`;
  4. global string $normalizeType;
  5. int $flattenListNum = size(`ls -sl -fl`);
  6. int $UVCount[] = `polyEvaluate -uvcoord`;
  7. if (`size $objSel` == 0){
  8. warning "No objects selected";
  9. }
  10. if (`size $objSel` == 1 && $flattenListNum = $UVCount[0]){
  11. NormalizeUVTile 0;
  12. print "Single Object Selected";
  13. }
  14. if (`size $objSel` > 1 && $flattenListNum = $UVCount[0]){
  15. NormalizeUVTile 1;
  16. print "Multiple Object selected";
  17. }
  18. if ($flattenListNum < $UVCount[0]){
  19. NormalizeUVTile 2;
  20. print "Partial UVs selected";
  21. }
  22. return $normalizeType;
  23.  
  24. }
wierd thing is when I selected partial uvs on multiple objects. the 3rd condition will ring True. I have no idea why? Help please?

Replies

  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 16
    someone from tech-artist pointed out the issue
    1. if (`size $objSel` == 1 && $flattenListNum = $UVCount[0])

    should be
    1. if (`size $objSel` == 1 && $flattenListNum == $UVCount[0<span>]){</span>
    it was suppose to be == instead of =
Sign In or Register to comment.