Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 3
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 456 times and has 2 replies Next Thread
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 790
Status: Offline
Reply to this Post  Reply with Quote 
Export using the name in the plan

This one might be relatively easy to implement (I hope):
When exporting a selection of objects name the g groups as named in the plan instead of the original object name. Preferably optional but set as the default.

For example a box when exported has 6 g lines like top_1, left_2, etc. Since the mtl reference (usemtl line) already identifies each side the g name is useless. What IS useful is naming the 6 sides using the name in the plan. Without changing a new box that would result in 6 lines like box_1, box_2, etc, each followed by the usemtl line for that side. Using this type of naming would allow a group of multiple boxes to be identified individually in the OBJ file by their g lines according to the names you assigned to each box. Currently 3 boxes in an export generates lines with top_, left_, etc. in triple no matter what names the boxes have in the plan. This can make it very difficult to distinguish one from the other when editing a large obj file. By using the name in the plan you can decide yourself if you want identical names or not.
[Aug 15, 2023, 5:19:13 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9182
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export using the name in the plan

Unfortunately, there's no notion of group in the 3D view, the reason why there is no information about them in the OBJ exported file. And even if this information was added, then there would be some problems to handle groups containing subgroups, because the OBJ format proposes the g tag but there's no end tag for a group.
By the way, I looked at the patch proposed by sjb007, but the changes he proposes are really too specific to his needs.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Aug 16, 2023, 4:28:51 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 790
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export using the name in the plan

I don't understand what export has to do with the 3D view.

I select one or more objects in the 2D pane and export these to an OBJ file. I can't verify it but I assume that the exporter receives an array containing the selected objects. The exporter iterates over the array and each object is written to the obj file. For a box that results in six 'g blocks', each starting with the g line. The g lines get the names bottom_?, left_?, etc. An exported shape has no names at all on the g lines, only numbers. The names 'bottom', 'left', etc. must come from somewhere. The only reference I can think of is the material names. If those are available then the name of the object itself should be available too (i.e 'Box' for a box).

From what I read about the ObjWriter class it writes 'Java 3D nodes'. Since I'm not familiar with Java I have no idea what exactly is a Java 3D node (I didn't get any wiser from the Java documentation), but to be able to write the selected object that object must be available, maybe as a property of the node instance?

What am I missing or what do I not understand?


Edit-To-Add:
After some further investigation I think I found where the g name comes from: the node name. Unfortunately I can't find where the node name is set so I can only guess if at that point the object name is available and can be set as the node name.
----------------------------------------
[Edit 1 times, last edit by Keet at Aug 17, 2023, 3:32:32 PM]
[Aug 16, 2023, 5:46:19 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved