Hi, I need to get the scene definition for a 3DM file, that contains the data about the objects, meshes and other information of the current open file. How do I do so?
All information that is stored in a 3dm file is located on a document object, or CRhinoDoc.
From a command, you can get the document as follows:
CRhinoCommand::result CCommandTest::RunCommand(const CRhinoCommandContext& context)
CRhinoDoc& doc = context.m_doc;
Does this help?
Yes, it does help, thank you!
I also have another question. You see, I was using the Asset Importer framework earlier, and there is a “root node” in the structure of the 3d model file. The root node contains all the objects in the 3d file, as its children nodes. So is the CRhinoDoc the same as this root node?
Or, does Rhino not follow this type of organization at all?
I also mean to ask, are the objects and their sub-objects(if any) are organized as parent-children structures or not?
Rhino doesn’t store stuff in a hierarchical manner. So I’m not sure this is a good analogy.
So if Rhino does not store its data in a hierarchical model.
Then, could you please tell me in what way does it store its data? It is now clear to me that the document holds data of the objects and the objects have their attributes and geometry. But I am still not fully transparent as to how the materials, meshes, etc are stored.
In short, what I want to say is could you show me a similar diagram like this:
And as always, thank you for your reply and your time
In the document, Rhino objects are stored in a linked list. Other data, such as Layers, Material, Groups, etc., are stored in linear tables. Rhino’s object attributes references items in these tables.