Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error fixing #76

Merged
merged 2 commits into from
Nov 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions plugins/cinema4d/import_cast.pyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ from c4d import plugins, Vector, Vector4d, CPolygon, gui, BaseObject
PLUGIN_ID = 1062992
PLUGIN_RES_DIR = os.path.join(os.path.dirname(__file__), "res")

mxutils.ImportSymbols(PLUGIN_RES_DIR)

with mxutils.LocalImportPath(PLUGIN_RES_DIR):
from cast import Cast, CastColor, Model, Animation, Instance, File

Expand Down Expand Up @@ -190,17 +192,19 @@ def importModelNode(doc, node, model, path):
vnData = vnTag.GetDataAddressW()

for i in range(0, faceIndicesCount, 3):
vnTag.Set(vnData, int(i / 3),
Vector(vertexNormals[faces[i] * 3],
vertexNormals[(faces[i] * 3) + 1],
-vertexNormals[(faces[i] * 3) + 2]),
Vector(vertexNormals[faces[i] * 3],
vertexNormals[(faces[i] * 3) + 1],
-vertexNormals[(faces[i] * 3) + 2]),
Vector(vertexNormals[faces[i] * 3],
vertexNormals[(faces[i] * 3) + 1],
-vertexNormals[(faces[i] * 3) + 2]),
Vector(0, 0, 0))
vnTag.Set(vnData, int(i / 3),
{"a": Vector(vertexNormals[faces[i] * 3],
vertexNormals[(faces[i] * 3) + 1],
-vertexNormals[(faces[i] * 3) + 2]),
"b": Vector(vertexNormals[faces[i + 1] * 3],
vertexNormals[(faces[i + 1] * 3) + 1],
-vertexNormals[(faces[i + 1] * 3) + 2]),
"c": Vector(vertexNormals[faces[i + 2] * 3],
vertexNormals[(faces[i + 2] * 3) + 1],
-vertexNormals[(faces[i + 2] * 3) + 2]),
"d": Vector(0, 0, 0)})



newMesh.InsertTag(vnTag)

Expand Down