Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenloader/intern/readfile.c2
-rw-r--r--source/blender/makesdna/DNA_space_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_space.c14
3 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 5b6dafe94ac..76038b94b27 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7647,8 +7647,6 @@ static void lib_link_area(FileData *fd, ID *parent_id, ScrArea *area)
snode->id = newlibadr(fd, parent_id->lib, snode->id);
snode->from = newlibadr(fd, parent_id->lib, snode->from);
- snode->simulation = newlibadr(fd, parent_id->lib, snode->simulation);
-
ntree = snode->id ? ntreeFromID(snode->id) : NULL;
snode->nodetree = ntree ? ntree : newlibadr(fd, parent_id->lib, snode->nodetree);
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 422025a134b..d57fa8c9de1 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -1352,7 +1352,6 @@ typedef struct SpaceNode {
/** Context, no need to save in file? well... pinning... */
struct ID *id, *from;
- struct Simulation *simulation;
/** Menunr: browse id block in header. */
short flag;
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index e62185ccdb1..ad12cf76b47 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2166,6 +2166,12 @@ static void rna_SpaceNodeEditor_node_tree_update(const bContext *C, PointerRNA *
ED_node_tree_update(C);
}
+static PointerRNA rna_SpaceNodeEditor_simulation_get(PointerRNA *ptr)
+{
+ SpaceNode *snode = (SpaceNode *)ptr->data;
+ return rna_pointer_inherit_refine(ptr, &RNA_Simulation, snode->id);
+}
+
static void rna_SpaceNodeEditor_simulation_set(PointerRNA *ptr,
const PointerRNA value,
struct ReportList *UNUSED(reports))
@@ -2179,7 +2185,6 @@ static void rna_SpaceNodeEditor_simulation_set(PointerRNA *ptr,
else {
ED_node_tree_start(snode, NULL, NULL, NULL);
}
- snode->simulation = sim;
snode->id = &sim->id;
}
@@ -6223,8 +6228,13 @@ static void rna_def_space_node(BlenderRNA *brna)
prop = RNA_def_property(srna, "simulation", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_struct_type(prop, "Simulation");
RNA_def_property_ui_text(prop, "Simulation", "Simulation that is being edited");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceNodeEditor_simulation_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop,
+ "rna_SpaceNodeEditor_simulation_get",
+ "rna_SpaceNodeEditor_simulation_set",
+ NULL,
+ NULL);
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, NULL);
prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE);