Keyshot 7 - Changes to import "Kind", seems to break scripting.

Started by jwrender, August 23, 2017, 05:27:38 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jwrender

When importing models in KS 7 models are now imported with the "Kind: Model" type, this causes errors such as below :

Traceback (most recent call last):
  File "<string>", line 9, in <module>
Exception: Only a group can have children!


Preventing doing any scripting that request looping through model parts.

Both the below were imported with the same settings, one in KS6 on in KS7

Keyshot 7: <lux.SceneNode object at 0x36e8a08, name: "a014-pd008", kind: Model>
Keyshot 6: <lux.SceneNode object at 0x5a3e205, name: "a014-pd008", kind: Group>


Is this a bug? Or is there a way to convert from a model to a group in script?

Below is a script you can use to check:

res1 = lux.getSceneTree().find(name = "NAME-OF-IMPORTED-OBJECT")[0];
print(res1)
for ch in res1.getChildren():
    print("PARTS: {}".format(ch.getName()))


EDIT: If you import with KS6, open with KS7, the model kind is Group, so things work. But just not able to import and script both from KS7
EDIT2: Even groups created in KS7 via "Add Group" have a kind of "Model" . So not restricted to an import problem. But any groups created in keyshot 7, which would break most scripts i'm guessing!

p.s. sent a email to support too, just thought maybe someone here has any ideas!

Tobias04

I've got the exact same problem this breaks my script completyl ;[

jwrender

yeah still same issue in KS7.1, was told it was fixed in next release, but was told that about 7.1 too!