Using the Bridge Tool
-
Hello, I'm trying to use the Bridge Tool with the SendModelingCommand but I'm having trouble as there are attributes I don't know how to use. Could someone explain to me what these are for ?
MDATA_BRIDGE_ELEMENT1 = 1100, //LONG
MDATA_BRIDGE_ELEMENT2 = 1101, //LONG
MDATA_BRIDGE_ELEMENT3 = 1102, //LONG
MDATA_BRIDGE_ELEMENT4 = 1103, //LONG
MDATA_BRIDGE_OBJINDEX1 = 1104, //LINK
MDATA_BRIDGE_OBJINDEX2 = 1105, //LINK
MDATA_BRIDGE_OBJINDEX3 = 1106, //LINK
MDATA_BRIDGE_OBJINDEX4 = 1107, //LINK
MDATA_BRIDGE_DELETE = 1108, //BOOL
MDATA_BRIDGE_ISO = 1109, //BOOLAlso, given the type of elements I'm bridging and subsequently the modeling mode in which I will be using the Tool should I look out for specific things like the sequence of edges or points between the two parts to be connected ? Should I be treating Edge Selections like a sequence of point IDs or can I use them with their own IDs ?
Thank you for your time.
-
Hey @Dimitris_Derm. ,
Thank you for reaching out to us. The bridge tool in Cinema supports (in point mode) up to four objects as inputs.
MDATA_BRIDGE_OBJINDEX1toMDATA_BRIDGE_OBJINDEX4areBaseLinkparameters where you must link thePolygonObjectinstances you want to bridge. When you want the common case of bridging within one object, you set the same object for all four slots.MDATA_BRIDGE_ELEMENT1toMDATA_BRIDGE_ELEMENT4are then the element (e.g. point) indices to bridge (which can be scattered over multiple objects). They will be evaluated in relation to what you have set for the object indices.MDATA_BRIDGE_DELETEis "Delete Original Polygons" when you are bridging polygons in polygon mode.MDATA_BRIDGE_ISOseems to be related to SDS isoparms in the viewport, you can probably ignore it.// Only use case of MDATA_BRIDGE_ISO in our code base, very likely a dormant parameter. Bool BridgeTool::MouseInput(...) { // ... if (bd->GetEditState()& DISPLAYEDITSTATE::SDS) data.SetBool(MDATA_BRIDGE_ISO, true); else data.SetBool(MDATA_BRIDGE_ISO, false); // ...When bridging in edge mode, you likely will have to operate with half-edge indices, as for example described under GetEdgeS. I would personally either go for point or polygon mode bridging, as edges are a virtual construct which can be a pain in the *** to deal with in code.
Cheers,
Ferdinand -
Oh ! we can bridge independent objects ? That simplifies things as I thought I would have to Connect+Delete first and then bridge...
Thank you for the explanation of the attribute calls. -
I'm still having trouble with this.
I'm trying to bridge polygon selections on a single merged object, but it keeps returning False.
My setup:
- Single polygon object (2 cylinders under a Connect, then Connect+Delete)
- Two polygon selection tags with different names on the merged object
- Polygon mode (MODELINGCOMMANDMODE_POLYGONSELECTION)
All settings:
python settings[MDATA_BRIDGE_RESTRICT] = True settings[MDATA_BRIDGE_OBJINDEX1] = merged_obj settings[MDATA_BRIDGE_OBJINDEX2] = merged_obj settings[MDATA_BRIDGE_OBJINDEX3] = merged_obj settings[MDATA_BRIDGE_OBJINDEX4] = merged_obj settings[MDATA_BRIDGE_ELEMENT1] = 48 # First polygon of source selection settings[MDATA_BRIDGE_ELEMENT2] = 56 # Last polygon of source selection settings[MDATA_BRIDGE_ELEMENT3] = 19 # First polygon of target selection settings[MDATA_BRIDGE_ELEMENT4] = 30 # Last polygon of target selection //+ subdivision, tension, mode, etc.The bridge tool returns False. The selections are verified to exist on the object (9 polygons at indices 48-56, and 12 polygons at indices 19-30).
Questions:
- Do all MDATA_BRIDGE_OBJINDEX# need to be filled when bridging in polygon mode ?
- Do I need to apply the selections to the active BaseSelect, or should they only be in tags?
- Are there other required parameters for polygon mode ?
- Does RESTRICT=True have any meaning when using the tool programmatically ?
- If MDATA_BRIDGE_DELETE is "Keep Original Polygons" when bridging polygons then what is the MDATA_BRIDGE_KEEP_POLYGONS ?
Thanks!