Example #1
0
	private void DrawPaintModeInfo()
	{
	    bool bFillInvoked = false;

	    float uiWidth = _editorUIRect.width * _infoPanelSettingsWidth;

	    using (var verticalSpace = new GUILayout.VerticalScope(EditorStyles.helpBox, GUILayout.MaxWidth(uiWidth)))
	    {
		// Attribute Selection, and paint values

		DrawAttributeSelection();

		DrawPaintAttributeValues();

		SerializedProperty paintMeshProperty = HEU_EditorUtility.GetSerializedProperty(_toolsInfoSerializedObject, "_paintMeshVisiblity");
		if (paintMeshProperty != null)
		{
		    int currentVisibility = paintMeshProperty.enumValueIndex;
		    EditorGUILayout.PropertyField(paintMeshProperty, new GUIContent("Paint Mesh Visiblity"));
		    if (currentVisibility != paintMeshProperty.enumValueIndex)
		    {
			ChangePaintMeshVisiblity((HEU_ToolsInfo.PaintMeshVisibility)paintMeshProperty.enumValueIndex);
		    }
		}
	    }

	    using (var verticalSpace = new GUILayout.VerticalScope(EditorStyles.helpBox))
	    {
		// Tool Settings

		HEU_EditorUtility.EditorDrawBoolProperty(_toolsInfoSerializedObject, "_liveUpdate", _cookOnMouseReleaseLabel, "Auto-cook on mouse release when painting.");

		HEU_EditorUtility.EditorDrawFloatProperty(_toolsInfoSerializedObject, "_paintBrushSize", _brushSizeLabel, "Change brush size via Shift + drag or Shift + mouse scroll.");
		HEU_EditorUtility.EditorDrawFloatProperty(_toolsInfoSerializedObject, "_paintBrushOpacity", _brushOpacityLabel, "Blending factor when merging source and destination colors.");

		HEU_EditorUtility.EditorDrawSerializedProperty(_toolsInfoSerializedObject, "_paintMergeMode", _brushMergeMode, "How paint color is applied to surface.");

		HEU_EditorUtility.EditorDrawSerializedProperty(_toolsInfoSerializedObject, "_brushHandleColor", _brushHandleColor, "Color of the brush handle in Scene.");

		bFillInvoked = GUILayout.Button(_paintFillLabel, GUILayout.Height(_buttonHeight));
	    }

	    if (_selectedAttributesStore != null)
	    {
		if (bFillInvoked)
		{
		    HEU_ToolsInfo toolsInfo = _toolsInfoSerializedObject.targetObject as HEU_ToolsInfo;
		    _selectedAttributesStore.FillAttribute(_selectedAttributeData, toolsInfo);

		    _GUIChanged = true;
		}
	    }
	}
Example #2
0
		private void DrawEditModeInfo()
		{
			float uiWidth = _editorUIRect.width * _infoPanelSettingsWidth;

			using (var verticalSpace = new GUILayout.VerticalScope(EditorStyles.helpBox, GUILayout.MaxWidth(uiWidth)))
			{
				// Attribute Selection and editing values

				DrawAttributeSelection();

				DrawEditAttributeValues();
			}

			using (var verticalSpace = new GUILayout.VerticalScope(EditorStyles.helpBox))
			{
				// Tool Settings

				EditorGUI.BeginChangeCheck();

				SerializedProperty showGeoProperty = HEU_EditorUtility.GetSerializedProperty(_toolsInfoSerializedObject, "_showOnlyEditGeometry");
				if (showGeoProperty != null)
				{
					bool bOldValue = showGeoProperty.boolValue;
					EditorGUILayout.PropertyField(showGeoProperty, new GUIContent(_showOnlyEditGeoLabel, "Show only this edit node's geometry."));
					if (bOldValue != showGeoProperty.boolValue)
					{
						UpdateShowOnlyEditGeometry();
					}
				}

				HEU_EditorUtility.EditorDrawFloatProperty(_toolsInfoSerializedObject, "_editPointBoxSize", _pointSizeLabel, "Change size of the point box visualization.");

				HEU_EditorUtility.EditorDrawSerializedProperty(_toolsInfoSerializedObject, "_editPointBoxUnselectedColor", _unselectedPtColorLabel);

				HEU_EditorUtility.EditorDrawSerializedProperty(_toolsInfoSerializedObject, "_editPointBoxSelectedColor", _selectedPtColorLabel);

				EditorGUILayout.LabelField(_selectedPtsLabel + _editPointsSelectedIndices.Count);

				if (GUILayout.Button(_selectAllPtsLabel, GUILayout.Height(_buttonHeight)))
				{
					SelectAllPoints();
				}

				if (EditorGUI.EndChangeCheck())
				{
					GenerateEditPointBoxNewMesh();
				}
			}
		}
		private void DrawCurvesSection(HEU_HoudiniAsset asset, SerializedObject assetObject)
		{
			if (asset.GetEditableCurveCount() <= 0)
			{
				return;
			}

			GUIStyle buttonStyle = new GUIStyle(GUI.skin.button);
			buttonStyle.fontSize = 11;
			buttonStyle.alignment = TextAnchor.MiddleCenter;
			buttonStyle.fixedHeight = 24;
			buttonStyle.margin.left = 34;

			HEU_EditorUI.BeginSection();
			{
				SerializedProperty showCurvesProperty = HEU_EditorUtility.GetSerializedProperty(assetObject, "_showCurvesSection");
				if (showCurvesProperty != null)
				{
					showCurvesProperty.boolValue = HEU_EditorUI.DrawFoldOut(showCurvesProperty.boolValue, "CURVES");
					if (showCurvesProperty.boolValue)
					{
						SerializedProperty curveEditorProperty = HEU_EditorUtility.GetSerializedProperty(assetObject, "_curveEditorEnabled");
						if (curveEditorProperty != null)
						{
							EditorGUILayout.PropertyField(curveEditorProperty);
						}

						HEU_EditorUI.DrawHeadingLabel("Collision Settings");
						EditorGUI.indentLevel++;

						string projectLabel = "Project Curves To ";
						List<HEU_Curve> curves = asset.GetCurves();

						SerializedProperty curveCollisionProperty = HEU_EditorUtility.GetSerializedProperty(assetObject, "_curveDrawCollision");
						if (curveCollisionProperty != null)
						{
							EditorGUILayout.PropertyField(curveCollisionProperty, new GUIContent("Collision Type"));
							if (curveCollisionProperty.enumValueIndex == (int)HEU_Curve.CurveDrawCollision.COLLIDERS)
							{
								HEU_EditorUtility.EditorDrawSerializedProperty(assetObject, "_curveDrawColliders", label: "Colliders");
								projectLabel += "Colliders";
							}
							else if (curveCollisionProperty.enumValueIndex == (int)HEU_Curve.CurveDrawCollision.LAYERMASK)
							{
								HEU_EditorUtility.EditorDrawSerializedProperty(assetObject, "_curveDrawLayerMask", label: "Layer Mask");
								projectLabel += "Layer";
							}

							HEU_EditorUI.DrawSeparator();

							EditorGUI.indentLevel--;
							HEU_EditorUI.DrawHeadingLabel("Projection Settings");
							EditorGUI.indentLevel++;

							HEU_EditorUtility.EditorDrawSerializedProperty(assetObject, "_curveProjectDirection", label: "Project Direction", tooltip: "The ray cast direction for projecting the curve points.");
							HEU_EditorUtility.EditorDrawFloatProperty(assetObject, "_curveProjectMaxDistance", label: "Project Max Distance", tooltip: "The maximum ray cast distance for projecting the curve points.");

							_projectCurvePointsButton.text = projectLabel;
							if (GUILayout.Button(_projectCurvePointsButton, buttonStyle, GUILayout.MaxWidth(180)))
							{
								SerializedProperty projectDirProperty = HEU_EditorUtility.GetSerializedProperty(assetObject, "_curveProjectDirection");
								SerializedProperty maxDistanceProperty = HEU_EditorUtility.GetSerializedProperty(assetObject, "_curveProjectMaxDistance");

								Vector3 projectDir = projectDirProperty != null ? projectDirProperty.vector3Value : Vector3.down;
								float maxDistance = maxDistanceProperty != null ? maxDistanceProperty.floatValue : 0;

								for (int i = 0; i < curves.Count; ++i)
								{
									curves[i].ProjectToColliders(asset, projectDir, maxDistance);
								}
							}
						}

						EditorGUI.indentLevel--;

						HEU_EditorUI.DrawSeparator();

						for (int i = 0; i < curves.Count; ++i)
						{
							if (curves[i].Parameters != null)
							{
								DrawParameters(curves[i].Parameters, ref _curveParameterEditor);
							}
						}
					}
				}
			}
			HEU_EditorUI.EndSection();

			HEU_EditorUI.DrawSeparator();
		}