/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Public
	
	public HoudiniGeoAttributeManagerGUI( HoudiniGeoAttributeManager manager ) 
	{
		myManager					= manager;

		myForceInspectorRedraw		= false;
		myShowMinMax				= false;

		myIsMouseDown				= false;
		myMouseKey					= 0;
		myCurrentlyPressedKey		= KeyCode.None;
		myCurrentlyPressedSecondKey	= KeyCode.None;
		myCurrentlyPressedModeKey	= KeyCode.None;

		myFirstMousePosition		= new Vector3();

		mySelectionArea				= new Rect();
		mySelectionMeshColours		= null;
		mySelectionMesh				= null;
		mySelectionMaterial			= null;
		mySelectedPoints			= new List< int >();
		mySelectedPointsMask		= new List< bool >();

		myLastMode					= HoudiniGeoAttributeManager.Mode.NONE;

		HoudiniHost.myRepaintDelegate += this.refresh;
		HoudiniHost.myDeselectionDelegate += this.deselect;
		HoudiniHost.mySelectionTarget = myManager.prTransform.gameObject;
	}
Beispiel #2
0
    public HoudiniGeoAttributeManager copy()
    {
        HoudiniGeoAttributeManager new_manager =
            ScriptableObject.CreateInstance <HoudiniGeoAttributeManager>();

        // It's ok to init the new manager with the mesh, mesh renderer, and mesh
        // collider of the old manager because these things will be overwritten
        // on next cook. I think.
        new_manager.init(myMesh, myMeshRenderer, myMeshCollider, myTransform);

        for (int i = 0; i < myAttributes.Count; ++i)
        {
            HoudiniGeoAttribute new_attribute = myAttributes[i].copy();
            new_manager.addAttribute(new_attribute);
        }

        return(new_manager);
    }
	private void changeModes( ref bool paint_mode, ref bool edit_points_mode, HoudiniGeoAttributeManager.Mode mode )
	{
		switch ( mode )
		{
			case HoudiniGeoAttributeManager.Mode.NONE: 
				{
					paint_mode = false;
					edit_points_mode = false;
					break;
				}
			case HoudiniGeoAttributeManager.Mode.PAINT:
				{
					paint_mode = true;
					edit_points_mode = false;
					break;
				}
			case HoudiniGeoAttributeManager.Mode.EDIT:
				{
					paint_mode = false;
					edit_points_mode = true;
					break;
				}
			default:
				Debug.LogError( "Invalid mode?" ); break;
		}
	}