DragonFF icon indicating copy to clipboard operation
DragonFF copied to clipboard

Issue with importing GTA III "peds.dff" file

Open dorbalazs opened this issue 1 year ago • 1 comments

Hello!

I have seen quite a couple of issues (for example this one ) here that just copied the python stacktrace for this issue: UnboundLocalError: local variable 'num_anims' referenced before assignment .

I came accross this when trying to import the GTA III file called peds.dff . ( Located in [root]/models/Generic/ .)

I have fixed it in a hackish way (basically assigning num_anims a default value of zero when this function runs with a chunk with unexpected format): (in dff.py)

num_anims = unpack_from("<I", self.data, self._read(4))[0] if chunk.type == types["Struct"] else 0

which implies that there is a difference between the format that the program expects peds.dff to be and the actual format of the file. Doing this isn't enough though, because now for some reason only the heads of the pedestrians show up... Arms and legs appear in the overview of the object hierarchy, but are not displayed in the model space.

My blender and .dff file knowledge is limited, but having read the GTA wiki, only the loplyguy.dff file is mentioned as a file with a significantly different layout.

If there's a need, with time I could probably solve this issue, but I wanted to get your input on this first.

Thank you for reading this!

dorbalazs avatar Mar 17 '24 19:03 dorbalazs

Hello!

I have seen quite a couple of issues (for example this one ) here that just copied the python stacktrace for this issue: UnboundLocalError: local variable 'num_anims' referenced before assignment .

I came accross this when trying to import the GTA III file called peds.dff . ( Located in [root]/models/Generic/ .)

I have fixed it in a hackish way (basically assigning num_anims a default value of zero when this function runs with a chunk with unexpected format): (in dff.py)

num_anims = unpack_from("<I", self.data, self._read(4))[0] if chunk.type == types["Struct"] else 0 which implies that there is a difference between the format that the program expects peds.dff to be and the actual format of the file. Doing this isn't enough though, because now for some reason only the heads of the pedestrians show up... Arms and legs appear in the overview of the object hierarchy, but are not displayed in the model space.

My blender and .dff file knowledge is limited, but having read the GTA wiki, only the loplyguy.dff file is mentioned as a file with a significantly different layout.

If there's a need, with time I could probably solve this issue, but I wanted to get your input on this first.

Thank you for reading this!

If you save the file using rw_analyze before opening it in Blender, it won’t produce any errors upon loading.

MadGamerHD avatar Jul 11 '25 18:07 MadGamerHD