Community
Arnold General Rendering Forum
cancel
Showing results forย 
Showย ย onlyย  | Search instead forย 
Did you mean:ย 

[RFE] Example Procedurals in Documentation Need Updating

2 REPLIES 2
Reply
Message 1 of 3
mmarengoKAM7M
240 Views, 2 Replies

[RFE] Example Procedurals in Documentation Need Updating

Hi there,

HtoA 6.0.1.0 (Arnold 7.0.0.0)
Houdini 18.5.696
CentOS Linux 7 (Core), Linux kernel 3.10.0-1160.31.1.el7.x86_64

I was recently testing the API for procedurals using the examples in the official documentation (e.g: the one for random flakes here https://docs.arnoldrenderer.com/display/A5ARP/Random+Flake+Procedural) but this line (and similar AiNode() calls in the other 2 examples in the docs) was causing some interesting problems:

    // create node with procedural node as parent
    AtNode *points_node = AiNode("points", "flake", node)

This will compile and link without issues (which is interesting), but will break at runtime with the following symptoms:

  1. The first problem is that Arnold will just bail with a message like "cannot use a parent node from a different universe".
  2. If you then remove the node (parent) from the call, Arnold will hang forever with all CPUs burning but doing nothing (some kind of infinite loop).

I finally bit the bullet and looked at the signature for AiNode() in the API docs, which explains the problem: The first argument is supposed to be a pointer to AtUniverse (and the examples are passing a pointer to char). Anyway, things work fine once I change those to match the signature with something like:

    // create node with procedural node as parent
    AtNode *points_node = AiNode(AiNodeGetUniverse(node), "points", "flake", node)

So the RFE: Please update the docs ๐Ÿ™‚

P.S: Interesting the compiler didn't catch this -- the signature for AiNode in ai_nodes.h has explicit types for the pointers (as opposed to void*), so unless there's some indirection that masks that, I would have hoped that it would catch it... have to dig deeper... just getting started on all of this.

Cheers!

Labels (3)
2 REPLIES 2
Message 2 of 3

You can define AI_ENABLE_DEPRECATION_WARNINGS to get warnings.

That will be defined by default in the future...



// Stephen Blair
// Arnold Renderer Support
Message 3 of 3

Ah! Good to know. Thanks, @Stephen Blair !

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums