Beispiel #1
0
            internal static unsafe void Invoke(MaterialFunction MaterialFunction, MaterialExpression Expression)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = MaterialFunction;
                *((IntPtr *)(b + 8)) = Expression;
                Main.GetProcessEvent(MaterialEditingLibrary.DefaultObject, DeleteMaterialExpressionInFunction_ptr, new IntPtr(p));;
            }
        }
Beispiel #2
0
            internal static unsafe bool Invoke(MaterialExpression FromExpression, string FromOutputName, byte Property)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = FromExpression;
                var FromOutputName_handle = GCHandle.Alloc(FromOutputName, GCHandleType.Pinned);

                *(IntPtr *)(b + 8)                = FromOutputName_handle.AddrOfPinnedObject();
                *(int *)(b + IntPtr.Size + 8)     = FromOutputName.Length;
                *(int *)(b + IntPtr.Size + 4 + 8) = FromOutputName.Length;
                *(b + 24) = Property;
                Main.GetProcessEvent(MaterialEditingLibrary.DefaultObject, ConnectMaterialProperty_ptr, new IntPtr(p));;
                FromOutputName_handle.Free();
                return(*((bool *)(b + 25)));
            }
        }
 ///<summary>Delete a specific expression from a material function. Will disconnect from other expressions.</summary>
 public static void DeleteMaterialExpressionInFunction(MaterialFunction MaterialFunction, MaterialExpression Expression) =>
 MaterialEditingLibrary_methods.DeleteMaterialExpressionInFunction_method.Invoke(MaterialFunction, Expression);
 ///<summary>Connect a material expression output to one of the material property inputs (e.</summary>
 ///<remarks>
 ///g. diffuse color, opacity etc)
 ///@param  FromExpression          Expression to make connection from
 ///@param  FromOutputName          Name of output of FromExpression to make connection from
 ///@param  Property                        Property input on material to make connection to
 ///</remarks>
 public static bool ConnectMaterialProperty(MaterialExpression FromExpression, string FromOutputName, byte Property) =>
 MaterialEditingLibrary_methods.ConnectMaterialProperty_method.Invoke(FromExpression, FromOutputName, Property);
 ///<summary>
 ///Create connection between two material expressions
 ///@
 ///</summary>
 ///<remarks>
 ///param  FromExpression          Expression to make connection from
 ///@param  FromOutputName          Name of output of FromExpression to make connection from. Leave empty to use first output.
 ///@param  ToExpression            Expression to make connection to
 ///@param  ToInputName                     Name of input of ToExpression to make connection to. Leave empty to use first input.
 ///</remarks>
 public static bool ConnectMaterialExpressions(MaterialExpression FromExpression, string FromOutputName, MaterialExpression ToExpression, string ToInputName) =>
 MaterialEditingLibrary_methods.ConnectMaterialExpressions_method.Invoke(FromExpression, FromOutputName, ToExpression, ToInputName);