Revision: 44648 http://brlcad.svn.sourceforge.net/brlcad/?rev=44648&view=rev Author: starseeker Date: 2011-05-20 17:37:17 +0000 (Fri, 20 May 2011)
Log Message: ----------- Hrm. Don't want to do a straight-up copy if the tree avs - that's got NULLs, not actual values. Probably need to pull in the attributes from elsewhere, but this isn't quite right - it's looking at primitives and the attributes in question appear to be higher in the path. Modified Paths: -------------- brlcad/trunk/src/librt/tree.c Modified: brlcad/trunk/src/librt/tree.c =================================================================== --- brlcad/trunk/src/librt/tree.c 2011-05-20 17:31:20 UTC (rev 44647) +++ brlcad/trunk/src/librt/tree.c 2011-05-20 17:37:17 UTC (rev 44648) @@ -157,6 +157,8 @@ Tcl_HashTable *tbl = (Tcl_HashTable *)client_data; Tcl_HashEntry *entry; matp_t inv_mat; + struct bu_attribute_value_set avs; + struct bu_attribute_value_pair *avpp; RT_CK_DBI(tsp->ts_dbip); RT_CK_FULL_PATH(pathp); @@ -178,10 +180,18 @@ rp->reg_gmater = tsp->ts_gmater; rp->reg_los = tsp->ts_los; - bu_avs_init_empty(&(rp->attr_values)); - if (tsp->ts_attrs.count && tsp->ts_attrs.avp) { - bu_avs_merge(&(rp->attr_values), &(tsp->ts_attrs)); - } + dp = (struct directory *)DB_FULL_PATH_CUR_DIR(pathp); + if (dp) { + printf("name: %s\n", dp->d_namep); + bu_avs_init_empty(&avs); + if (!db5_get_attributes(tsp->ts_dbip, &avs, dp)) { + bu_avs_print(&avs, "db5_get_attribute results:"); + bu_avs_init_empty(&(rp->attr_values)); + for(BU_AVS_FOR(avpp, &(tsp->ts_attrs))) { + bu_avs_add(&(rp->attr_values), avpp->name, bu_avs_get(&avs, avpp->name)); + } + } + } rp->reg_mater = tsp->ts_mater; /* struct copy */ if (tsp->ts_mater.ma_shader) @@ -193,7 +203,6 @@ rp->reg_name = db_path_to_string(pathp); - dp = (struct directory *)DB_FULL_PATH_CUR_DIR(pathp); if (RT_G_DEBUG&DEBUG_TREEWALK) { bu_log("_rt_gettree_region_end() %s\n", rp->reg_name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits