Community
DWF
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Retrieving Object Names

6 REPLIES 6
Reply
Message 1 of 7
TheUnknown
1141 Views, 6 Replies

Retrieving Object Names

Hi all,

Following the code in ObjectDefinitionReader I managed to read object names but as it turns out I'm having a very hard time finding a way to actually map those names to the objects, i.e. finding what name belongs to what object. I read somewhere in the forum where Grarrick had pointed out that the key lies in TKE_Tag opcodes and these tags can be used for such later mappings, but I can't figure out how to use these tags. I was wondering if he or anyone else can point me the right direction and maybe some implementation details. Any helps would be greatly appreciated.
6 REPLIES 6
Message 2 of 7
jasona
in reply to: TheUnknown

Hi TheUnknown,

What I do is as follows:
The DWFDefinedObjectInstance->name() corresponds to the hoops TKE_Open_Segment Handler "GetSegment"

Basically I create a map of DWFDefinedObjectInstance->name() to all the properties, and as I process the Hoops Scene Graph, in eash OpenSegment::Execute function, lookup the map with the value returned by GetSegment();

If you want the 2d Whip location for the mapping, set a action event for set_object_node_action, and in the first parameter of the callback is WT_Object_Node, which has a object_node_name(), and voila, this corresponds back to the map I created.

Now regarding the hoops scenegraph, some contain libraries at the front of the scenegraph, and you will have to not assign details to these, but later on, transpose them to the correct location, and then assign the properties. ie "?Include Library" indicates the start of the include library. See the hoops documentation for more details regarding this. I just thought I would warn you on some of the pitfuls I hit as trying to figure all this out.

I Hope this helps.

Cheers
Jason
Message 3 of 7
TheUnknown
in reply to: TheUnknown

Thank you very much for the reply Jason .

The include libraries are exactly another problem I'm currently facing. I thought I would construct a map of segment names (acquired via GetSegment()) and object properties in the TKE_Open_Segment handler and then in each pass of TKE_Include_Segment search that map and find the pair that this TKE_Include_Segment references, and then copy the properties into it, but as it turns out, this doesn't work correctly. Maybe I should review some parts.

I try to implement your method names.

Thanks again.
Message 4 of 7
TheUnknown
in reply to: TheUnknown

By the way, does anybody know under what circumstances 3DS Max or other modeling packages that support DWF generate TKE_Include_Segment opcodes. I thought maybe if I know the situations in which this opcode is generated, maybe I can totally avoid them.

Thanks in advance.
Message 5 of 7
jasona
in reply to: TheUnknown

I have some autodesk inventor published dwfs that contain TKE_Include_Segments. So I guess if you can get access to inventor, and publish to dwf 3d, you should be able to create dwf's that contain this opcode.

Cheers
Jason Anderssen
Message 6 of 7
varadd
in reply to: jasona

HI all,

 

I have tried to followed same procidure but i am not able to get DWFObjectDefiantion any component (except one given in ObjectDefinitionReader sample).Plese find details on :

 

http://forums.autodesk.com/t5/DWF/failed-to-get-ObjectDefinition-to-traverse-through-complete-tree/t...

 

 

(Sorry for spamming, i am replying here to reach you all quickly.. since this is where my whole project got struct)...

 

Is there any other way to map Include Segment number with DWF Data. I have even tried Content Defination -> DWFInstance but failed to map data since both nodeID from instance & include seg id are different.

 

am i missing some thing in whole process. Attached sample code on above post. Please help me out.

 

Thanks in advance.

 

-Varad

Message 7 of 7
SilviaCao
in reply to: varadd

Thank you for your question.

 

For 3D DWF, DWF Toolkit uses the opcode TKE_Tag to map an instance. The TKE_Tag count equals the instance node id. Then the named segment which includes the TKE_Tag will be mapped to the instance.

 

DWF Toolkit provides Object Definition and Content Definition (see sample ReadContentDefinition in DWF Toolkit) to record the instances. For the attached file “Blower_Frame.dwf”, instances are stored in Content Definition.

 

Please let me know if you have any further questions.

 

Silvia

ADR/DWF Customer Support



Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services