Print at Dec 20, 2025, 3:19:28 AM
Posts: 25   Pages: 3   [ Previous Page | 1 2 3 ]
View all posts in this thread on one page
Posted by sjb007 at Jun 22, 2022, 4:57:00 PM
Re: Add "o" to OBJWriter output
@Daniels118 Oh, and if you could look at the java changes and tell me all the Java conventions I blew through, I'd appreciate it.

Posted by Daniels118 at Jul 9, 2022, 7:55:57 PM
Re: Add "o" to OBJWriter output
Sorry for late response. I looked at the changes and they seems ok, but you know it's up to Emmanuel to decide wether to merge or not into the main stream.
If you decide to make it a plugin you could consider to override the OBJWriter instead of duplicate the whole code. This is how I managed to obtain this result for another project I'm working on:
public class LDObjWriter extends OBJWriter {
private boolean firstNode = true;
private boolean separateObjects = false;

public boolean isSeparateObjects() {
return separateObjects;
}

public void setSeparateObjects(boolean separateObjects) {
this.separateObjects = separateObjects;
}

@Override
public void writeNode(Node node) throws IOException, InterruptedIOException {
writeNode(node, null);
}

@Override
public void writeNode(Node node, String nodeName) throws IOException, InterruptedIOException {
if (firstNode) {
super.writeNode(null, null);
firstNode = false;
}
if (separateObjects && nodeName != null && !nodeName.isEmpty()) {
this.out.write("o " + nodeName + "\n");
}
super.writeNode(node, nodeName);
}

public void newObject(String name) throws IOException {
if (firstNode) {
super.writeNode(null, null);
firstNode = false;
}
this.out.write("o " + name + "\n");
separateObjects = false;
}
}


Posted by Keet at Jul 9, 2022, 9:00:57 PM
Re: Add "o" to OBJWriter output
Last week I discovered the usefulness of the o line in an obj file. I had to bisect a complex set of objects and I couldn't do that because all of the g groups and no o object. So I added the line manually and it still didn't work until I flagged all g lines as remarks. That gave a single object in Blender but of course had the disadvantage of no more g groups.

Rereading the posts in this thread I went looking for the gear to change settings when importing and after I switched of groups just the o line was enough to allow selection of a single object, which I needed for bisecting and still retain the g groups.

Big vote here to add o line(s) to the obj export. I manage to create very complex furniture with just SH3D but there a few things it can't do that sometimes are needed.
----------------------------------------
Dodecagon.nl
1300+ 3D models, manuals, and projects

Posted by sjb007 at Dec 11, 2022, 8:33:09 PM
Re: Add "o" to OBJWriter output
@Daniels118 "Resurrectus threadius!"

I've picked this back up, got Eclipse installed, done the plugin tutorial, and have a vague idea how I can turn this into a plugin.

As I said <points at self> clueless Javamateur. I had a look at a couple of plugins, and I see yours looking all purty! You have a bunch of the boilerplate stuff all squared away. Can I ask your permission to shamelessly and liberally borrow that stuff and adapt it for my needs? It will save me a ton of time scratching my head that can be better spent getting the meat of the plugin to work.

Posted by Daniels118 at Dec 12, 2022, 10:01:58 PM
Re: Add "o" to OBJWriter output
Hi Stephen, all my plugins are licensed under GPL, so you are free to reuse all the code as long as you respect the terms (keep it open source, under GPL, and cite the author).

Posts: 25   Pages: 3   [ Previous Page | 1 2 3 ]