RNA: support for PARM_OUTPUT & PARM_RNAPTR
authorCampbell Barton <ideasman42@gmail.com>
Mon, 21 May 2018 10:34:11 +0000 (12:34 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 21 May 2018 10:34:11 +0000 (12:34 +0200)
source/blender/makesrna/intern/makesrna.c

index 94ae49c48c34b0591b4a26cb81c9571e9b9ce5cc..26ce24d59110d556587fadaee81ad3dc2ce4adf5 100644 (file)
@@ -2092,8 +2092,16 @@ static void rna_def_struct_function_call_impl_cpp(FILE *f, StructRNA *srna, Func
                if (dp->prop->type == PROP_POINTER)
                        if ((dp->prop->flag_parameter & PARM_RNAPTR) && !(dp->prop->flag & PROP_THICK_WRAP))
                                fprintf(f, "(::%s *) &%s.ptr", rna_parameter_type_name(dp->prop), rna_safe_id(dp->prop->identifier));
-                       else if (dp->prop->flag_parameter & PARM_OUTPUT)
-                               fprintf(f, "(::%s **) &%s->ptr.data", rna_parameter_type_name(dp->prop), rna_safe_id(dp->prop->identifier));
+                       else if (dp->prop->flag_parameter & PARM_OUTPUT) {
+                               if (dp->prop->flag_parameter & PARM_RNAPTR) {
+                                       fprintf(f, "&%s->ptr",
+                                               rna_safe_id(dp->prop->identifier));
+                               }
+                               else {
+                                       fprintf(f, "(::%s **) &%s->ptr.data",
+                                               rna_parameter_type_name(dp->prop), rna_safe_id(dp->prop->identifier));
+                               }
+                       }
                        else
                                fprintf(f, "(::%s *) %s.ptr.data", rna_parameter_type_name(dp->prop), rna_safe_id(dp->prop->identifier));
                else