Closed mlimper closed 10 years ago
USE attribute must be set before adding node to tree.
And BTW, please update also x3dom regularily, at least once a day.
The bug you just fixed in X3DOM (_x3domNode undefined) was after the issue occured, so there was no chance to see how it works, because I always had the error console switched on, where there was a break for both cases, setting "USE" before and setting "USE" after adding the node to the tree. I tried both because I guessed it must be something like this.
Anyway, thanks for the quick help!
I am sorry I have to bother you again: The solution is not really working, after adding multiple elements you have another bug: https://github.com/x3dom/x3dom/issues/220
For the example, I have just inserted a
console.log("Primitive with ID " + id + " picked!");
In the "primitivePicked" function of "PrimitiveManager.js", in line 750.
(I assume this is an X3DOM issue, therefore it was filed it in the X3DOM issue tracker.)
Known issue, can't fix this, each Shape has one unique id.
Can we continue discussing in the X3DOM thread? I'll post my answer over there.
@yjung could you take a brief look at this? I have marked the code which is affected: https://github.com/x3dom/apps-modeling/blob/master/editor/plant_editor/js/Component.js#L61
You can change the commented section to use version A (the DEF/USE version), launch the plant editor and check the DOM elements of the page - in my understanding it should actually work like this.
Did I maybe forget something important?
Thanks a lot in advance.