void modify_geometry(int obj, Scene& scene, GeometryList& out) { // Call the engine on all the caches: for (unsigned i = 0; i < out.objects(); i++) { GeoInfo& info = out[i]; // Copy over old UV attributes keep_uvs(i, info, out); // Reusable pointer for the attribute we are going to be writing to Attribute* uv; // Copy over pt attributes uv = out.writable_attribute(i, Group_Points, uv_attrib_name, VECTOR4_ATTRIB); transform_each_element_in_attribute(uv, info.points()); // If the previously detected group type is vertex attribute we need to modify it as well // since vertex attribs take precedence and say a Sphere in Nuke has vertex attribs // as opposed to point attribs :-( so justified double work here if(t_group_type == Group_Vertices) { uv = out.writable_attribute(i, Group_Vertices, uv_attrib_name, VECTOR4_ATTRIB); transform_each_element_in_attribute(uv, info.vertices()); // Copy over vertex attributes } } }
void ToNukeGeometryConverter::convert( GeometryList &geoList ) const { int objIndex = m_objIndexParameter->getNumericValue(); if ( objIndex == -1 ) { objIndex = (int)geoList.objects(); } geoList.add_object(objIndex); ConstCompoundObjectPtr operands = parameters()->getTypedValidatedValue<CompoundObject>(); doConversion( srcParameter()->getValidatedValue(), geoList, objIndex, operands.get() ); }
void modify_geometry(int obj, Scene& scene, GeometryList& out) { const char* uv_attrib_name = "uv"; // Call the engine on all the caches: for (unsigned i = 0; i < out.objects(); i++) { GeoInfo& info = out[i]; // Copy over old UV attributes keep_uvs(i, info, out); // TODO: investigate difference between vertex and point UVs // Create a point attribute Attribute* uv = out.writable_attribute(i, Group_Points, uv_attrib_name, VECTOR4_ATTRIB); if(!uv) return; for (unsigned p = 0; p < info.points(); p++) { distorter.distort_uv(uv->vector4(p)); } } }