Jump to content

Nyrow

Members
  • Content count

    12
  • Joined

  • Last visited

Everything posted by Nyrow

  1. Thank you so much ! It works like a charm
  2. Hello, I have a strange problem. I am moving the elements of a mesh (in runtime but in the scene view), such as the faces, edges or vertices, thanks to a 3D captation device, not through standard handle translations. Moving these elements works properly, but "the selection highlight" (in blue), doesn't follow the mesh modifications. As soon as I finished my move and select another element, this "selection highlight" suits the shape as I would like to. But once again, if I start deforming the mesh (thanks to pb.SetSharedVertexPosition();), it the selection highlight doesn't follow. Do you know where should I start looking for solving it ? Problem Selection.webm
  3. Thank you very much. How could I call the pb_Editor.Refresh() inside my Monobehaviour script (after having make a change to the mesh) ? I have the EditorCallBackViewer in which I can use pb_Editor.Refresh(), but I don't know how to access it from my non-Editor script. A work around would be to refresh the editor in OnGUI() but it is not very accurate...
  4. Nyrow

    Moving pivot points?

    Thank you very much !
  5. Nyrow

    Moving pivot points?

    But where is the center of the mesh itself ? When I select my pbObject and click on CenterPivot, it works fine : it moves the pivot at the center of the pbObject. In other words, how can I find the world position of the center of gravity of the pbObject ? Sorry to insist, I really tried to find the solution, but I still havent succeeded it yet...
  6. Nyrow

    Moving pivot points?

    Thank you, But I still don't know what to write in centerpivot() to centre the pivot inside the pb_object ?
  7. Nyrow

    Moving pivot points?

    Hi, How can we use the pb.CenterPivot(...) in scripting ? Apparently it is a Vector3 but needs to be filled with indices. I guess these are pb.sharedIndices ? How can I use that ?
  8. Nyrow

    Runtime Level Editor Thread

    That is impressive, keep on it then ! I have to say your project would be so useful that I could give a bit to help the donation fund of the license
  9. Nyrow

    Runtime Level Editor Thread

    Hi bigd, as Hertzole, your Runtime mesh editor looks very promising. My project is a physical 3d modelization tool, and I would like to simulate a 3d software through Unity. Your project looks really useful for me because I am struggling at each step to adapt solutions to the editor mode (in order to have probuilder, the handles etc...). Do you think you will be able to create basic modelization functions (such as extrusion?) Have you decided wether you will publish your code ? If so... can I ask you when ?
  10. Nyrow

    Runtime Level Editor Thread

    Hi, I found this in the "HighlightNearestFace" example : /** * Returns the average of each vertex position in a face. * In local space. */ private Vector3 FaceCenter(pb_Object pb, pb_Face face) { Vector3[] vertices = pb.vertices; Vector3 average = Vector3.zero; // face holds triangle data. distinctIndices is a // cached collection of the distinct indices that // make up the triangles. Ex: // tris = {0, 1, 2, 2, 3, 0} // distinct indices = {0, 1, 2, 3} foreach(int index in face.distinctIndices) { average.x += vertices[index].x; average.y += vertices[index].y; average.z += vertices[index].z; } float len = (float) face.distinctIndices.Length; average.x /= len; average.y /= len; average.z /= len; return average; } I also found this topic using the function, I hope it can help. pb_Math.BoundsCenter(vertexOrigins); Also, do you know if there is an easy way of getting the vertex position of the two vertex in pb.SelectedEdges[0] ? (I am trying to get the center of the edge, not of the face). And lastly, how do you get the position of the selected vertex ? Is there an equivalent of pb.SelectedFace and pb.SelectedEdges but for the vertex ?
  11. Hello, I am new to Probuilder and I am struggling on -I guess- a small problem. How can I check what is the selected mode (Object, Vertex, Edge, Face) ? I would like to have a switch case to deal with each mode. Also, do you know how to set the mode to one particular element (other than through pressing shortcut keys or clicking on the toolbar) by scripting ? I have found "SelectMode" but I dont know how to modify or check it. Thank you
×