public NPVoxNormalProcessorPreviewContext GeneratePreviewContext(NPVoxMeshOutput _meshOutput) { ClearInvalidPreviewContexts(); NPVoxNormalProcessorPreviewContext previewContext = ScriptableObject.CreateInstance <NPVoxNormalProcessorPreviewContext>(); previewContext.Set(_meshOutput, this); m_validPreviewContexts.Add(previewContext); return(previewContext); }
void OnDestroy() { if (m_context != null) { m_context.Invalidate(); m_context = null; } if (m_renderer != null) { m_renderer.Cleanup(); } }
public override void SetContext(NPVoxNormalProcessorPreviewContext _context) { base.SetContext(_context); NPVoxCoord size = m_context.MeshOutput.GetVoxModel().Size; m_selections = new sbyte[size.X * size.Y * size.Z]; for (int i = 0; i < m_selections.Length; i++) { m_selections[i] = UNSELECTED; } InitMeshNormals(); }
public virtual void SetContext(NPVoxNormalProcessorPreviewContext _context) { if (m_context != null) { m_context.Invalidate(); } m_context = _context; NPVoxNormalProcessor processor = m_context.ViewedProcessor; NPVoxAttributeNormalProcessorListItem listItemAttribute = NPipeReflectionUtil.GetAttribute <NPVoxAttributeNormalProcessorListItem>(processor); m_title = listItemAttribute.EditorName; InitScene(); }