[Bf-blender-cvs] [475c13a] object_nodes: Rename: POINTER base type to "RNAPOINTER".

Lukas Tönne noreply at git.blender.org
Mon Jan 18 13:10:51 CET 2016


Commit: 475c13a7d2bec821e6e7692d630bd63a92a4f032
Author: Lukas Tönne
Date:   Thu Jan 14 15:38:30 2016 +0100
Branches: object_nodes
https://developer.blender.org/rB475c13a7d2bec821e6e7692d630bd63a92a4f032

Rename: POINTER base type to "RNAPOINTER".

This is so the POINTER type can be used for general struct pointers and arrays.

RNA pointers should eventually be replaced with more specific types for
data that can be accessed in the bvm system.

===================================================================

M	source/blender/blenvm/BVM_types.h
M	source/blender/blenvm/bvm/bvm_eval.cc
M	source/blender/blenvm/bvm/bvm_eval_common.h
M	source/blender/blenvm/bvm/bvm_eval_curve.h
M	source/blender/blenvm/bvm/bvm_eval_mesh.h
M	source/blender/blenvm/bvm/bvm_opcode.h
M	source/blender/blenvm/compile/bvm_codegen.cc
M	source/blender/blenvm/compile/bvm_nodegraph.cc
M	source/blender/blenvm/compile/bvm_typedesc.h
M	source/blender/blenvm/intern/bvm_api.cc
M	source/blender/makesrna/intern/rna_blenvm.c

===================================================================

diff --git a/source/blender/blenvm/BVM_types.h b/source/blender/blenvm/BVM_types.h
index e76e647..3293aa2 100644
--- a/source/blender/blenvm/BVM_types.h
+++ b/source/blender/blenvm/BVM_types.h
@@ -43,7 +43,7 @@ typedef enum BVMType {
 	BVM_INT,
 	BVM_MATRIX44,
 	BVM_STRING,
-	BVM_POINTER,
+	BVM_RNAPOINTER,
 	BVM_MESH,
 	BVM_DUPLIS,
 } BVMType;
diff --git a/source/blender/blenvm/bvm/bvm_eval.cc b/source/blender/blenvm/bvm/bvm_eval.cc
index 7a8cdb9..f469e0e 100644
--- a/source/blender/blenvm/bvm/bvm_eval.cc
+++ b/source/blender/blenvm/bvm/bvm_eval.cc
@@ -127,9 +127,9 @@ static void eval_op_value_string(float *stack, const char *value, StackIndex off
 /* Note: pointer data is not explicitly stored on the stack,
  * this function always creates simply a NULL pointer.
  */
-static void eval_op_value_pointer(float *stack, StackIndex offset)
+static void eval_op_value_rnapointer(float *stack, StackIndex offset)
 {
-	stack_store_pointer(stack, offset, PointerRNA_NULL);
+	stack_store_rnapointer(stack, offset, PointerRNA_NULL);
 }
 
 /* Note: mesh data is not explicitly stored on the stack,
@@ -234,12 +234,12 @@ static void eval_op_mix_rgb(float *stack, int mode, StackIndex offset_col_a, Sta
 static void eval_op_object_lookup(const EvalGlobals *globals, float *stack, int key, StackIndex offset_object)
 {
 	PointerRNA ptr = globals->lookup_object(key);
-	stack_store_pointer(stack, offset_object, ptr);
+	stack_store_rnapointer(stack, offset_object, ptr);
 }
 
 static void eval_op_object_transform(float *stack, StackIndex offset_object, StackIndex offset_transform)
 {
-	PointerRNA ptr = stack_load_pointer(stack, offset_object);
+	PointerRNA ptr = stack_load_rnapointer(stack, offset_object);
 	matrix44 obmat;
 	if (ptr.data && RNA_struct_is_a(&RNA_Object, ptr.type)) {
 		Object *ob = (Object *)ptr.data;
@@ -266,7 +266,7 @@ static void eval_op_effector_transform(const EvalGlobals *globals, float *stack,
 static void eval_op_effector_closest_point(float *stack, StackIndex offset_object, StackIndex offset_vector,
                                            StackIndex offset_position, StackIndex offset_normal, StackIndex offset_tangent)
 {
-	PointerRNA ptr = stack_load_pointer(stack, offset_object);
+	PointerRNA ptr = stack_load_rnapointer(stack, offset_object);
 	if (!ptr.data)
 		return;
 	Object *ob = (Object *)ptr.data;
@@ -306,7 +306,7 @@ static void eval_op_effector_closest_point(float *stack, StackIndex offset_objec
 static void eval_op_make_dupli(float *stack, StackIndex offset_object, StackIndex offset_transform, StackIndex offset_index,
                                StackIndex offset_hide, StackIndex offset_recursive, StackIndex offset_dupli)
 {
-	PointerRNA object = stack_load_pointer(stack, offset_object);
+	PointerRNA object = stack_load_rnapointer(stack, offset_object);
 	if (!object.data || !RNA_struct_is_a(&RNA_Object, object.type))
 		return;
 	
@@ -384,9 +384,9 @@ void EvalContext::eval_instructions(const EvalGlobals *globals, const Instructio
 				eval_op_value_string(stack, value, offset);
 				break;
 			}
-			case OP_VALUE_POINTER: {
+			case OP_VALUE_RNAPOINTER: {
 				StackIndex offset = fn->read_stack_index(&instr);
-				eval_op_value_pointer(stack, offset);
+				eval_op_value_rnapointer(stack, offset);
 				break;
 			}
 			case OP_VALUE_MESH: {
diff --git a/source/blender/blenvm/bvm/bvm_eval_common.h b/source/blender/blenvm/bvm/bvm_eval_common.h
index 5baa686..23b521c 100644
--- a/source/blender/blenvm/bvm/bvm_eval_common.h
+++ b/source/blender/blenvm/bvm/bvm_eval_common.h
@@ -85,7 +85,7 @@ inline static const char *stack_load_string(float *stack, StackIndex offset)
 	return *(const char **)(&stack[offset]);
 }
 
-inline static PointerRNA stack_load_pointer(float *stack, StackIndex offset)
+inline static PointerRNA stack_load_rnapointer(float *stack, StackIndex offset)
 {
 	return *(PointerRNA *)(&stack[offset]);
 }
@@ -152,7 +152,7 @@ inline static void stack_store_string(float *stack, StackIndex offset, const cha
 	*(const char **)(&stack[offset]) = s;
 }
 
-inline static void stack_store_pointer(float *stack, StackIndex offset, PointerRNA p)
+inline static void stack_store_rnapointer(float *stack, StackIndex offset, PointerRNA p)
 {
 	*(PointerRNA *)(&stack[offset]) = p;
 }
diff --git a/source/blender/blenvm/bvm/bvm_eval_curve.h b/source/blender/blenvm/bvm/bvm_eval_curve.h
index 09131b9..852ca41 100644
--- a/source/blender/blenvm/bvm/bvm_eval_curve.h
+++ b/source/blender/blenvm/bvm/bvm_eval_curve.h
@@ -57,7 +57,7 @@ static void eval_op_curve_path(float *stack,
                                StackIndex offset_weight,
                                StackIndex offset_tilt)
 {
-	PointerRNA ptr = stack_load_pointer(stack, offset_object);
+	PointerRNA ptr = stack_load_rnapointer(stack, offset_object);
 	float t = stack_load_float(stack, offset_param);
 	
 	/* where_on_path is touchy about 0 > t > 1 */
diff --git a/source/blender/blenvm/bvm/bvm_eval_mesh.h b/source/blender/blenvm/bvm/bvm_eval_mesh.h
index 79bb34a..f1f2937 100644
--- a/source/blender/blenvm/bvm/bvm_eval_mesh.h
+++ b/source/blender/blenvm/bvm/bvm_eval_mesh.h
@@ -48,7 +48,7 @@ namespace bvm {
 
 static void eval_op_mesh_load(float *stack, StackIndex offset_base_mesh, StackIndex offset_mesh)
 {
-	PointerRNA ptr = stack_load_pointer(stack, offset_base_mesh);
+	PointerRNA ptr = stack_load_rnapointer(stack, offset_base_mesh);
 	DerivedMesh *dm;
 	if (ptr.data && RNA_struct_is_a(&RNA_Mesh, ptr.type)) {
 		dm = CDDM_from_mesh((Mesh *)ptr.data);
@@ -63,7 +63,7 @@ static void eval_op_object_final_mesh(float *stack,
                                       StackIndex offset_object,
                                       StackIndex offset_mesh)
 {
-	PointerRNA ptr = stack_load_pointer(stack, offset_object);
+	PointerRNA ptr = stack_load_rnapointer(stack, offset_object);
 	
 	DerivedMesh *result = NULL;
 	if (ptr.data && RNA_struct_is_a(&RNA_Object, ptr.type)) {
@@ -473,7 +473,7 @@ static void eval_op_mesh_boolean(const EvalGlobals *UNUSED(globals),
                                  StackIndex offset_threshold,
                                  StackIndex offset_mesh_out)
 {
-	PointerRNA ptr = stack_load_pointer(stack, offset_object);
+	PointerRNA ptr = stack_load_rnapointer(stack, offset_object);
 	DerivedMesh *dm = stack_load_mesh(stack, offset_mesh_in);
 	
 	DerivedMesh *result = NULL;
diff --git a/source/blender/blenvm/bvm/bvm_opcode.h b/source/blender/blenvm/bvm/bvm_opcode.h
index 2e861e2..b635ec3 100644
--- a/source/blender/blenvm/bvm/bvm_opcode.h
+++ b/source/blender/blenvm/bvm/bvm_opcode.h
@@ -50,7 +50,7 @@ namespace bvm {
 	DEF_OPCODE(VALUE_INT) \
 	DEF_OPCODE(VALUE_MATRIX44) \
 	DEF_OPCODE(VALUE_STRING) \
-	DEF_OPCODE(VALUE_POINTER) \
+	DEF_OPCODE(VALUE_RNAPOINTER) \
 	DEF_OPCODE(VALUE_MESH) \
 	DEF_OPCODE(VALUE_DUPLIS) \
 	\
diff --git a/source/blender/blenvm/compile/bvm_codegen.cc b/source/blender/blenvm/compile/bvm_codegen.cc
index 1f23235..d95f4d9 100644
--- a/source/blender/blenvm/compile/bvm_codegen.cc
+++ b/source/blender/blenvm/compile/bvm_codegen.cc
@@ -277,8 +277,8 @@ void Compiler::push_constant(const Value *value) const
 			push_string(s);
 			break;
 		}
-		case BVM_POINTER: {
-			/* POINTER type can not be stored as a constant */
+		case BVM_RNAPOINTER: {
+			/* RNAPOINTER type can not be stored as a constant */
 			break;
 		}
 		
@@ -350,8 +350,8 @@ void Compiler::codegen_value(const Value *value, StackIndex offset) const
 			push_stack_index(offset);
 			break;
 		}
-		case BVM_POINTER: {
-			push_opcode(OP_VALUE_POINTER);
+		case BVM_RNAPOINTER: {
+			push_opcode(OP_VALUE_RNAPOINTER);
 			push_stack_index(offset);
 			break;
 		}
@@ -378,7 +378,7 @@ static OpCode ptr_init_opcode(const TypeDesc &typedesc)
 		case BVM_INT:
 		case BVM_MATRIX44:
 		case BVM_STRING:
-		case BVM_POINTER:
+		case BVM_RNAPOINTER:
 			return OP_NOOP;
 		
 		case BVM_MESH:
@@ -398,7 +398,7 @@ static OpCode ptr_release_opcode(const TypeDesc &typedesc)
 		case BVM_INT:
 		case BVM_MATRIX44:
 		case BVM_STRING:
-		case BVM_POINTER:
+		case BVM_RNAPOINTER:
 			return OP_NOOP;
 		
 		case BVM_MESH:
diff --git a/source/blender/blenvm/compile/bvm_nodegraph.cc b/source/blender/blenvm/compile/bvm_nodegraph.cc
index 4be778f..63b4d22 100644
--- a/source/blender/blenvm/compile/bvm_nodegraph.cc
+++ b/source/blender/blenvm/compile/bvm_nodegraph.cc
@@ -800,7 +800,7 @@ NodeInstance *NodeGraph::add_proxy(const TypeDesc &typedesc, Value *default_valu
 				case BVM_INT: node = add_node("PASS_INT"); break;
 				case BVM_MATRIX44: node = add_node("PASS_MATRIX44"); break;
 				case BVM_STRING: node = add_node("PASS_STRING"); break;
-				case BVM_POINTER: node = add_node("PASS_POINTER"); break;
+				case BVM_RNAPOINTER: node = add_node("PASS_RNAPOINTER"); break;
 				case BVM_MESH: node = add_node("PASS_MESH"); break;
 				case BVM_DUPLIS: node = add_node("PASS_DUPLIS"); break;
 			}
@@ -813,7 +813,7 @@ NodeInstance *NodeGraph::add_proxy(const TypeDesc &typedesc, Value *default_valu
 				case BVM_INT: node = add_node("PASS_INT_ARRAY"); break;
 				case BVM_MATRIX44: node = add_node("PASS_MATRIX44_ARRAY"); break;
 				case BVM_STRING: node = add_node("PASS_STRING_ARRAY"); break;
-				case BVM_POINTER: node = add_node("PASS_POINTER_ARRAY"); break;
+				case BVM_RNAPOINTER: node = add_node("PASS_RNAPOINTER_ARRAY"); break;
 				case BVM_MESH: node = add_node("PASS_MESH_ARRAY"); break;
 				case BVM_DUPLIS: node = add_node("PASS_DUPLIS_ARRAY"); break;
 			}
@@ -834,7 +834,7 @@ OutputKey NodeGraph::add_value_node(Value *value)
 		case BVM_INT: node = add_node("VALUE_INT"); break;
 		case BVM_MATRIX44: node = add_node("VALUE_MATRIX44"); break;
 		case BVM_STRING: node = add_node("VALUE_STRING"); break;
-		case BVM_POINTER: node = add_node("VALUE_POINTER"); break;
+		case BVM_RNAPOINTER: node = add_node("VALUE_RNAPOINTER"); break;
 		case BVM_MESH: node = add_node("VALUE_MESH"); break;
 		case BVM_DUPLIS: node = add_node("VALUE_DUPLIS"); break;
 	}
@@ -853,7 +853,7 @@ OutputKey NodeGraph::add_argument_node(const TypeDesc &typedesc)
 		case BVM_INT: node = add_node("ARG_INT"); break;
 		case BVM_MATRIX44: node = add_node("ARG_MATRIX44"); break;
 		case BVM_STRING: node = add_node("ARG_STRING"); break;
-		case BVM_

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list