Jump to content

Arc SOP


Recommended Posts

It is my first SOP (and my first C++ programm as well) so be indulgent pls.

Just want to know "what is good...what is wrong...what is possible to make easier"

This sop not finished yet.

Still have no idea how to perform "Custom Variable Mapping"

Look at example file to understand what i mean.

solveXform function looks too complex as well...i`m sure it is possible to make easier.

Project.zip

Link to comment
Share on other sites

Very cool! Looks like you've got most of it figured out to me.

Some very minor points:

- OP_3PArcOperator is not needed. Very seldom does anyone need to derive from OP_Operator

- UTaddWarning ... Instead of 46, you could also #include <GU/GU_Error.h> and use GU_WARNING_NEWORDER instead

- When calling boss->opStart(), the user may have already hit the escape key so the code usually looks like this:

if (boss-&gt;opStart("Building Arc"))
{
   // do algorithm here
   // periodically check if boss-&gt;opInterrupt() returns true in which case
   // the user hit the escape key so quit
}
boss-&gt;opEnd()

- The parameter accessors done that way are error prone. Yes, I know the HDK examples do them that way. :) The less error prone way is to use the parameter token. eg.

    float	P1X(float t)  { return evalFloat("p1", 0, t); }

As for the attributes, you can just use GEO_Detail::addVariableName(). The first parameter is the attribute name, and the second parameter is the name you which to use as the local variable name. These mean exactly what you would put in an AttribCreate SOP.

Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...