Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/02/2012 at 01:12, xxxxxxxx wrote:
User Information: Cinema 4D Version: 13 Platform: Language(s) : PYTHON ;
--------- I've been trying to get my head around this with little success
Cube editable select point create vertex map - tag is first tag
Get a point object - editable cube op vtag = op.GetFirstTag() vtag is a variabletag object and CalcVertexmap - doesn't use that type of object
Q: How do I retrieve the Vertex Map weight info?
From what I can see I should get a list of weights (as reals equal to the number of points??)
Get a point object - editable cube op PointObject.CalcVertexmap( modifier ) cvm = op.CalcVertexmap(whats the modifier?)
PointObject.CalcVertexmap
guidance appreciated
On 01/02/2012 at 01:30, xxxxxxxx wrote:
You're on the right lines but I don't think you need to use CalcVertexMap(). What I do is get the tag, which is a VariableTag, then get the array of SReals it points to. In C++ something like this:
// *vt = a pointer to your vertex map tag LONG vcnt = vt->GetDataCount(); SReal *vmap = vt->GetDataAddressW(); for(LONG i = 0; i < vcnt; i++) { // get the weight for each vertex, for example: if(vmap[i] == 1.0 // this is the weight { // carry out the desired action } }
I assume these calls are present in Python as well as in C++, but I haven't looked.
Steve
On 01/02/2012 at 01:49, xxxxxxxx wrote:
cheers Steve
Lots of things are starting to fall into place but the SDK still frustrates me
I can see how the pointer would work I guess I need (how to get the pointer) equivalent in Python
Edit - still going round and round getting nowhere what is the modifier please and the use of CalcVertextMap()
Edit - think I've found something... tag = op.GetFirstTag() - first tag is VertexMap print tag.GetAllHighlevelData()
aahhh! - the SDK is really not a helpful doc (sorry - just frustrating)
Edit - OK I can get the tag and the Map height per point and I'll get done what needs to be done - pseudo code
Get object Check object is poly Get pointslist Search tags Find Vertex tag Check name Discard if not the one I want (have to have some way to identify) Check Object point count against Tags Height Data count If OK make use of values against object pointslist exit
Note - I've searched the net and the SDK and can't find anything concrete on getting a vertex Map in Python. To that end, it would be very useful to have an experienced programmer post an example of how to do the job correctly.
As I'm still learning - I don't want to post anything that might steer others in the wrong direction