Development > Artwork

Scaling Question.

<< < (2/4) > >>

ManDrake13:
Thanks DarkRain! That got me past that export problem. It exported just fine this time. When I tried to load it in the game, I got the following error.


--- Code: ---"version" is "UFO: Alien Invasion 2.6-dev AMD64 Jun 28 2015 Linux DEBUG"
********************
ERROR: model models/weapons/minimedikit/minimedikit.md2 has invalid skin dimensions '0 x 0'
********************
failed to upload file '/home/ubuntu/.ufoai/2.6-dev/techmods_26_public/ufoconsole.log': Failed to open/read local data from file/application
failed to upload file '/home/ubuntu/.ufoai/2.6-dev/techmods_26_public/ufoconsole.log': Failed to open/read local data from file/application

--- End code ---

I just did the most basic steps, imported model with no Import Animation. Changed the scale for Y axis to be .5, and exported the model.

So I did an info on the md2 file to see what I could see.


--- Code: ---ubuntu@Ubuntu13:~/ufoai/mods/techmods_26/standalone/minimedikit/models
$ ~/ufoai/src/tools/md2.pl info minimedikit.md2
MD2 file found.
NumFrames: 1 (max is 512)
NumSkins: 1 (max is 32)
NumXYZ: 104 (max is 2048)
NumST: 95
NumTris: 158 (max is 4096)
NumGLcmds: 0
SkinWidth: 0
SkinHeight: 0
ubuntu@Ubuntu13:~/ufoai/mods/techmods_26/standalone/minimedikit/models
$ ~/ufoai/src/tools/md2.pl info ../../../../../base/models/weapons/medikit/medikit.md2
MD2 file found.
NumFrames: 1 (max is 512)
NumSkins: 1 (max is 32)
NumXYZ: 104 (max is 2048)
NumST: 148
NumTris: 158 (max is 4096)
NumGLcmds: 0
SkinWidth: 256
SkinHeight: 256

--- End code ---

And sure enough Skin width and height were set to zeros. I remembered from when I was reverse engineering the md2.pl script seeing something about skin sizes.


--- Code: ---ubuntu@Ubuntu13:~/ufoai/mods/techmods_26/standalone/minimedikit/models
$ ~/ufoai/src/tools/md2.pl skinsize minimedikit.md2
IN=OUT= "minimedikit.md2"
MD2 file found.
Changing skin sizes ...
Current size: 0w x 0h
Enter new width in pixel (0):128
Enter new height in pixel (0):256
Writing model to minimedikit.md2
ubuntu@Ubuntu13:~/ufoai/mods/techmods_26/standalone/minimedikit/models
$ ~/ufoai/src/tools/md2.pl info minimedikit.md2
MD2 file found.
NumFrames: 1 (max is 512)
NumSkins: 1 (max is 32)
NumXYZ: 104 (max is 2048)
NumST: 95
NumTris: 158 (max is 4096)
NumGLcmds: 0
SkinWidth: 128
SkinHeight: 256

--- End code ---

So I reloaded the game and this time, it came up a blue wireframe in the menus and Ufopedia, but as soon as I tried to load it on a character it would disappear. I remembered your comment about not scaling the texture, so I went back again and redid the same steps above but this time, I set the skinsize to be 256x256 instead, but it yielded the same results even with an unmodified copy of the medikit image. A blue wireframe image instead, which is exactly the size I imagined in the beginning, so I think it's just the skin wrapping part that I'm doing wrong.

DarkRain:
Well at least some progress...

It seems that the wrong skin size is because Blender couldn't load the model's texture and thus on exporting the size was set to zero, I'll need to check if that's a problem with the importer...

As for the blue wireframe, some posibilities: Maybe the game can't load the texture for some reason? Are there any warning/error messages in the log (or console output)? Did you end trying to unwrap the model or edit the UV map?

ManDrake13:
That was my first thought too, but there is nothing in the log about a texture failure for the minimedikit. I attached the game log, that I ran with the minimedikit enabled as the only mod using +set developer 1 to turn on the additional debugging information. I see the Actor skin warnings, but those have been hanging around for a while now on 2.6, they haven't seemed to cause any adverse affects to playing the game.

No, I didn't unwrap or anything. This was created with literally the three steps I list, import uncheck Import Animation like you said, I did the n thing that Noordung mention to bring up the scaling menu faster, I put in the .5 for Y in the scaling section, and then literally just exported. The check box was already unchecked in that case. Here is the command console results that came out of Blender when I did this.


--- Code: ---ubuntu@Ubuntu13:~/blender-2.73a-linux-glibc211-x86_64
$ ./blender
connect failed: No such file or directory
Read new prefs: /home/ubuntu/.config/blender/2.73/config/userpref.blend
found bundled python: /home/ubuntu/blender-2.73a-linux-glibc211-x86_64/2.73/python
Reading: /home/ubuntu/ufoai/mods/techmods_26/standalone/minimedikit/models/minimedikit.md2....Done
CustomData_copy_data_layer: warning null data for CDMTFace type ((nil) --> 0x7f1ffd00e008), skipping
Creating mesh.....Done
Model imported
minimedikit:  ('104 vertices', '158 faces')
Export progress: 100% - Model exported.
Saved session recovery to '/tmp/quit.blend'

Blender quit


--- End code ---

I didn't notice the warning message there before, because it exported successfully. Maybe that's the problem, because that's in the importer execution like you suspected.

DarkRain:
Please try the most recent md2 plugin from the repo, the problem was the incorrect skin size on import: since skin size is used to calculate the UV map on export and thus it was nuked (multiplied by the zeroed skin size)

The new version of the addon should try harder to load the texture when importing and if everything else fails will set a default skin size on export so the UV map isn't all zeroes

(Animation export issues not fixed yet)

ManDrake13:
No luck. I did a git pull


--- Code: ---ubuntu@Ubuntu13:~/ufoai
$ git pull
remote: Counting objects: 40, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 31 (delta 22), reused 0 (delta 0)
Unpacking objects: 100% (31/31), done.
From git://git.code.sf.net/p/ufoai/code
   707f219..7aa7b56  master     -> origin/master
Updating 707f219..7aa7b56
Fast-forward
 src/client/cgame/campaign/cp_missions.cpp |  2 +-
 src/tools/blender/io_mesh_md2.py          | 26 +++++++++++++++++++-------
 2 files changed, 20 insertions(+), 8 deletions(-)

--- End code ---

and installed the script again.


--- Code: ---ubuntu@Ubuntu13:~/blender-2.73a-linux-glibc211-x86_64
$ ./blender
connect failed: No such file or directory
Read new prefs: /home/ubuntu/.config/blender/2.73/config/userpref.blend
found bundled python: /home/ubuntu/blender-2.73a-linux-glibc211-x86_64/2.73/python
reloading addon: io_mesh_md2 1435408318.457492 1435691440.972961 /home/ubuntu/.config/blender/2.73/scripts/addons/io_mesh_md2.py
Modules Installed from '/home/ubuntu/ufoai/src/tools/blender/io_mesh_md2.py' into '/home/ubuntu/.config/blender/2.73/scripts/addons' ()
trying to save userpref at /home/ubuntu/.config/blender/2.73/config/userpref.blend ok
Reading: /home/ubuntu/ufoai/mods/techmods_26/standalone/minimedikit/models/minimedikit.md2....Done
CustomData_copy_data_layer: warning null data for CDMTFace type ((nil) --> 0x7f38d6806008), skipping
Creating mesh.....Done
Animating - progress: 100%.
Model imported
Saved session recovery to '/tmp/quit.blend'

Blender quit

--- End code ---

Same warning.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version