~wahn/rs-blender#5: 
Material.emit and Blender version 3.0.0

Blender 2.79 did provide an emit parameter for materials:

$ ./target/release/blend_info -n Material blend/factory_v279.blend | grep emit
  float emit; // 4

Blender 3.0.0 does not have a parameter with that name:

$ ./target/release/blend_info -n Material blend/factory_v300.blend | grep emit

What could we use instead?

Status
RESOLVED FIXED
Submitter
~wahn
Assigned to
Submitted
4 months ago
Updated
3 months ago
Labels
task

~wahn 4 months ago

Jan Walter referenced this ticket in commit 1fa570a.

~wahn 4 months ago

Let's use the Cornell Box scene for testing:

$ ./target/release/blend_info -n Material.ID.name ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend 
Material.ID.name = "MAcbox"
Material.ID.name = "MAcbox_green"
Material.ID.name = "MAcbox_red"
Material.ID.name = "MAlarge_box"
Material.ID.name = "MALight"
Material.ID.name = "MAsmall_box"

Only one of the materials (Light) should use nodes:

$ ./target/release/blend_info -n Material.use_nodes ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend 
Material.use_nodes = 0
Material.use_nodes = 0
Material.use_nodes = 0
Material.use_nodes = 0
Material.use_nodes = 1
Material.use_nodes = 0

We can access the emit value, but we do not know how to get there (yet):

$ ./target/release/blend_info -n bNodeSocketValueFloat.value ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend
bNodeSocketValueFloat.value = 100_f32

Somehow we should be able to follow pointers:

$ ./target/release/blend_info -n Material ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend | grep nodetree
  bNodeTree *nodetree; // 8
$ ./target/release/blend_info -n bNodeTree ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend | grep nodes
  ListBase nodes; // 16
$ ./target/release/blend_info -n ListBase ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend
ListBase 16
struct ListBase { // SDNAnr = 2
  void *first; // 8
  void *last; // 8
}; // 16

I will provide some screenshots, how things can be seen within Blender 3.0.

~wahn 4 months ago

Instead of providing screenshots in the ticket, here a link to explain the problem in depth with some Blender screenshots and related shell commands using blend_info.

~wahn 4 months ago

Commit commit e4225291 allows to find e.g. data connected to objects (OB), like this:

# is Object.data pointing somewhere?
$ ./target/release/blend_info -n "Object.*data" ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend | grep "data = 0x"
Object.*data = 0x00070f08
Object.*data = 0x000712a0
Object.*data = 0x00071f84
Object.*data = 0x00072b78
Object.*data = 0x0007376c
Object.*data = 0x0007450c
Object.*data = 0x00075100
# get name ob objects
$ ./target/release/blend_info -n "Object.ID.name" ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend | grep 'Object.ID.name = "'
Object.ID.name = "OBCamera"
Object.ID.name = "OBcbox"
Object.ID.name = "OBcbox_green"
Object.ID.name = "OBcbox_red"
Object.ID.name = "OBlarge_box"
Object.ID.name = "OBLight"
Object.ID.name = "OBsmall_box"
# first pointer seems to be a camera (CA)
$ hexdump -C ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend | grep "^00070f0"
00070f00  01 00 00 00 00 00 00 00  43 41 00 00 40 02 00 00  |........CA..@...|
# next one is a mesh (ME)
$ hexdump -C ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend | grep "^000712a"
000712a0  4d 45 00 00 50 07 00 00  88 a0 5c 69 36 02 00 00  |ME..P.....\i6...|
# even the object called (OB)Light points to a mesh
$ hexdump -C ~/git/gitlab/rs-pbrt-test-scenes/blend/cornell_box_v3_00.blend | grep "^0007450"
00074500  14 00 00 00 04 00 00 00  00 00 00 00 4d 45 00 00  |............ME..|

~wahn 4 months ago

Jan Walter referenced this ticket in commit 1fa570a.

~wahn 4 months ago

Jan Walter referenced this ticket in commit 1fa570a.

~wahn REPORTED FIXED 4 months ago

The crate offers everything now (from the v0.2.5 release onwards) to handle the problem on the rs-pbrt side.

~wahn 4 months ago

Jan Walter referenced this ticket in commit 1fa570a.

~wahn CONFIRMED FIXED 3 months ago

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