Пример #1
0
    def init(self, context):
        self.width = 250
        self.inputs.new("ImageSocket", "image_in")
        self.inputs.new("StringsSocket", "mask_in")
        self.inputs.new("StringsSocket", "keypoints_in")

        self.outputs.new("StringsSocket", "keypoints_out")
        self.outputs.new("StringsSocket", "descriptors_out")
        InitFeature2DOperator.update_class_instance_dict(
            self, self.id_data.name, self.name)
        FEATURE2D_INSTANCES_DICT.get("{}.{}".format(self.id_data.name,
                                                    self.name))
        self.update_layout(context)
Пример #2
0
 def draw_buttons(self, context, layout):
     origin = self.get_node_origin()
     self.add_button(layout=layout, prop_name='loc_work_mode', expand=True)
     self.add_button(layout=layout, prop_name='loc_state_mode', expand=True)
     if self.loc_state_mode == "INIT":
         layout.operator("node.init_feature_2d",
                         icon='MENU_PANEL').origin = origin
         layout.label(text="Instance: {}".format(self.loc_class_repr))
         for key in InitFeature2DOperator.get_init_kwargs(self):
             arg_name = key
             if arg_name.startswith("_"):
                 arg_name = "T1" + arg_name
             layout.row().prop(self, "{}_init".format(arg_name))
     elif self.loc_state_mode == "LOAD":
         layout.row().prop(self, "loc_file_load")
     elif self.loc_state_mode == "SAVE":
         layout.row().prop(self, "loc_file_save")
Пример #3
0
 def update_and_init(self, context):
     InitFeature2DOperator.update_class_instance_dict(self, self.id_data.name, self.name)
     self.update_sockets(context)
     update_node(self, context)
Пример #4
0
 def update_and_init(self, context):
     InitFeature2DOperator.update_class_instance_dict(
         self, self.id_data.name, self.name)
     self.update_layout(context)