Notifications
Clear all

[Closed] Spline reverse vs splineOp.revese

def_visible_primitive(reverseSpline, "reverseSpline");

Value* reverseSpline_cf(Value **arg_list, int count)
{
	enum args { kshape, kcurve, knum_args };

	check_arg_count(reverseSpline, knum_args, count);

	MAXNode* shape = (MAXNode*)arg_list[kshape];
	INode* node = get_valid_node(shape, reverseSpline);
	Object* obj = node->GetObjectRef();

	if (obj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
		obj = ((IDerivedObject*)obj)->FindBaseObject();

	if(obj->ClassID() != splineShapeClassID && obj->ClassID() != Class_ID(SPLINE3D_CLASS_ID,0))
		throw RuntimeError (GetString(IDS_SHAPE_OPERATION_ON_NONSPLINESHAPE), obj->GetObjectName()); 

	SplineShape* spline = dynamic_cast<SplineShape*>(obj);

	int curve = arg_list[kcurve]->to_int(); 
	range_check(curve, 1, spline->shape.splineCount, GetString(IDS_SHAPE_SPLINE_INDEX_OUT_OF_RANGE));

	spline->Reverse(curve - 1, TRUE);
	return &ok;
}
Page 2 / 2