How to get the attributes of rsramp node in c++?
-
I want to get the value of the knots' color,interpolation,knot position and bias position of a rsramp node .It seems that it is a special data type that I can not get it like "GetOrDefaultmaxon::Float64()".
-
Welcome to the Maxon developers forum and its community, it is great to have you with us!
Getting Started
Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.
- Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
- Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
- Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.
It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions.
About your First Question
You get these parameters just as any others. Please show us the code you have, as I am not going to write here a complex node example from scratch. The ramp itself is just a variadic port, and each knot in the ramp is then a port bundle of type
com.redshift3d.redshift4c4d.portbundle.gradient
.
So, the node path for the input port of the knot position of the 0ths node would be:
// This node path goes from the root of the true node, i.e., the RS Ramp node itself. const String path = "<com.redshift3d.redshift4c4d.nodes.core.rsramp.ramp/_0/position"_s;
Please note that there is absolutely no guarantee that each variadic port does gives its 0th child the ID "_0" and its n-th child the ID "_n-1". I just happen to know that this will be the case for a default RS Ramp node. In practice you will always have to get all children of the varidiadic port, and then select the desired child by index in that list.
Cheers,
Ferdinand -
@ferdinand
Thank you for the answer! The problem is solved after I try to find the child of the port according to your answer.