OBJ: Add hierarchy support by name splitting (Python patch provided) #105001

Closed
opened 2023-02-21 02:11:48 +01:00 by Stephen Boddy · 6 comments

From:
https://archive.blender.org/developer/D16095

Gentle reminder for @aras_p regarding the enhancement I posted Python code for into that old phapricator differential. Aras said he would look into reimplementing it in C++ as the Python importer was now legacy, but that was a while ago. I suspect it has slipped off his radar.

Essentially adds an optional seperator char and option so that a .obj with lots of 'o' can be split into a structured hierarchy.

Obviously belongs in the "Pipeline, Assets & I/O" project.

From: https://archive.blender.org/developer/D16095 Gentle reminder for @aras_p regarding the enhancement I posted Python code for into that old phapricator differential. Aras said he would look into reimplementing it in C++ as the Python importer was now legacy, but that was a while ago. I suspect it has slipped off his radar. Essentially adds an optional seperator char and option so that a .obj with lots of 'o' can be split into a structured hierarchy. Obviously belongs in the "Pipeline, Assets & I/O" project.
Stephen Boddy changed title from Add hierarchy to C++ obj importer D16095 to Add hierarchy to C++ obj importer (D16095) 2023-02-21 02:12:07 +01:00
Member

Hi, thanks for bringing this up. Though Tracker is the place for blender related bugs.
I'll close this ticket since it's not a bug. Please contact Aras in #blender-coders for further support/questions.

Hi, thanks for bringing this up. Though Tracker is the place for blender related bugs. I'll close this ticket since it's not a bug. Please contact Aras in [#blender-coders](https://blender.chat/channel/blender-coders) for further support/questions.
Pratik Borhade added the
Severity
Normal
Status
Archived
labels 2023-02-21 04:34:08 +01:00
Author

Sorry if I've misunderstood here. I try not to abuse ticket systems as I've been on both ends. I thought all the old phabricator "Tasks" were turned into github tickets, but it seems like I've misunderstood. Chat channels are OK for chat, but how are devs now tracking tasks?

Sorry if I've misunderstood here. I try not to abuse ticket systems as I've been on both ends. I thought all the old phabricator "Tasks" were turned into github tickets, but it seems like I've misunderstood. Chat channels are OK for chat, but how are devs now tracking tasks?
Member

Hi, yes, all Phab reports are now on Gitea.
On Phab you had submitted the diff, not the report. If you want to work on it, feel free to open a new report on gitea and mark it as a design/todo. But since Aras had started working on it, I'd ask Aras first whether this improvement is still under his radar and whether he needs a separate report to track the progress.

Hi, yes, all Phab reports are now on Gitea. On Phab you had submitted the diff, not the report. If you want to work on it, feel free to open a new report on gitea and mark it as a design/todo. But since Aras had started working on it, I'd ask Aras first whether this improvement is still under his radar and whether he needs a separate report to track the progress.
Blender Bot added
Status
Needs Triage
and removed
Status
Archived
labels 2023-02-22 08:20:24 +01:00
Aras Pranckevicius added this to the Pipeline, Assets & IO project 2023-02-22 08:21:25 +01:00
Aras Pranckevicius self-assigned this 2023-02-22 08:21:37 +01:00
Aras Pranckevicius changed title from Add hierarchy to C++ obj importer (D16095) to OBJ: Add hierarchy support by name splitting (Python patch provided) 2023-02-22 08:22:19 +01:00

I reopened, changed to ToDo, assigned to myself. The old discussion slipped from my radar indeed.

I reopened, changed to ToDo, assigned to myself. The old discussion slipped from my radar indeed.
Author

Hi Aras. I got a little tired of waiting, so I rolled up my sleeves and had a go. How hard can it be? Well, very... because I haven't touched C++ since university 30 years ago and this was a lot of trial and error. This code works perfectly for my purposes. You can of course refactor and tweak it as you see fit. There are two things I see could be improved.

  1. I couldn't figure a way to get the COLLECTION_SEPARATOR into the needed place without butchering the existing function/method parameters, so it is defined right there in the blender::io::obj namespace. There is probably a better way.
  2. The Path Separator option does not work together with Split By Group on my example file, just creating the usual flat structure. I could change my other programs exporter to make the 'g' lines have a full path too.

I've only tested this with the sample house file in the D16095 issue, with no errors. I don't have other complex obj files to test with. I'm thinking of ones with GEOM_CURVE type objects mixed with GEOM_MESH type ones.

It would be great if you could review it, and maybe let me know where I did dumb things. Cheers!

[Edit: It also has no negative performance impact (maybe even a slight improvement) as path separated processing of the house was consistently a tiny bit quicker.]

Hi Aras. I got a little tired of waiting, so I rolled up my sleeves and had a go. How hard can it be? Well, very... because I haven't touched C++ since university 30 years ago and this was a _lot_ of trial and error. This code works perfectly for my purposes. You can of course refactor and tweak it as you see fit. There are two things I see could be improved. 1. I couldn't figure a way to get the COLLECTION_SEPARATOR into the needed place without butchering the existing function/method parameters, so it is defined right there in the blender::io::obj namespace. There is probably a better way. 2. The Path Separator option does not work together with Split By Group on my example file, just creating the usual flat structure. I could change my other programs exporter to make the 'g' lines have a full path too. I've only tested this with the sample house file in the D16095 issue, with no errors. I don't have other complex obj files to test with. I'm thinking of ones with GEOM_CURVE type objects mixed with GEOM_MESH type ones. It would be great if you could review it, and maybe let me know where I did dumb things. Cheers! [Edit: It also has no negative performance impact (maybe even a slight improvement) as path separated processing of the house was consistently a tiny bit quicker.]

Implemented in #115742

Implemented in #115742
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-12-04 09:55:28 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#105001
No description provided.