Object rendering pink in imported OBJ


#1

I started from the Shaderball scene at https://github.com/appleseedhq/shaderball, and I made a few edits to the .appleseed file to include a cube.obj exported from Blender. The materials are all the same; I just added the lines:

            <object name="cube" model="mesh_object">
                <parameter name="filename" value="cube.obj" />
            </object>
            <object_instance name="cube_inst" object="cube.Cube">
                <assign_material slot="default" side="front" material="test_mat" />
                <assign_material slot="default" side="back" material="test_mat" />
            </object_instance>

and removed the object_instances for the shaderball (aside from background and lights).

For whatever reason, the object is rendering flat pink. I don’t see it documented anywhere, but it seems to be that the pink indicates something invalid. I know the materials all work fine, as the unmodified shaderball scene renders exactly like the xample.

cube.obj and my .appleseed file are attached (if you want to try it, you’d likely have to start from the shaderball scene, put the cube in geometry, and put test.appleseed alongside shaderball.appleseed.

I don’t have the slightest idea how to even begin diagnosing what is supposedly invalid here.

test.appleseed (18.6 KB)
cube.obj (699 Bytes)


#2

Note that this is the kind of things you can do from appleseed.studio.

Exactly: flat pink means no material. I suppose that your cube.obj mesh has different material slots than default (to which you are assigning test_mat). You can either inspect cube.obj manually to find out how its material slots are called, or simply load the scene in appleseed.studio and assign materials from there.

Finally, note that by far the best way to use appleseed is to use one of the DCC plugins:


#3

I’ve been using Appleseed Studio - however, I wasn’t aware until now that I could add objects and assign materials. Good to know.

It seems it was just called “Material”. I didn’t realize that it made use of material slots in the OBJ.

I get that the preferred way of using Appleseed is via those plugins, but my background is more on the side of renderers and procedural generation (and this is likely closer to how I’ll be using Appleseed) and less on the 3D modeling tools - so I’ve been trying to understand the underlying renderer a bit first.

Thanks for the help; I know my use case is an atypical one.


#4

Makes sense, no problem!

It’s not particularly intuitive at the moment, but if you right-click on an assembly or on the Objects item, you can import geometry.

Similarly, if you right-click on an object instance, you can assign materials to it.


#5

Hi Hodapp87, if you are looking at procedural generation, I would definitely look at Blender. It has a very strong Python underpinning to allow this. There is even a plugin called Animation Nodes which has a flowchart style of creating your scene. It is nice to have a wireframe feedback while you are creating your work.


#6

Thanks - I’ll give this a look.

I’ve used Blender’s Python interface for plenty in the past, but have had a hard time getting along it in general. I am still going to use it here and there, but was looking at probably doing the procedural generation via some other code and DSLs I made myself.


#7

Probably the most flexible way is to use OSL. It is already a DSL for the purpose you state and appleseed has full support for it. If you look for instance in appleseed/shaders/src/maya you will find the OSL source code of many of Maya’s procedural shaders (marble, noise, crater…) If you compile your own shader to an OSO file and add it to the appleseed shaders you would ba able to use it then.
For Blender, @Jonathan_Dent has been working on an OSL script node which would allow directly loading a custom OSL source file.


#8

Hi Hodapp87,

For procedural generation of scenes we have a few things. I can recommend the python bindings to get started and prototype things. Ofc, you can use the C++ API too.

There is also another way, what we call procedural assemblies. They are plugins that generate geometry, materials, lights. They are loaded and executed before rendering starts.

Est.


#9

It is more procedural geometry that I was looking at, but I will check into these shaders anyhow. I haven’t really touched OSL much yet, but if I understand you right, in order to use one it needs to be compiled to an OSO (via oslc) and put wherever Appleseed expects to see them, correct?


#10

The file format looked straightforward enough that once I had straightened out a few things I didn’t understand (like my original post here) I figured I could generate the XML from common tools pretty easily… however, procedural assemblies sound interesting. Any good links/examples on these?


#11

Hi @Hodapp87,
There is an older forum post with some precompiled plugin examples to download.
https://forum.appleseedhq.net/t/distancefieldobject/448/2
In appleseed they can be found under: appleseed\samples\cpp
Included is documentation howto compile and use the plugins.

Yes, that is the correct.