Notifications
Clear all

[Closed] Please confirm…

Yeah I was looking at that too, nothing stands out probably need compiling as Hybrid and running under the debugger to isolate the issue. As it’s not a solution it’s a bit moot but could be easy fix for Autodesk if you do find it

this is just nasty coding…


if ( !l_newSel.IsEmpty()  )

from UpdateLoopEdgeSelection

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

there is no problem for me to catch a fact of breaking the system…
i’ve designed some tool that extends the Skin modifier methods. the one thing is ‘step-weighting’. with ‘ring’ but without ‘loop’ method it becomes asymmetrical. which makes me disappointed.

autodesk is busy… it’s too much work of making new icons for the ribbon UI…

void EditPolyObject::UpdateRingEdgeSelection(const int in_newSpinnerValue ) 
  {
  
  	TimeValue	l_currentTime	= 0;

the culprit

void EditPolyObject::UpdateLoopEdgeSelection(const int in_newSpinnerValue) 
  {
  
  	TimeValue	l_currentTime	= ip->GetTime();

system error on ip->GetTime();

yeah

changing

TimeValue	l_currentTime	= ip->GetTime();

to

TimeValue	l_currentTime	= 0;

and adding

if(ip)
 		l_currentTime = ip->GetTime();

after

l_newSel.ClearAll();

in the function

void EditPolyObject::UpdateLoopEdgeSelection(const int in_newSpinnerValue) 

in file \maxsdk\samples\mesh\editablepoly\PolyEdit.cpp

“should” fix it, then fix it for all other versions and remember to fix it for all future versions :banghead:

Or drop it in at the right place at Autodesk (i.e. close to the actual developers) and I’m sure they’ll fix it quickly. There are enough people around here who have access to them I’m sure.
Nice work on finding the error

I’ve dropped it in a place where hopefully someone will pick it up…

… and it’s now been logged so it should be fixed.

Can anyone imagine why there should be a GetTime() in the first place ?
Initially i thought it might be necessary for the animated EditPoly stuff, but on a second thought, it only deals with selection. And i guess selections are not animatable with the edit poly internal anim support…

But of course topology below can change over time, so imagine a volume select below the edit poly mod which grows over time and feeds the selection into a delete mesh modifier…

Now imagine the function gets called while being at frame 50 but always evaluates the edgeselection at frame “0”. This makes me think that the GetTime() would initially be necessary, and locking the time to “0” would be the initial problem.
That would reverse the bug somewhat. Of course this requires a solution to the GetTime() failing problem
There has to be a reason that GetTime() fails , maybe the pointer to the interface (ip) is’nt valid when it gets used…

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

at least for Edge Ring and Loop Shift operations the time doesn’t make sense. All operations they do against current selection. And you are right the GET selection methods (mesh.getEdgeSel in our case) don’t use the time. Whole class MNMesh doesn’t use the time as I see in documentation.

I don’t think it’s a fault with the getTime() but more an issue with the interface pointer ip not being initialized hence moving it inside the if statement as per UpdateRingEdgeSelection function.

for some reason it’s an argument needed for this function but is unused :curious:


 void EditPolyObject::SetEdgeSel(BitArray &set, IMeshSelect *imod, TimeValue t) {
 	if (ip) ip->ClearCurNamedSelSet();
 	if (theHold.Holding()) theHold.Put (new ComponentFlagRestore (this, MNM_SL_EDGE));
 	mm.EdgeSelect (set);
 	if (set.GetSize () < mm.nume) {
 		// Clear selection beyond set's boundaries:
 		for (int i=set.GetSize(); i<mm.nume; i++) mm.e[i].ClearFlag (MN_SEL);
 	}
 
 	// Clear selection on edges on hidden faces:
 	mm.PropegateComponentFlags (MNM_SL_EDGE, MN_SEL, MNM_SL_FACE, MN_HIDDEN, true, false);
 	mm.getEdgeSel (esel);
 
 	// Any change in selection should invalidate the preview.
 	if (EpPreviewOn()) EpPreviewInvalidate ();
 } 

so you could delete the time value code from UpdateLoopEdgeSelection & UpdateRingEdgeSelection and just pass 0 to SetEdgeSel


   Value* getEdgeSelectionShift_cf(Value** arg_list, int count)
   {
   	check_arg_count_with_keys(getEdgeSelectionShift, 2, count);
   	INode		*node	= arg_list[0]->to_node();
   	int			dir		= arg_list[1]->to_int();
   	
   	Value*		tmp;
   	BOOL		loop	= bool_key_arg(loop, tmp, TRUE);
   
   	Object* obj = Get_Object_Or_XRef_BaseObject(node->GetObjectRef());
   	if (obj->ClassID() == EPOLYOBJ_CLASS_ID) 
   	{
   		BitArray newSel;
   		
   		PolyObject *poly = dynamic_cast<PolyObject *>(obj);
   		if(poly && poly->GetMesh().nume > 0)
   		{
   			MNMesh &mesh = poly->GetMesh();
   			newSel.SetSize(mesh.nume);
   			newSel.ClearAll();
   			IMNMeshUtilities8* meshToStep = static_cast<IMNMeshUtilities8*>(mesh.GetInterface( IMNMESHUTILITIES8_INTERFACE_ID )); 
   
   			if (loop) meshToStep->SelectEdgeLoopShift(dir,newSel); 
   			else meshToStep->SelectEdgeRingShift(dir,newSel);
   		}
   		return new BitArrayValue(newSel);
   	}
   	return &undefined;
   }
   

here is workaround the EPOLY_INTERFACE…


  getEdgeSelectionShift <poly_obj> <shift_value> [loop:<default true>]
  

actually this function made me very happy. using it i’ve realized:

skin step ring/loop selection

skin step weighting

directional skin grow/shrink selection

skin weights expansion and degradation


very cool!

Page 2 / 2