Skip to content

Commit

Permalink
more ws cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
brlcad committed Jan 4, 2025
1 parent 3cbdf8d commit 0abd63c
Show file tree
Hide file tree
Showing 5 changed files with 470 additions and 471 deletions.
30 changes: 15 additions & 15 deletions src/librt/attributes.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,21 +339,21 @@ db5_update_attributes(struct directory *dp, struct bu_attribute_value_set *avsp,
*/
const char *material_name = bu_avs_get(avsp, "material_name");
if (material_name != NULL && !BU_STR_EQUAL(material_name, "(null)") && !BU_STR_EQUAL(material_name, "del")) {
struct directory *material_dp = db_lookup(dbip, material_name, LOOKUP_QUIET);
if (material_dp != RT_DIR_NULL) {
struct rt_db_internal intern;
struct rt_material_internal *material_ip;
if (rt_db_get_internal(&intern, material_dp, dbip, NULL, NULL) >= 0) {
if (intern.idb_minor_type == DB5_MINORTYPE_BRLCAD_MATERIAL) {
material_ip = (struct rt_material_internal *) intern.idb_ptr;
const char *id_string = bu_avs_get(&material_ip->physicalProperties, "id");
// the material_id will only be set if the material object has an id field set
if (id_string != NULL) {
bu_avs_add(avsp, "material_id", id_string);
}
}
}
}
struct directory *material_dp = db_lookup(dbip, material_name, LOOKUP_QUIET);
if (material_dp != RT_DIR_NULL) {
struct rt_db_internal intern;
struct rt_material_internal *material_ip;
if (rt_db_get_internal(&intern, material_dp, dbip, NULL, NULL) >= 0) {
if (intern.idb_minor_type == DB5_MINORTYPE_BRLCAD_MATERIAL) {
material_ip = (struct rt_material_internal *) intern.idb_ptr;
const char *id_string = bu_avs_get(&material_ip->physicalProperties, "id");
// the material_id will only be set if the material object has an id field set
if (id_string != NULL) {
bu_avs_add(avsp, "material_id", id_string);
}
}
}
}
}

bu_avs_merge(&old_avs, avsp);
Expand Down
Loading

0 comments on commit 0abd63c

Please sign in to comment.