Import issue

When using Ragdoll’s Import Physics on an imported object, I get an error on Create Missing Transforms. If I do Import Physics directly to the referenced scene, it works fine. Is there something wrong with the operation?

// ragdoll._create_missing_transforms() - Creating missing transforms…
// Warning: ragdoll._import_physics_wrapper() - Traceback (most recent call last):
// File “C:\Users\UserName\Documents\maya\modules\Ragdoll-2023_04_06\scripts\ragdoll\vendor\cmdx_ragdoll.py”, line 6840, in createNode
// mobj = self._modifier.createNode(type, parent)
// TypeError: parent is not a transform type
//
// During handling of the above exception, another exception occurred:
//
// Traceback (most recent call last):
// File “C:\Users\UserName\Documents\maya\modules\Ragdoll-2023_04_06\scripts\ragdoll\interactive.py”, line 4202, in _import_physics_wrapper
// _singleton_import_loader.reinterpret()
// File “C:\Users\UserName\Documents\maya\modules\Ragdoll-2023_04_06\scripts\ragdoll\internal.py”, line 480, in _undo_chunk
// return func(*args, **kwargs)
// File “C:\Users\UserName\Documents\maya\modules\Ragdoll-2023_04_06\scripts\ragdoll\dump.py”, line 751, in reinterpret
// self._create_missing_transforms()
// File “C:\Users\UserName\Documents\maya\modules\Ragdoll-2023_04_06\scripts\ragdoll\dump.py”, line 804, in _create_missing_transforms
// transform = mod.create_node(“transform”,
// File “C:\Users\UserName\Documents\maya\modules\Ragdoll-2023_04_06\scripts\ragdoll\vendor\cmdx_ragdoll.py”, line 5710, in decorator
// return func(self, *args, **kwargs)
// File “C:\Users\UserName\Documents\maya\modules\Ragdoll-2023_04_06\scripts\ragdoll\vendor\cmdx_ragdoll.py”, line 6843, in createNode
// raise TypeError(“‘%s’ is not a transform type,” % parent)
// TypeError: ‘<OpenMaya.MObject object at 0x000001DACDEDD570>’ is not a transform type,
// Warning: ragdoll._import_physics_wrapper() - An unexpected error occurred, see Script Editor

This was tried in a very simple scene to limit the problem. The tiger tutorial could not proceed successfully due to the same problem.

Hm, thanks for reporting this, it looks like a bug.

To help me narrow this down, would it be possible to follow these steps and confirm you are getting the same results?

  1. Create new scene
  2. Create box
  3. Assign
  4. Export
  5. Delete all Physics
  6. Import, with Create Missing Transforms ticked

There were no issues encountered. I guess this problem occurs when using Import Physics while having imported a .mb file. In the image above, “test3:*” corresponds to that. Importing to the main .mb file of test3 does not cause any issues.

Moreover, even when importing to test3, there will be no errors as long as Create Missing Transform is not used. However, this method has its drawbacks, as it does not allow for the import of elements like rGround and Pin.

Pins will be imported regardless, but the ground would not. One option is to make a new ground (it’s just a polyPlane).

Interesting, if you can send this scene we can try and take a closer look!

I will share the cases where it works and where it doesn’t.

There are two folders: importTest and importTest2. In each folder, there is a scene.mb file. These are scenes that have only imported cube.mb and cylinder.mb, respectively. Cube.mb is a simple cube, and cylinder.mb is an object with several joints.

In importTest, it is possible to import importTest.rag using Create Missing Transform in both scene.mb and cube.mb.

In importTest2, importing is not possible in scene.mb, but it is possible in cylinder.mb.

importTest.zip (228.3 KB)

Thank you for this, I’m able to reproduce the issue here and am investigating now!

1 Like

I’ve released a new version now with a fix for this!