3DS Exporter Prefixes Object Names

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
xptical
Posts: 0
Joined: Sat May 12, 2007 5:34 am
Location: Hiroshima, Japan

3DS Exporter Prefixes Object Names

Post by xptical » Sat May 12, 2007 5:59 am

I'm doing models for a program called RealFlight. It's a RC model simulator that imports .KEX models.

They have, on the site, a 3ds2kex converter.

The problem is that in order to work properly, the objects have to have specific names.

~CS_Wing must be connected to ~CS_Fuselage. ~CS_Aileron must be connected via a pivot to ~CS_Wing.

I hope that makes sense.

Currently, blender's models must be opened in another program to name the parts.

The reason is that the 3ds Export script prefixes the object names with a "0".


Here's an example:

File >> New >> Erase All

F5 >> Name Object as "~CS_Box"

File >> Export >> 3DS


Now, open the file with 3D Studio or Deep Exploration. Or even re-open it with Blender.

The object will now be named 0~CS_Box.


How can I avoid this?

reD_Fox
Posts: 0
Joined: Sat Mar 12, 2005 2:56 pm
Location: Abilene, KS

Post by reD_Fox » Sat May 12, 2007 5:34 pm

Hello,

In order to correct this "problem," you need to locate and open the "3ds_export.py" script file in a text editor (I'm assuming you are still using Blender 2.43). Line 973 should be the following:

Code: Select all

object_chunk.add_variable("name", _3ds_string(str(i) + ob.name))
Change this to

Code: Select all

object_chunk.add_variable("name", _3ds_string(ob.name))
From what I can tell (I'm not familiar with the script, .3ds files, or anything related to .3ds files), this should correct the problem. This is assuming, of course, that a leading number is not necessary for the .3ds format. In other words, I can't guarantee the results, so let me know if there are further problems and I'll see if I can get someone who knows more than I do to take a look at the issue.

Levi
A three-legged stool never wobbles.

xptical
Posts: 0
Joined: Sat May 12, 2007 5:34 am
Location: Hiroshima, Japan

Post by xptical » Sat May 12, 2007 6:04 pm

Thanks. That worked like a champ.


Do you know why it was doing it that way to begin with?

reD_Fox
Posts: 0
Joined: Sat Mar 12, 2005 2:56 pm
Location: Abilene, KS

Post by reD_Fox » Sat May 12, 2007 6:10 pm

Do you know why it was doing it that way to begin with?
Yeah, it was to prevent duplicate names. The current CVS (and the upcoming Blender 2.44) will have this issue resolved.

Glad to be of assitance!

Levi
A three-legged stool never wobbles.

Post Reply