PDA

View Full Version : Riptide v1.8 Update


Keith Young
04-11-2008, 09:31 PM
New Riptide update on my site (http://skinprops.com/)...

Release Notes:

v1.8
--------
This release primarily focuses on a major Ngon-handling update/re-write...

- Bug/Feature-Fix: Much improved Ngon handling

When I first implemented Ngon support in Riptide, it was a bit of a struggle finding the necessary information that Riptide needed - Ngons are implemented as a layer on top of existing triangles and quads in C4D and some of the developer documentation on the subject (and access routines for utilizing Ngons) was confusing, and/or not really suited to the task at hand. Anyway, I managed to glue enough code together to get Ngon support implemented a while back, but there were a few problems with that implementation...

1. When importing, I was using very simplistic triangulation (a fan of triangles) to form the underlying polygons (triangles/quads are still there - Ngons are layered on top of them). This approach meant that only 'Convex' Ngons would load correctly - 'Concave' Ngons (quite popular from apps like SketchUp) would end up with bad polygons. [ And, it was just plain ugly ;) ]

2. Either my import or my export (or both) would not maintain vertex ordering of the Ngon indices. The vertices themselves are never re-ordered, so this did not affect Poser morphs, but ZBrush (for example) also relies on the indices used by triangles and quads remaining the same and it's possible that those were changing in the triangulation process - of course ZBrush also doesn't handle Ngons anyway, so you already had to deal with those before-hand, but it may have been an issue with some other app(s).

3. Because of all the crazy (non-compliant) .obj file formatting Riptide supports, there was tons of "similar, but mostly duplicated" paths through the code, which left a lot of room for cut/paste errors on my part.

4. Related to the above, there were some other somewhat obscure problems found and fixed during the re-write.

...basically, I gutted the Import and Export Ngon handling code and started over from scratch. The new Import code uses Cinema4D's internal triangulation routines, resulting in quads/triangles and support for 'Concave' Ngons. This also included a fairly substantial re-structuring of my general polygon parsing code. With some additional effort, It now also maintains vertex-ordering for Ngons (yay).

There may or may not be (new) bugs in the code (none that I've found yet), but a side-benifit of the re-structuring is that it's now more consolidated (less room for typos) and easier to maintain.

[NOTE: Ngons with 'holes' in them are still not supported (no way that I know of to represent those in a .obj file)]

Finally, I also added support for "f v/ v/ v/" and fixed support for "f v// v// v//" formatted facet records (neither of which are compliant with the file format spec, but you'd be amazed at some of the stuff I've seen in .obj files). Riptide can currently parse the following facet record formats:

fo <plus any of the below> (really old format used 'fo' instead of 'f' for faces)
f v v v (<--- compliant, vertex-only)
f v/ v/ v/
f v// v// v//
f v/t v/t v/t (<--- compliant, vertex + texture vertex)
f v/t/ v/t/ v/t/
f v//n v//n v//n (<--- compliant, vertex + normal)
f v/t/n v/t/n v/t/n (<--- compliant, vertex + texture + normal)

...the v/t/n in the above examples are stand-ins for some 'vertex index' (an index into one of the tables), which can also be specified as negative offsets, which Riptide also supports, along with any embedded '\' line-continuation.

Anyway, "better Ngon support" was one of the few (only?) remaining reasons to force use of the C4D built-in .obj import/export - despite it's other issues, it handled Concave Ngons just fine. But enough geek-speak.. as usual, for more information or any questions, please visit the Riptide Support Forums - ( http://skinprops.com/ext/forum/forum_viewforum.php?9 (http://skinprops.com/ext/forum/forum_viewforum.php?9) ).


- Functionality: Holy Ngons

Speaking of Ngons with 'holes' in them (like a window cut out of a wall), since these can not be saved to a .obj file, a check is now run on the document before prompting for a filename. If any Ngons are found with holes in them on any mesh that is subject to export (visible and not restricted by an export mask tag), a new Yes/No dialog will pop up...

"At least one mesh object contains Ngons with 'holes'...

Click Yes to disable exporting Ngons and Continue.
Click No to Cancel."

...if you click Yes, the export process will continue, but the "Export Ngons" option will be disabled (it/they will be written out as individual triangles and/or quads instead of a 4+ sided Ngon). If you click No, the export is aborted.

To fix these Ngons for export, you can try knifing at least one new edge from an interior hole edge/vertex out to an exterior edge or vertex of the Ngon.


- Enhancement: Material Handling change

There was a recent inquiry about how materials are loaded/set when there's an existing material with the same name as one being loaded (when you merge an import into an existing scene). The short answer is that IF it's a 'standard' C4D material (ie. not a 'Shader' or Plugin material of some sort) and it has the same name, it would be updated with data read from the .mtl file. If it did not exist, or a non-standard material with that name existed, a new material
would be created with the .mtl file data.

If you already had a bunch of materials in the scene converted to Vray materials (whatever format that is), or some other plugin material, this could leave you with a lot of work to clean up all the material references.

With this release, the functionality has changed as follows:

* if no material exists in the scene with the desired name, a new one is created.
* if a 'standard' C4D material exists in the scene with the desired name, it will be updated.
* if any non-standard (or plugin) material exists in the scene with the desired name, it will be used, but not altered.

...this change means that shaders (like Nukei, Banji, Danel, Fog, Cheen, etc) as well as any plugin materials (like Vray) would be used if they were already set up in the scene. I don't have Vray and hadn't done a lot of testing with this change, so let me know if there's any problems.

[ NOTE: As always, only standard materials can be 'exported' ].


- Bug/Functionality: Bump Map record change in .mtl files

As noted in the previous release, the Wavefront .mtl file-spec indicates that the record for a Bump Map file is 'bump'. Some applications use 'map_bump' and some (including all previous versions of Riptide) use 'map_Bump'.

One design goal I've tried to follow with Riptide is:

* on import, parse/support as much odd-ball formatting as possible for any supported features/records
* on export, don't create any odd-ball formatting or non-compliant records

...with this in mind, I have decided to take the high-road and change Riptide to use the proper 'bump' record on export, to be compliant with the file-spec. Of course Riptide will still accept any of the 3 when importing, so this only affects files exported by Riptide.

bobzilla
04-11-2008, 09:35 PM
Thanks, Keith.

BTW You link to your site has a misspelling. There's an "r" in the middle of skin(r)props.

Keith Young
04-11-2008, 09:41 PM
Thanks, Keith.

BTW You link to your site has a misspelling. There's an "r" in the middle of skin(r)props.

Dang twitchy-fingers! Thanks for the heads-up.. fixed.

LemonNado
04-11-2008, 10:28 PM
Awesome!

One feature would be FANTASTIC... and that would be the ability to select multiple .obj's for mass import. I tried to get a bout 200 into the system using the content browser but that crashes C4D. My meshes are very small, but there are up to one thousand... I can import them batch wise but it's tedious.

Cheers
Rainer

Keith Young
04-11-2008, 10:53 PM
I think I'm going to save any batch-type import options for a Pro version ;). But speaking of batching, IIRC, Robert's interPoser Ltd and/or Pro plugins can batch-load name-sequenced .obj files.

LemonNado
04-11-2008, 11:28 PM
Pro version sounds good. I donated for the current version and would also buy the Pro version.
Can I download it tomorrow? :bounce:

;)
Rainer


PS: Did not find an option for that in Interposer Pro... sighhhh

chi
04-13-2008, 02:28 PM
I haven't posted here for a long time. but I think this warrants a break in my silence. thanks for the hard work keith. your one of the biggest assets to c4ds compatability with other programs.

grrinc
04-13-2008, 06:53 PM
I often hear about Riptide and wonder what it actually does. I model in Silo and the obj's import into c4d no problems at all. Could some one kindly enlighten me as to what problems C4D has with obj's that I seem to be missing? Many thanks.

Keith Young
04-13-2008, 07:23 PM
I often hear about Riptide and wonder what it actually does. I model in Silo and the obj's import into c4d no problems at all. Could some one kindly enlighten me as to what problems C4D has with obj's that I seem to be missing? Many thanks.

I'll take a stab at that :) ...

C4D .obj Export Issues:
=============================
- all 'materials' from a particular mesh are condensed and combined into the first material listed on the mesh.

+ Riptide preserves all of your material zones (polygon selections) and saves out a .mtl (material description) file as well.

- no real 'group' support and/or inflexible group support, where it exists. Basically, C4D creates ONE group record for each polygonal 'mesh' contained in the document and the group name is basically made up from all of the grouping hierarchy used within the C4D tree, so you might end up with something like:

Hyper_NURBS:Symmetry:Eye_Base:Left_Eye

...as a group name in the .obj file (note that the ':'s are added by C4D on import - they are spaces in the .obj file).

+ Riptide has a mechanism for setting up as many groups per plygonal mesh as you like and preserves those groups in the exported file.

+ Riptide has a similar mechanism for setting up "UVMapper Regions" (another form of grouping).

- no options for reversing face normals, or anything else beside scaling...

+ Riptide offers a multitude of additional export options.

- C4D exports the entire scene.

+ Riptide only exports meshes visible in the editor and also provides a 'mask from export' tag that can be used to mask entire hierachy trees/branches from being exported.


C4D .obj Import Issues:
=============================
- Material import... while C4D drops the ball on exporting materials, it actually does retain/recreate the proper polygon selections on import. I guess my only real issues/complaints here is the choice of naming of those selections ("Selection 1" .. "Selection 2" .. "Selection 3", etc.). Why not just use the material name(s)? And the fact that it makes no attempt to actually read the .mtl file and reproduce any of the desired material settings.

+ Riptide creates material zone selections based on the actual names of the materials being used, attempts to re-create the actual material settings (texure files, colors, specular, bump, displacement, transparency, alpha, etc) by parsing the .mtl file if it exists and has the option of not loading any materials or settings.

- Groups. C4D will split your mesh up into multiple polygonal mesh objects (one per group it finds in the file), thus adding additional vertices in the process (breaks morphs and transfers back and forth to apps like ZBrush).

+ Riptide supports multiple groups per polygonal mesh and does not (by default) split the file up into multiple meshes (although that's an option).

- Does not preserve vertex order (whether there's groups or not).

+ Riptide always preserves vertex ordering (as long as you don't split the mesh on import).

- Lack of additional import options. There are no options to flip normals or textures or.. well, any options, aside from the scaling factor (and now normals).

+ Riptide has a multitude of additional import options, allowing you to reverse faces/normals, enable/disable various elements of the file (normals, uvs, textures, regions, groups, etc), as well as splitting the mesh up in various ways (by group, by material, by regions, not split).


...there may be others, but that's off the top of my head [ and partially from my readme file :) ].

Keith Young
04-13-2008, 07:36 PM
Of course, if you don't need any of those benefits, then there's not much reason to switch.

grrinc
04-13-2008, 08:44 PM
Thanks Keith. I had no idea obj was so under supported. I guess I will encounter these problems when I finally come to put together some scenes and start rigging. I also have to wonder why Maxon cant address these issues themselves. It would appear by the support you get from C4D users that there is a market for proper obj implementation.

You're a good man.

Keith Young
04-13-2008, 09:11 PM
Thanks Keith. I had no idea obj was so under supported. I guess I will encounter these problems when I finally come to put together some scenes and start rigging. I also have to wonder why Maxon cant address these issues themselves. It would appear by the support you get from C4D users that there is a market for proper obj implementation.

You're a good man.

Well, on one hand, I don't fault them too much... "proper obj implementation" is subjective (even not really applicable to C4D in many cases)... C4D is a general-purpose modelling (and CA and texturing and rendering, etc) app and not really designed around the .obj file format. So while I agree that the built-in import/export functionality could certainly be improved, much of what I've added to my plugin is above and beyond what might be expected from a host app (more in the 'added value' territory). I'd rather they spent thier time and resources working on the cool core program stuff :).

CGTalk Moderation
04-13-2008, 09:11 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.