io_scene_3ds: Hierarchy and parenting #104614

Closed
opened 2023-05-21 07:31:40 +02:00 by Sebastian Sille · 5 comments

The keyframer of the 3ds exporter was commented out since Blender version 2.42 because it crashes 3DS Max.
I thought it is time to bring it back again^^ #104613
I added the property to export animations and tested it with some very old 3ds max versions and it seems that the hierachy value for root objects, wich is -1 for an unsigned short, caused the crash.

Newer 3ds max versions are using other chunks for hierachy and parenting, older versions also using the parent_name chunk wich contains a hierachy tree with object names separated by a dot. The chunks wich are used are:

HIERARCHY = 0x4F00
PARENT_OBJECT = 0x4F10
PIVOT_OBJECT = 0x4F20
PIVOT_LIMITS = 0x4F30
PIVOT_ORDER = 0x4F40
PARENT_NAME = 0x80F0

I do not know yet how those chunks are working, the hierachy part is still commented out but animation export now works. If anyone knows how those chunks are used, I will add the hierachy part, for now keyframe export is optional.

The keyframer of the 3ds exporter was commented out since Blender version 2.42 because it crashes 3DS Max. I thought it is time to bring it back again^^ #104613 I added the property to export animations and tested it with some very old 3ds max versions and it seems that the hierachy value for root objects, wich is -1 for an unsigned short, caused the crash. Newer 3ds max versions are using other chunks for hierachy and parenting, older versions also using the parent_name chunk wich contains a hierachy tree with object names separated by a dot. The chunks wich are used are: `HIERARCHY = 0x4F00` `PARENT_OBJECT = 0x4F10` `PIVOT_OBJECT = 0x4F20` `PIVOT_LIMITS = 0x4F30` `PIVOT_ORDER = 0x4F40` `PARENT_NAME = 0x80F0` I do not know yet how those chunks are working, the hierachy part is still commented out but animation export now works. If anyone knows how those chunks are used, I will add the hierachy part, for now keyframe export is optional.
Sebastian Sille self-assigned this 2023-05-21 07:31:41 +02:00
Sebastian Sille added this to the Import/Export project 2023-05-21 07:31:41 +02:00

Is this really classified as a Known Issue? In that case, it would be good to follow the guidelines of a bug report, and provide, along with the description, steps to replicate a bug.

So it can properly be tagged as Confirmed.


As I see it, this looks like a Design task you plan to work on. But it also feels incomplete.
It must be made clear what has been or is being discussed (eg: TODO: [X] Check how chunks are working...).
Questions/discussions are usually done at blender.chat or DevTalk.

Is this really classified as a `Known Issue`? In that case, it would be good to follow the guidelines of a bug report, and provide, along with the description, steps to replicate a bug. So it can properly be tagged as `Confirmed`. --- As I see it, this looks like a `Design` task you plan to work on. But it also feels incomplete. It must be made clear what has been or is being discussed (eg: TODO: [X] Check how chunks are working...). Questions/discussions are usually done at [blender.chat](https://blender.chat/channel/blender-coders) or [DevTalk](https://devtalk.blender.org/c/blender).
Germano Cavalcante added the
Status
Needs Info from Developers
label 2023-05-22 22:52:56 +02:00
Author
Member

@mano-wii
It is mentioned in the code itself here and it is mentioned on various threads in blender stackexchange for example here

That was the reason why this is classified as a Known Issue, the keyframer was commented out since beginning and the main reason was because it crashes the 3ds max importer due to a negative unsigned short value. With leaving the hierachy part commented out it imports without crash. I found a 3ds keyframer description wich I attached here, where the parenting is well documented. Also a github script where all 3ds chunk definitions are listed, including the chunks I mentioned above

@mano-wii It is mentioned in the code itself [here](https://projects.blender.org/blender/blender-addons/src/commit/89f259bac2b2cd0aeb0c1464a7f39852e6adee48/io_scene_3ds/export_3ds.py#L1053) and it is mentioned on various threads in blender stackexchange [for example here](https://blender.stackexchange.com/questions/5421/export-3ds-file-with-pivot-point-in-blender) That was the reason why this is classified as a `Known Issue`, the keyframer was commented out since beginning and the main reason was because it crashes the 3ds max importer due to a negative unsigned short value. With leaving the hierachy part commented out it imports without crash. I found a 3ds keyframer description wich I attached here, where the parenting is well documented. Also a [github script](https://github.com/SiENcE/Iris1_DeveloperTools/blob/master/IrisEdit/3DS/Const3DS.pas) where all 3ds chunk definitions are listed, including the chunks I mentioned above
781 KiB

I'll confirm just to take it off the list of unclassified reports and therefore need to be triaged.

I'll confirm just to take it off the list of unclassified reports and therefore need to be triaged.
Germano Cavalcante added
Status
Confirmed
and removed
Status
Needs Info from Developers
labels 2023-05-22 23:47:41 +02:00
Author
Member

@mano-wii
thanks for that - I basically created this issue to gather more informations about the hierachy in 3ds files. I only tested it in 3ds max versions up to 2006 and not in newer versions, but the newer hierachy chunks where used since kinetix 3ds max version R1.1 from 1996

@mano-wii thanks for that - I basically created this issue to gather more informations about the hierachy in 3ds files. I only tested it in 3ds max versions up to 2006 and not in newer versions, but the newer hierachy chunks where used since kinetix 3ds max version R1.1 from 1996
Author
Member

My investigation in this topic has shown that the hierarchy chunk is a header for the other parenting chunks, wich looks like this:

HIERARCHY = 0x4F00
├─ PARENT_OBJECT = 0x4F10
├─ PIVOT_OBJECT = 0x4F20
├─ PIVOT_LIMITS  = 0x4F30
├─ PIVOT_ORDER  = 0x4F40
└─ XLATE_RANGE = 0x4F50

The chunks got introduced in 1999 and are not used by the DOS version. They are also not used by any IO script I found and since 3ds file format developing ended in 2001 I guess they simply got not implemented in any script. There was no special information about how they work, but it makes sense, that they work the same like the hierarchy in the keyframer section and the chunk ID indicates, that it is a subchunk of an object chunk. I implemented those chunks into the blender io_scene_3ds script, Blender can read them by default and write them optionally to preserve the object hierarchy if no keyframer is used.
This issue will be closed now

My investigation in this topic has shown that the hierarchy chunk is a header for the other parenting chunks, wich looks like this: ``` HIERARCHY = 0x4F00 ├─ PARENT_OBJECT = 0x4F10 ├─ PIVOT_OBJECT = 0x4F20 ├─ PIVOT_LIMITS = 0x4F30 ├─ PIVOT_ORDER = 0x4F40 └─ XLATE_RANGE = 0x4F50 ``` The chunks got introduced in 1999 and are not used by the DOS version. They are also not used by any IO script I found and since 3ds file format developing ended in 2001 I guess they simply got not implemented in any script. There was no special information about how they work, but it makes sense, that they work the same like the hierarchy in the keyframer section and the chunk ID indicates, that it is a subchunk of an object chunk. I implemented those chunks into the blender io_scene_3ds script, Blender can read them by default and write them optionally to preserve the object hierarchy if no keyframer is used. This issue will be closed now
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-06-09 12:46:01 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#104614
No description provided.