~wahn/rs-blender#3: 
[bug] calc_mem_tlen reports wrong size

calc_mem_tlen(...) reports wrong size for struct Object:

$ ./target/release/blend_info blend/factory_v279.blend | grep "struct Object {" -B 1
Object 1440
struct Object {
$ ./target/release/blend_info blend/factory_v279.blend | grep "\}; //"
}; // 1200
Status
RESOLVED FIXED
Submitter
~wahn
Assigned to
Submitted
5 months ago
Updated
3 months ago
Labels
bug

~wahn 5 months ago

It looks like there are 5 matrices (e.g. obmat[4][4]) which are not counted correctly ...

~wahn REPORTED FIXED 5 months ago

Jan Walter referenced this ticket in commit 98e7e5d.

~wahn FIXED REPORTED 5 months ago

~wahn 5 months ago

calc_mem_tlen(...) reports wrong size for struct Lamp:

$ ./target/release/blend_info blend/factory_v279.blend | grep Lamp
  Lamp (len=536) {
Lamp 536
struct Lamp {
...
$ ./target/release/blend_info blend/factory_v279.blend
...
}; // 400
thread 'main' panicked at 'assertion failed: counter == type_tlen', src/bin/blend_info.rs:53:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

~wahn 5 months ago

I think this line is calculated wrong:

$ ./target/release/blend_info blend/factory_v279.blend
...
  MTex *mtex[18]; // 8
...

It should be 18 * 8 for 18 pointers to a MTex.

~wahn REPORTED FIXED 5 months ago

Jan Walter referenced this ticket in commit a2369bf.

~wahn 5 months ago

Jan Walter referenced this ticket in commit 98e7e5d.

~wahn 5 months ago

Jan Walter referenced this ticket in commit a2369bf.

~wahn 5 months ago

Jan Walter referenced this ticket in commit 98e7e5d.

~wahn 5 months ago

Jan Walter referenced this ticket in commit a2369bf.

~wahn 5 months ago

Jan Walter referenced this ticket in commit 98e7e5d.

~wahn 5 months ago

Jan Walter referenced this ticket in commit a2369bf.

~wahn 5 months ago

Jan Walter referenced this ticket in commit 98e7e5d.

~wahn 5 months ago

Jan Walter referenced this ticket in commit a2369bf.

~wahn 4 months ago

Jan Walter referenced this ticket in commit a2369bf.

~wahn FIXED REPORTED 4 months ago

For Blender 3.0.0 the expected Image size is 1576:

$ ./target/release/blend_info --dna blend/factory_v300.blend | grep " Image ("
  Image (len=1576) {

But summing up all member struct/data sizes is wrong (and will panic):

$ ./target/release/blend_info -n Image blend/factory_v300.blend
...
}; // 1528
thread 'main' panicked at 'assertion failed: counter == type_tlen', src/bin/blend_info.rs:154:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

~wahn REPORTED FIXED 4 months ago

Jan Walter referenced this ticket in commit d460e51.

~wahn 4 months ago

Jan Walter referenced this ticket in commit d460e51.

~wahn 4 months ago

Jan Walter referenced this ticket in commit d460e51.

~wahn 4 months ago

Jan Walter referenced this ticket in commit d460e51.

~wahn 4 months ago

Jan Walter referenced this ticket in commit d460e51.

~wahn 4 months ago

Jan Walter referenced this ticket in commit d460e51.

~wahn CONFIRMED FIXED 3 months ago

Register here or Log in to comment, or comment via email.