<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Accessing Sweep&#x27;s spline data from C4DImportExport.cpp]]></title><description><![CDATA[<p dir="auto">Hello,<br />
In the process of writing tool (<a href="https://github.com/syanenko/pov-tools" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/syanenko/pov-tools</a>) for exporting C4D objects to <a href="http://www.povray.org/" target="_blank" rel="noopener noreferrer nofollow ugc">POV-Ray</a>, I've ran into following problem: can not find any information about accessing spline data, available in <em>Details</em> tab of <em>Sweep node</em>,   from C++.</p>
<p dir="auto">This spline is marked on following image:<br />
<img src="https://developers.maxon.net/forum/assets/uploads/files/1678823155642-c4d_spline.png" alt="c4d_spline.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I would  like to use this data to alter sphere radius in POV's <a href="https://wiki.povray.org/content/User:Le_Forgeron/sphere_sweep" target="_blank" rel="noopener noreferrer nofollow ugc"><em>Sphere sweep</em></a> object. The code of this tool is based on <em>C4DImportExport.cpp</em> example.</p>
<p dir="auto">Could you please point me in the right direction?</p>
<p dir="auto">Thanks in advance,<br />
Sergey (Yesbird).</p>
]]></description><link>http://developers.maxon.net/forum/topic/14451/accessing-sweep-s-spline-data-from-c4dimportexport-cpp</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 18:16:12 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/14451.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Mar 2023 05:38:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Accessing Sweep&#x27;s spline data from C4DImportExport.cpp on Thu, 06 Apr 2023 16:52:03 GMT]]></title><description><![CDATA[<p dir="auto">Hi, @Manuel.</p>
<p dir="auto">I understand, thank you.</p>
<p dir="auto">All the best,<br />
....<br />
YB</p>
]]></description><link>http://developers.maxon.net/forum/post/71155</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/71155</guid><dc:creator><![CDATA[yesbird]]></dc:creator><pubDate>Thu, 06 Apr 2023 16:52:03 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing Sweep&#x27;s spline data from C4DImportExport.cpp on Thu, 06 Apr 2023 07:20:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/yesbird">@<bdi>yesbird</bdi></a> said in <a href="https://developers.maxon.net/forum/post/71151" target="_blank" rel="noopener noreferrer nofollow ugc">Accessing Sweep's spline data from C4DImportExport.cpp</a>:</p>
<blockquote>
<p dir="auto">Could you tell me please, if you have plans of it's implementation ?<br />
If not, I could implement it myself, having access to Cineware sources.</p>
</blockquote>
<p dir="auto">HI,</p>
<p dir="auto">I'm sorry but we cannot share this kind of information or the source code. The function is implemented in the regular SDK. i am sure that there were technical difficulties to make it available in Cineware.</p>
<p dir="auto">Cheers,<br />
Manuel</p>
]]></description><link>http://developers.maxon.net/forum/post/71153</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/71153</guid><dc:creator><![CDATA[Manuel]]></dc:creator><pubDate>Thu, 06 Apr 2023 07:20:09 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing Sweep&#x27;s spline data from C4DImportExport.cpp on Wed, 05 Apr 2023 12:17:07 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/manuel">@<bdi>Manuel</bdi></a><br />
You wrote:</p>
<blockquote>
<p dir="auto">This is not available in the implementation, which is why it is commented out (and why you have this error message 'unresolved external')</p>
</blockquote>
<p dir="auto">about this method:</p>
<pre><code>// Vector GetPoint(Float r) const;
</code></pre>
<p dir="auto">Although now I have spline implementation (cubic and linear) and using it for calculation the more neat solution could be to implementing method, mentioned above.</p>
<p dir="auto">Could you tell me please, if you have plans of it's implementation ?<br />
If not, I could implement it myself, having access to Cineware sources.</p>
<p dir="auto">All the best,<br />
....<br />
YB</p>
]]></description><link>http://developers.maxon.net/forum/post/71151</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/71151</guid><dc:creator><![CDATA[yesbird]]></dc:creator><pubDate>Wed, 05 Apr 2023 12:17:07 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing Sweep&#x27;s spline data from C4DImportExport.cpp on Wed, 15 Mar 2023 17:40:41 GMT]]></title><description><![CDATA[<p dir="auto">Hi,@manuel.</p>
<p dir="auto">Thank you for explanation, I will calculate spline points myself, no problem.</p>
<p dir="auto">All the best,<br />
....<br />
YB</p>
]]></description><link>http://developers.maxon.net/forum/post/70995</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/70995</guid><dc:creator><![CDATA[yesbird]]></dc:creator><pubDate>Wed, 15 Mar 2023 17:40:41 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing Sweep&#x27;s spline data from C4DImportExport.cpp on Thu, 16 Mar 2023 07:58:50 GMT]]></title><description><![CDATA[<p dir="auto">hi,</p>
<p dir="auto">ha yes, did not saw that. This is not available in the implementation, which is why it is commented out (and why you have this error message 'unresolved external')<br />
I first though you could create a spline and use <a href="https://developers.maxon.net/docs/cpp/2023_2/class_spline_object.html#aa49f6f89b43ea40c148a821b6b6151f2" target="_blank" rel="noopener noreferrer nofollow ugc">GetSplinePoint</a> but this is not available neither.</p>
<p dir="auto">The only option is to retrieve the knots corresponding to the range of your value and calculate yourself the interpolation.<br />
From each knot you can retrieve the <a href="https://developers.maxon.net/docs/CinewareSDK/html/structcineware_1_1_custom_spline_knot.html" target="_blank" rel="noopener noreferrer nofollow ugc">CustomSplineKnot data</a> from where you can get the position and the right or left tangent. that will be your four points to calculate the interpolation. Of course, t must be a value from 0.0 to 1.0. <s>That should be your initial value minus the first knot position.x</s>. &lt;- It is more complicate than that but you have the idea <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61b.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--stuck_out_tongue" style="height:23px;width:auto;vertical-align:middle" title=":p" alt="😛" /></p>
<p dir="auto">There are only three interpolation modes, but you might want to support only Bezier and linear.</p>
<pre><code>CustomSplineKnotInterpolationBezier 	Bezier interpolation.
CustomSplineKnotInterpolationLinear 	Linear interpolation.
CustomSplineKnotInterpolationCubic 	Cubic interpolation.
</code></pre>
<p dir="auto">Cheers,<br />
Manuel</p>
]]></description><link>http://developers.maxon.net/forum/post/70992</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/70992</guid><dc:creator><![CDATA[Manuel]]></dc:creator><pubDate>Thu, 16 Mar 2023 07:58:50 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing Sweep&#x27;s spline data from C4DImportExport.cpp on Wed, 15 Mar 2023 16:32:42 GMT]]></title><description><![CDATA[<p dir="auto">Hi, @manuel.</p>
<p dir="auto">Many thanks for fast and detailed response. Fortunately, I've alredy passed all steps, but last - getting spline points (not knots), and unfortunately, can not do it by strange issue: in file  <em>customgui_splinecontrol.h</em> method that I need:</p>
<pre><code>//Vector GetPoint(Float r) const;
</code></pre>
<p dir="auto">is commented out and when uncommented, gives '<em>unresolved externa</em>' error.</p>
<p dir="auto">I have the lates SDK version:<br />
22.008_RBCinewaresdk22.0_355130</p>
<p dir="auto">Could you please help me to find workaroud for this problem ?</p>
<p dir="auto">Thanks in advance,<br />
Sergey (Yesbird).</p>
]]></description><link>http://developers.maxon.net/forum/post/70990</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/70990</guid><dc:creator><![CDATA[yesbird]]></dc:creator><pubDate>Wed, 15 Mar 2023 16:32:42 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing Sweep&#x27;s spline data from C4DImportExport.cpp on Wed, 15 Mar 2023 11:32:22 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">It's true that the sweep nurbs is not there in the example. Supporting it is easy, at least once you know how to ^^'<br />
in the file alien_def.h you must add a class to support the SweepNurb</p>
<pre><code>class AlienSweepObjectData : public NodeData
{
	INSTANCEOF(AlienSweepObjectData, NodeData)

public:
	virtual Bool Execute();
};

</code></pre>
<p dir="auto">And of course you need to implement it and retrieve all the parameter you need.</p>
<pre><code>Bool AlienSweepObjectData::Execute()
{
	BaseObject* op = (BaseObject*)GetNode();
	Char* pChar = op-&gt;GetName().GetCStringCopy();
	if (pChar)
	{
		printf("\n - AlienExtrudeObjectData (%d): %s\n", (int)op-&gt;GetType(), pChar);
		DeleteMem(pChar);
	}
	else
		printf("\n - AlienExtrudeObjectData (%d): &lt;noname&gt;\n", (int)op-&gt;GetType());


	GeData splineScaleParameter;
	op-&gt;GetParameter(SWEEPOBJECT_SPLINESCALE, splineScaleParameter);
	
	if (splineScaleParameter.GetType() == CUSTOMDATATYPE_SPLINE)
	{
		SplineData* splineData = static_cast&lt;SplineData*&gt;(splineScaleParameter.GetCustomDataType(CUSTOMDATATYPE_SPLINE));

		if (splineData != nullptr)
		{
			Int32 knotCount = splineData-&gt;GetKnotCount();
			printf("\n   - number of knots %d \n", (int)knotCount);
		}
	}
	return false;
}

</code></pre>
<p dir="auto">Now, to make the object getting supported, you must add a case in the function <code>NodeData *AllocAlienObjectData(Int32 id, Bool &amp;known, BaseList2D* node)</code> like so:</p>
<pre><code>case Osweep:
	m_data = NewObj(AlienSweepObjectData);
	break;
</code></pre>
<p dir="auto">Now that the object is getting called you can retrieve all the data you want from it. This parameter is storing <a href="https://developers.maxon.net/docs/cpp/2023_2/class_spline_data.html" target="_blank" rel="noopener noreferrer nofollow ugc">SplineData</a> type. In our "regular" sdk (available with all c4d build in the main directory you have a zip archive) we have an example on how to retrieve or set SplineData. The file is in the directory "gui" and is called "objectdata_descriptions.cpp"</p>
<pre><code>// somewhere in objectdata_descriptions.cpp
node-&gt;GetParameter(DescID(ID_DYNAMIC_ELEMENT + DESCRIPTIONELEMENTS::SPLINE), data, DESCFLAGS_GET::NONE);

if (data.GetType() == CUSTOMDATATYPE_SPLINE)
{
	SplineData* splineData = (SplineData*)data.GetCustomDataType(CUSTOMDATATYPE_SPLINE);

	if (splineData != nullptr)
	{

		splineData-&gt;SetRange(0.0, 100.0, 0.1, 0.0, 100, 0.0);

		splineData-&gt;DeleteAllPoints();
		splineData-&gt;InsertKnot(0, 0);
		splineData-&gt;InsertKnot(100, 100);

		// set parameter
		node-&gt;SetParameter(DescID(ID_DYNAMIC_ELEMENT + DESCRIPTIONELEMENTS::SPLINE), data, DESCFLAGS_SET::NONE);
	}
}
</code></pre>
<p dir="auto">Finally, to retrieve an ID of a parameter you can <a href="https://developers.maxon.net/docs/py/2023_2/manuals/introduction/python_console.html#parameters" target="_blank" rel="noopener noreferrer nofollow ugc">drag and drop it on the console</a><br />
For the sweep object you are interested by <code>SWEEPOBJECT_SPLINESCALE</code> and <code>SWEEPOBJECT_SPLINEROTATION</code></p>
<p dir="auto">let me know if i forgot something or if it is not clear.</p>
<p dir="auto">Cheers,<br />
Manuel</p>
]]></description><link>http://developers.maxon.net/forum/post/70986</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/70986</guid><dc:creator><![CDATA[Manuel]]></dc:creator><pubDate>Wed, 15 Mar 2023 11:32:22 GMT</pubDate></item></channel></rss>