~wahn/rs-blender#2: 
Get ID.name using DNA

A lot of structs do use an ID entry. Let's get ID.name.

Blender 3.0.0:

...
ID 176
struct ID {
  void *next; // 8
  void *prev; // 8
  ID *newid; // 8
  Library *lib; // 8
  AssetMetaData *asset_data; // 8
  char name[66]; // 66
  short flag; // 2
  int tag; // 4
  int us; // 4
  int icon_id; // 4
  int recalc; // 4
  int recalc_up_to_undo_push; // 4
  int recalc_after_undo_push; // 4
  int session_uuid; // 4
  IDProperty *properties; // 8
  IDOverrideLibrary *override_library; // 8
  ID *orig_id; // 8
  void *py_instance; // 8
  LibraryWeakReference *library_weak_reference; // 8
}; // 176
...

Blender 2.79:

...
ID 120
struct ID {
  void *next; // 8
  void *prev; // 8
  ID *newid; // 8
  Library *lib; // 8
  char name[66]; // 66
  short flag; // 2
  short tag; // 2
  short pad_s1; // 2
  int us; // 4
  int icon_id; // 4
  IDProperty *properties; // 8
}; // 120
...
Status
RESOLVED FIXED
Submitter
~wahn
Assigned to
Submitted
5 months ago
Updated
3 months ago
Labels
task

~wahn 5 months ago*

Jan Walter referenced this ticket in commit 44bf207.

$ ./target/release/blend_info blend/factory_v279.blend | grep "ID\.name"
ID.name[66] = "CACamera"
$ ./target/release/blend_info blend/factory_v300.blend | grep "ID\.name"
ID.name[66] = "CACamera"

~wahn 5 months ago

Question: Does this resolve the ticket already, or should we clean up and try to solve the problem in a more general way?

~wahn 5 months ago

In the meantime we have an option to search for a struct name:

$ ./target/release/blend_info -h
blend_info 0.1.0
Print some information about a Blender scene file

USAGE:
    blend_info [FLAGS] [OPTIONS] <path>

FLAGS:
        --dna        Print information about Blender's DNA
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -n, --struct_name <struct-name>    Print information about a particular struct

ARGS:
    <path>    The path to the file to read

What we would like to have is the ability to use a . char to get from the struct Camera to the struct ID and get the name from there:

$ ./target/release/blend_info -n Camera.ID.name blend/factory_v279.blend

~wahn 5 months ago

Test, if the public key is used for emails ...

~wahn REPORTED FIXED 5 months ago

Jan Walter referenced this ticket in commit ef4a185.

~wahn 5 months ago

Jan Walter referenced this ticket in commit 44bf207.

~wahn 5 months ago

Jan Walter referenced this ticket in commit ef4a185.

~wahn 5 months ago

Jan Walter referenced this ticket in commit 44bf207.

~wahn 5 months ago

Jan Walter referenced this ticket in commit ef4a185.

~wahn 5 months ago

Jan Walter referenced this ticket in commit 44bf207.

~wahn 5 months ago

Jan Walter referenced this ticket in commit ef4a185.

~wahn 5 months ago

Jan Walter referenced this ticket in commit ef4a185.

~wahn 4 months ago

Jan Walter referenced this ticket in commit ef4a185.

~wahn 4 months ago

Jan Walter referenced this ticket in commit ef4a185.

~wahn CONFIRMED FIXED 3 months ago

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