회원 로그인
|
폴리곤 체크 스크립트
폴리곤 체크 스크립트 (엣지의 갯수가 5개 이상 폴리곤 체크 for 얼렘빅)
언리얼4의 얼렘빅을 사용하기 위해서 폴리곤의 엣지의 갯수가 5개 이상 넘어갈 수 없으므로 이를 체크하기 위한 급! 작성한 스크립트
작동 원리
정해진 오브젝트의 총 폴리곤(페이스) 수를 구하고,
총 폴리곤을 반복적으로 하나씩 폴리곤 정보를 추출하여 버텍스 넘버의 갯수로 추려(선택)낸다.
polyName_에 원하는 오브젝트명을 적어준다.
언리얼4의 얼렘빅을 사용하기 위해서 폴리곤의 엣지의 갯수가 5개 이상 넘어갈 수 없으므로 이를 체크하기 위한 급! 작성한 스크립트
작동 원리
정해진 오브젝트의 총 폴리곤(페이스) 수를 구하고,
총 폴리곤을 반복적으로 하나씩 폴리곤 정보를 추출하여 버텍스 넘버의 갯수로 추려(선택)낸다.
사용법
쉐입 하나 선택 후 checkPoly() 실행!
# -*- coding: utf-8 -*- #v0.3 (20170707) from maya import cmds,mel #import sys,re,os def checkPoly(): #폴리 정보 polyName_ = cmds.ls(sl=1)[0] selectPolyCount_ = cmds.polyEvaluate(polyName_,f=1) #progressBar gMainProgressBar_ = mel.eval('$tmp = $gMainProgressBar') cmds.progressBar( gMainProgressBar_, e=1, beginProgress=True, isInterruptable=True, status='Polygon Checking...', maxValue=selectPolyCount_ ) warningEdges = [] for i_ in range(selectPolyCount_): if cmds.progressBar(gMainProgressBar_, q=1, isCancelled=1): break cmds.progressBar(gMainProgressBar_, e=1, step=1) #5개 이상 버텍스가 구성된 폴리곤 찾기 cmds.select('%s.f[%d]'%(polyName_,i_), r=1) polyInfo_ = cmds.polyInfo( fv=True ) polySplit_ = polyInfo_[0].split() if (len(polySplit_) > 6): cmds.warning('%s.f[%d]'%(polyName_,int(polySplit_[1].split(":")[0])) + ': Find 5 or more Edges!') warningEdges.append('%s.f[%d]'%(polyName_,int(polySplit_[1].split(":")[0]))) cmds.select(warningEdges, r=1) #select cmds.progressBar(gMainProgressBar_, edit=True, endProgress=True) #progressBar 강제 종료 print("Complte Polygon Check!!") #완료 checkPoly() #선택 #cmds.select('%s.f[4779]'%polyName_)
- checkPolygon_v0.3.py (1.3KB) (0)
댓글 0개
| 엮인글 0개
466개(1/24페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
마야 뷰포트 네비게이션 팁 | 푸딩뱃살 | 42370 | 2020.04.06 17:22 | |
Maya 버전 별 Python 버전 | 푸딩뱃살 | 63687 | 2014.01.08 17:59 | |
464 | [Dev] Autodesk Maya Devkit 다운로드 | 푸딩뱃살 | 677 | 2023.01.28 14:28 |
463 | [Base] (해결 중) modules 환경설정 중 | 푸딩뱃살 | 612 | 2022.11.09 11:47 |
462 | [Script] pymel 딕셔너리형 사용 시 KeyError | 푸딩뱃살 | 809 | 2022.11.07 12:08 |
461 | [오류] Building Numpy for Maya Python 2.7.x | 푸딩뱃살 | 579 | 2022.10.23 14:38 |
460 | [Base] 뷰포트에서 조절자가 안 보일때 | 푸딩뱃살 | 754 | 2022.10.13 15:47 |
459 | [Rigging] mirror joints 사용 시 유의 사항 | 푸딩뱃살 | 755 | 2022.10.04 10:46 |
458 | [Script] 2022에서 enum34 모듈 설치 금지 | 푸딩뱃살 | 587 | 2022.08.17 18:08 |
457 | [Script] pymel 예제 | 푸딩뱃살 | 606 | 2022.07.05 19:20 |
456 | [Script] 인코드 / 디코드 - 2.7 한글 사용 | 푸딩뱃살 | 881 | 2022.03.08 17:52 |
455 | [Dev] ui 없이 mayapy로 자동화 | 푸딩뱃살 | 679 | 2022.02.17 13:56 |
454 | [Dev] mayapy로 ui파일 py로 | 푸딩뱃살 | 518 | 2022.02.15 18:20 |
453 | [오류] Error : MayaBonusTools | 푸딩뱃살 | 892 | 2022.01.21 17:52 |
452 | [오류] Error: ModuleNotFoundError | 푸딩뱃살 | 749 | 2022.01.21 16:24 |
451 | [Dev] mayapy | 푸딩뱃살 | 626 | 2022.01.19 20:08 |
450 | [Base] function selCom at 0x7f29c5c04aa0 | 푸딩뱃살 | 590 | 2022.01.19 17:24 |
449 | [Base] wireframe on shaded 단축키 만들기 | 푸딩뱃살 | 887 | 2022.01.04 10:55 |
448 | [오류] OpenCL Error | 푸딩뱃살 | 508 | 2021.12.28 01:40 |
447 | [Script] Easily Translate MEL Commands to Python | 푸딩뱃살 | 801 | 2021.12.02 11:22 |
446 | [Base] output window 띄우지 않기 | 푸딩뱃살 | 793 | 2021.11.24 21:44 |
445 | [Rigging] shapeEditorManager 삭제 안됨 | 푸딩뱃살 | 863 | 2021.11.12 23:30 |