Why are my port definitions duplicated in the Attribute Manager?
-
Okay, I've made some progress with this but I've run into a problem. My node appears in the 'Uncategorized' section in the asset browser, as expected. The layout in the resource editor looks like this:
The preview in the resource editor is this:
Which is all good. But when I add it to the node editor, what appears is this:
Instead of the strings I expected ('Input A' etc.) I just get what look like default strings. However, in the attribute manager I can see my attributes and these default ones:
The node does work, all it does is add two integers, and if I put values into the two input ports the results appears in the output port. But why don't I get my input and output ports instead of these apparently default ones?
-
Hey @spedler,
looks a bit like you have defined them twice Without your code we are mostly guessing ourselves here. Could you share your code please?
Cheers,
Ferdinand -
Hi @ferdinand,
Sure, no problem. Attached is a zip with the compiled binary, the database files and the source.
The source is shamelessly lifted from that in the SDK docs. One thing to be aware of - which might be relevant - is that I had to edit the description include file by hand. This is because I can't get the resource editor to generate the include file. Either it can't find the file to write to (if a relative path is given to the header, it's relative to the location of the C4D executable, and of course the header isn't there) or if an absolute path is provided the resource editor fails with this error on trying to write it:
Don't know what that means! This isn't only the case with my node, if I modify the SDK's example simple core node the same thing happens on trying to generate the include file.
Cheers,
Steve
NodeTest.zip -
-
Hello @spedler,
This question of yours did deviate too far from the original subject and was also misplaced in the General Talk forum as we are now talkig here about concrete Cinema 4D API subjects. Due to that, your posting has been forked. Note that our Forum Guidelines state:
- A topic must cover a singular subject; the initial posting must be a singular question.
- Users can ask follow-up questions, asking for clarification or alternative approaches, but follow-up questions cannot change the subject.
- When the subject of the topic is "How to create a cube object?", then a follow-up question cannot be "How to add a material to that cube?" as this would change the subject.
- A valid follow-up question would be "Are there other ways to create a cube object, as the proposed solution has the drawback X for my use-case?" or "Could you please clarify the thing Y you did mention in your answer, as this is still unclear to me?".
- There is some leverage-room for this rule, but it is rather small. Small changes in the subject are allowed, large changes are not.
Other than that, @m_adam will take over from here
Cheers,
Ferdinand - A topic must cover a singular subject; the initial posting must be a singular question.
-
Okay, so I still don't know why I got duplicate ports but I'm pretty sure it was due to my repeated tinkering with the description and not really knowing what I was doing.
I've now coded a new code from scratch and have got it working correctly with no duplicate ports
I'm writing a tutorial on how do this if anyone's interested. It'll be on my site in a couple of days. In the meantime this thread can be marked closed because the problem was beyond the keyboard, not in the SDK.
Thanks again to @ferdinand for all the help in getting to this point!
Steve
-
Hey @spedler,
sorry for the delay, but we are currently rotating here on the spot. It is great to hear that you solved your problem on your own! Please do not hesitate to reach out to us again when you run into problems.
And thank you for your patience, we are aware the Nodes API could be documented in a more beginner friendly manner.
Cheers,
Ferdinand -
Hi @ferdinand,
No problem, I got there in the end and it's actually not too tricky once you know how it's supposed to work. I'll have a go now at a material node, there are more examples of those so hopefully it'll be straightforward. I'll be sure to be back if it isn't!
In the meantime I've uploaded a detailed explanation of all the steps needed to build this kind of node to my site at https://www.microbion.co.uk/html/create_nodes_corenode1.htm so if anyone wants to see how it was done, it's all there. Hopefully it's fairly accurate; all I can say is that this is what I did and it worked for me
Thanks again for your help,
Cheers,
Steve