Skip to content

Commit 4c53caa

Browse files
author
Graphos
committed
call_uv_command r21 support
1 parent 62eda37 commit 4c53caa

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

scripts/05_modules/bodypaint/call_uv_command_r18_r20.py renamed to scripts/05_modules/bodypaint/call_uv_command_r18.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
Compatible:
1313
- Win / Mac
14-
- R18, R19, R20
14+
- R18, R19, R20, R21
1515
"""
1616
import c4d
1717

@@ -21,7 +21,11 @@ def main():
2121
if op is None:
2222
raise ValueError("op is none, please select one object.")
2323

24-
# Retrieves active UVSet, The UV windows need to be opened at least one time.
24+
# Enables UV Polygon Mode if not already in any UV mode (needed for GetActiveUVSet to works)
25+
if doc.GetMode() not in [c4d.Muvpoints, c4d.Muvpolygons]:
26+
doc.SetMode(c4d.Muvpolygons)
27+
28+
# Retrieves active UVSet, The UV windows need to be opened at least one time
2529
handle = c4d.modules.bodypaint.GetActiveUVSet(doc, c4d.GETACTIVEUVSET_ALL)
2630
if handle is None:
2731
raise RuntimeError("There is no Active UVSet, lease open at least one time the Texture View.")
@@ -52,7 +56,7 @@ def main():
5256
# Retrieves UVW list
5357
uvw = handle.GetUVW()
5458
if uvw is None:
55-
raise RuntimeError("Failed to retrieve the uvw from the the texture view.")
59+
raise RuntimeError("Failed to retrieves the uvw from the the texture view.")
5660

5761
# Calls UVCOMMAND_TRANSFORM to change UVW list
5862
ret = c4d.modules.bodypaint.CallUVCommand(handle.GetPoints(),

scripts/05_modules/bodypaint/readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ Classic API:
1414

1515

1616
### call_uv_command
17-
Version: R18, R19, R20 - Win/Mac
17+
Version: R18, R19, R20, R21 - Win/Mac
1818

1919
Calls BodyPaint 3D UV commands.
2020

21-

0 commit comments

Comments
 (0)