Creating a custom Shape Node

Creating a custom Shape Node

Anonymous
Not applicable
992 Views
4 Replies
Message 1 of 5

Creating a custom Shape Node

Anonymous
Not applicable

Hi all,

I'm trying to put together a custom shape node, but can't find an example anywhere.

Even searching the headers there seems to be no EXPORT_METHODS macro (i.e. something like AI_SHAPE_NODE_EXPORT_METHODS akin to the other types).

Anyone happen to have an example, even a plane would be huge (and not just because they're infinite XD).

Cheers,

Alan.

0 Likes
993 Views
4 Replies
Replies (4)
Message 2 of 5

Stephen.Blair
Community Manager
Community Manager

You can't add custom shapes to Arnold, but you can use a procedural to create some combination of nodes in the scene.


There actually is a plane shape already. Just not exposed or used in any of the Arnold plugins.

C:\solidangle\mtoadeploy\2019>bin\kick -nodes | findstr plane
 plane                            shape

C:\solidangle\mtoadeploy\2019>bin\kick -info plane
node:         plane
type:         shape
output:       (null)
parameters:   22
filename:     <built-in>
version:      6.0.0.0

Type          Name                              Default
------------  --------------------------------  --------------------------------
BYTE          visibility                        255
BYTE          sidedness                         255
BOOL          receive_shadows                   true
BOOL          self_shadows                      true
BOOL          invert_normals                    false
FLOAT         ray_bias                          1e-06
MATRIX[]      matrix                            (empty)
ENUM          transform_type                    rotate_about_center
NODE[]        shader                            (empty)
BOOL          opaque                            true
BOOL          matte                             false
BOOL          use_light_group                   false
NODE[]        light_group                       (empty)
BOOL          use_shadow_group                  false
NODE[]        shadow_group                      (empty)
STRING[]      trace_sets                        (empty)
FLOAT         motion_start                      0
FLOAT         motion_end                        1
UINT          id                                0
VECTOR        point                             0, 0, 0
VECTOR        normal                            0, 0, 1
STRING        name




// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 3 of 5

Anonymous
Not applicable

Unfortunately procedurals don't work for my use case (Arnold just hangs).

It's the camera creating nodes during initialization problem, I mentioned. I've just been using a plane for now, but there are sync issues with this (changes to the plane made in node_update aren't respected on that render, but come through on the next.... to be continued

0 Likes
Message 4 of 5

Anonymous
Not applicable

Calling Update(plane) from in the camera's node_update crashes everything. So far best I've been able to do is set an attribute of type node that I'm not using to point at the camera, which get the sync issues to this state). Custom shape was to fix this as I could make a parameter referencing the camera.

Any thoughts?

0 Likes
Message 5 of 5

Stephen.Blair
Community Manager
Community Manager

What are you doing in the procedural?

A camera node shouldn't be creating nodes, and updating other nodes from a node update is going to cause problems in general.



// Stephen Blair
// Arnold Renderer Support
0 Likes